From: Eric Van Hensbergen <ericvh@gmail.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>,
penberg@kernel.org, asias.hejun@gmail.com,
prasadjoshi124@gmail.com, gorcunov@gmail.com,
kvm@vger.kernel.org, jvrao <jvrao@linux.vnet.ibm.com>
Subject: Re: [PATCH 2/2] kvm tools: Add virtio-9p
Date: Tue, 17 May 2011 20:18:19 -0500 [thread overview]
Message-ID: <BANLkTimSAahJfDTGiEhjmoSnuk7hCEEixg@mail.gmail.com> (raw)
In-Reply-To: <1305664052.12150.43.camel@sasha>
On Tue, May 17, 2011 at 3:27 PM, Sasha Levin <levinsasha928@gmail.com> wrote:
> On Tue, 2011-05-17 at 22:08 +0300, Sasha Levin wrote:
>> 'kvm_9p' isn't created as a device under /dev, it's just a name used
>> internally by 9pnet_virtio (and located under sysfs).
>>
>> I couldn't figure out which params the kernel would expect to boot using
>> 9p over virtio (theres no device name to begin with).
>>
>> I've also couldn't find anything that suggested it's possible to boot
>> using virtio-9p as rootfs.
>
> Ignore that.
>
> Naming the virtio transport "/dev/root" and passing proper params to the
> kernel makes it work:
>
> [ 1.844983] VFS: Mounted root (9p filesystem) on device 0:11.
>
> I'll make some changes to the virtio-9p patch to make it easier for the
> user to do that.
>
This is really sweet. Thanks for beating me to the punch of porting
the 9p support to kvm tools.
> - Multiple virtio-9p devices.
This should be pretty straightforward.
> - Ugly hack in virtio_p9_stat() (See desc in code).
> /*
>+ * HACK: For some reason the p9 virtio transport reads a u16 and discards
>+ * it before reading the p9_rstat struct. I couldn't find a logical reason for
>+ * that, so we just add an extra u16 before the struct.
>+ */
This is part of the protocol spec (from
http://ericvh.github.com/9p-rfc/rfc9p2000.html#anchor32):
"To make the contents of a directory, such as returned by read(5),
easy to parse, each directory entry begins with a size field. For
consistency, the entries in Twstat and Rstat messages also contain
their size, which means the size appears twice. For example, the Rstat
message is formatted as ``(4+1+2+2+n)[4] Rstat tag[2] n[2] (n-2)[2]
type[2] dev[4]...,'' where n is the value returned by convD2M."
It's appropriate to duplicate the size. I think the Linux client
ignores it, but others implementations may complain.
> - Update atime/mtime in p9_wstat, not really needed.
The underlying storage may handle this for you, I think 9p avoids
updating atime by default, at least in caching scenarios -- too much
unnecessary protocol traffic.
> - Pass usernames in p9_stat, not really needed and not really sure how p9 expects to handle them.
The username, group name issue is one of the principle reasons behind
the extended protocol operations (.u and .L) -- of course, if there
was a Plan 9 or Inferno guest they would be quite happy with the
usernames, but Linux (and other UNIX variants) will want the ids. To
really keep things simple we could add a client option that would let
you pass the various ids as strings. Although no doubt folks will
want the other extensions (symlinks, links, device nodes, etc.) before
long. When we built the qemu server for .L, the team tried to keep
everything in a library, but there is some entanglement with the qemu
APIs -- it'd be nice if we could reuse that code here, maybe we need
an abstract glue layer so that the core code can be used by both the
kvm tool and qemu. I'm copy the lead of that team on this message
just so he's aware how far you've come.
-eric
next prev parent reply other threads:[~2011-05-18 1:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 18:35 [PATCH 1/2] kvm tools: Copy net/9p/9p.h Sasha Levin
2011-05-17 18:35 ` [PATCH 2/2] kvm tools: Add virtio-9p Sasha Levin
2011-05-17 18:40 ` Ingo Molnar
2011-05-17 19:08 ` Sasha Levin
2011-05-17 19:20 ` Ingo Molnar
2011-05-17 20:27 ` Sasha Levin
2011-05-18 1:18 ` Eric Van Hensbergen [this message]
2011-05-18 8:08 ` Ingo Molnar
2011-05-18 9:05 ` Sasha Levin
2011-05-20 1:10 ` Venkateswararao Jujjuri
2011-05-26 14:28 ` Venkateswararao Jujjuri
2011-05-26 14:36 ` Sasha Levin
2011-05-26 15:22 ` Venkateswararao Jujjuri
2011-05-26 15:30 ` Sasha Levin
2011-05-18 12:01 ` Sasha Levin
2011-05-18 12:06 ` Ingo Molnar
2011-05-18 12:23 ` Sasha Levin
2011-05-18 6:38 ` Pekka Enberg
2011-05-18 10:35 ` Sasha Levin
2011-05-18 10:38 ` Pekka Enberg
2011-05-18 10:47 ` Sasha Levin
2011-05-18 11:09 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTimSAahJfDTGiEhjmoSnuk7hCEEixg@mail.gmail.com \
--to=ericvh@gmail.com \
--cc=asias.hejun@gmail.com \
--cc=gorcunov@gmail.com \
--cc=jvrao@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=mingo@elte.hu \
--cc=penberg@kernel.org \
--cc=prasadjoshi124@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox