Merge pull request #5 from edahlgren/master

Remove unneeded test and fix Attach args
Properly handle EOF

Wow, that was painful to find.

The RPC package is nice but, see the writeup, errors in the remote protocol
and errors in the RPC itself are handled with one error (it's tough to see how
to do it otherwise). See the arith example.

The result is you can not return <byte count, EOF> from a Read or ReadAt as
the standard functions do; this is taken s an RPC error and you don't get the bytes
back.

You can't return from a 0-byte read without having an EOF error either.
The server won't ever send a reply packet. I've not tracked down this bit of weirdness
to find out why yet.

The end result is that you have to return <bytes, nil> even if it was really a
<bytes, EOF> type read, wait for the next read, and return <0,io.EOF>

So, in this wonderful hack, I put an EOF bool in the Ioresp packet, and set that
in server.Read, determined by events. At some point we need to make this more
efficient. Or fix the RPC package. Having the server lock up as it did is weird but here you go:

4954  read(6, "\21\377\202\1\nSo9ps.Read\1\3\0005\377\225\3\1\1\6Ioargs\1"..., 4096) = 82
[ Read RPC]
4954  read(6, 0xc2080c9000, 4096)       = -1 EAGAIN (Resource temporarily unavailable)
4954  pread(7, "172.17.0.3\t110d8d626153\n127.0.0."..., 1024, 0) = 174
4954  pread(7, "", 850, 174)            = 0
[ read of /etc/hosts]

And that's all we get ...

4954  epoll_wait(4, {}, 128, 0)         = 0
4954  epoll_wait(4,  <unfinished ...>
4955  <... select resumed> )            = 0 (Timeout)
4955  futex(0x9a5040, FUTEX_WAIT, 0, {60, 0} <unfinished ...>
4954  <... epoll_wait resumed> 7fff34020c70, 128, -1) = -1 EINTR (Interrupted system call)
4954  --- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---
4954  exit_group(2)                     = ?
4957  +++ exited with 2 +++
4956  +++ exited with 2 +++
4955  +++ exited with 2 +++
4954  +++ exited with 2 +++
[hang forever until I hit ^C]

Where as in normal, IL

4919  read(6, "\21\377\202\1\nSo9ps.Read\1\3\0005\377\225\3\1\1\6Ioargs\1"..., 4096) = 82
4919  read(6, 0xc2080d3000, 4096)       = -1 EAGAIN (Resource temporarily unavailable)
4919  pread(7, "172.17.0.3\t110d8d626153\n127.0.0."..., 1024, 0) = 174
4919  pread(7, "", 850, 174)            = 0
4919  write(6, "\21\377\206\1\nSo9ps.Read\1\3\0%\377\227\3\1\1\6Ioresp\1"..., 1094) = 1094

The sole difference here being a return of a byte length of non-zero with EOF set.
Makes no sense.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
EOF testing is finally right

That one was a lot tricker than I thought it would be. It's possible it can be
done better still, but at the same time, at least we avoid the 'read 0 bytes to get
an EOF' behavior

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Formatting cleanup

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ignore the test
Formalize addfs; use it in the servers.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
File systems: add AddFS and change attach arguments

AddFS is how a given server names what is servers. Trying to add
a file system when one exists is fatal.

Attach arguments are now the name and an array of strings. In the next rev,
if a server implements Attach, it will be called, but it does not have to implement
it.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Make the attach args an interface.

We've got this language, might as well use it right.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
make AddFS what you see is what you get