From: Sasha Levin <levinsasha928@gmail.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Osier Yang <jyang@redhat.com>,
libvir-list@redhat.com, kvm@vger.kernel.org,
penberg@cs.helsinki.fi, gorcunov@gmail.com, mingo@elte.hu,
asias.hejun@gmail.com
Subject: Re: [libvirt] (no subject)
Date: Wed, 07 Dec 2011 08:21:06 +0200 [thread overview]
Message-ID: <1323238866.8489.21.camel@lappy> (raw)
In-Reply-To: <20111206143813.GA7937@redhat.com>
On Tue, 2011-12-06 at 14:38 +0000, Daniel P. Berrange wrote:
> On Fri, Nov 11, 2011 at 07:56:58PM +0800, Osier Yang wrote:
> > * Lacks of options for user's configuration, such as "-vnc", there
> > is no option for user to configure the properties for the "vnc",
> > such as the port. It hides things, doesn't provide ways to query
> > the properties too, this causes problems for libvirt to add the
> > vnc support, as vnc clients such as virt-manager, virt-viewer,
> > have no way to connect the guest. Even vncviewer can't.
>
> Being able to specify a VNC port of libvirt's choosing is pretty
> much mandatory to be able to support that.In addition being able
> to specify the bind address is important to be able to control
> security. eg to only bind to 127.0.0.1, or only to certain NICs
> in a multi-NIC host.
I'll add that feature in the next couple of days.
>
> > * KVM tool manages the network completely itself (with DHCP support?),
> > no way to configure, except specify the modes (user|tap|none). I
> > have not test it yet, but it should need explicit script to setup
> > the network rules(e.g. NAT) for the guest access outside world.
> > Anyway, there is no way for libvirt to control the guest network.
>
> If KVM tool support TAP devices, can't be do whatever we like with
> that just by passing in a configured TAP device from libvir ?
KVM tool currently creates and configures the TAP devices it uses, it
shouldn't be an issue to have it use a TAP fd passed to it either.
How does libvirt do it? Create a /dev/tapX on it's own and pass the fd
to the hypervisor?
>
> > * There is a gap about the domain status between KVM tool and libvirt,
> > it's caused by KVM tool unlink()s the guest socket when user exits
> > from console (both text and graphic), but libvirt still think the
> > guest is running.
>
> Being able to reliably detect shutdown/exit of the KVM too is
> a very important tasks, and we can't rely on waitpid/SIG_CHLD
> because we want to daemonize all instances wrt libvirtd.
>
> In the QEMU driver we keep open a socket to the monitor, and
> when we see an I/O error / POLLHUP on the socket we know that
> QEMU has quit.
>
> What is this guest socket used for ? Could libvirt keep open a
> connection to it ?
It's being used for communication with the IPC sub-commands (like 'kvm
list', 'kvm debug', etc). It's basically the server in a server-client
setup used to signal the hypervisor to do things.
Theres also no problem with keeping an open connection to it.
> One other option would be to use inotify to watch for deletion
> of the guest socket in the filesystem. This is sortof what we
> do with the UML driver.
>
> > * KVM tool uses $HOME/.kvm_tool as the state dir, and no way to configure,
> > I made a small patch to allow KVM tool accept a ENV variable,
> > which is "KVM_STATE_DIR", it's used across the driver. I made a
> > simple patch against kvm tool to let the whole patches work. See
> > "[PATCH] kvm tools.....". As generally we want the state dir of
> > a driver can be "/var/run/libvirt/kvmtool/..." for root user or
> > "$HOME/.libvirt/kvmtool/run" for non-root user.
>
> What does it do with the state dir ? Is that just for storing the
> guest socket ?
afaik that patch should be already in as well.
It does two things in the state dir:
- Store sockets.
- KVM tools has a feature which lets a user boot a guest based on
virtio-9p which lets him see a system which is an exact copy of the
host. This makes testing of programs and sandboxing very easy. The state
files required for that are stored in that dir as well.
>
> With QEMU we chose $HOME/.libvirt/qemu or /var/run/libvirt because
> there was no policy set by QEMU itself. If KVM tool has a policy
> for where it stores its state, we should just use that, and not
> try to force it into a libvirt specific location.
>
> In a privileged libvirtd instace, we should aim to still have
> kvmtool itself run as an unprivilegd user / group , eg 'kvmtool:kvmtool'
> And we could set the home dir of that user to /var/lib/kvmtool
>
> > * kvmtoolGetVersion is just broken now, as what "./kvm version" returns
> > is something like "3.0.rc5.873.gb73216", however, libvirt wants things
> > like "2.6.40.6-0". This might be not a problem as long as KVM tool
> > has a official package.
>
> The version numbers libvirt reports for hypervisors are pretty
> meaningless really. In that example you give I'd just report '3.0'
> as the version from libvirt. Anything that relies on these versions
> from libvirt is doomed to be broken anyway.
The version is just a 'git describe' of the kernel tree in which it was
built, so if you build KVM tools from an "official" kernel tree* you'll
also get pretty versions :)
* After KVM tools is merged...
>
> > * console connection is implemented by setup ptys in libvirt, stdout/stderr
> > of kvm tool process is redirected to the master pty, and libvirt connects
> > to the slave pty. This works fine now, but it might be better if kvm
> > tool could provide more advanced console mechanisms. Just like QEMU
> > does?
>
> This sounds good enough for now.
KVM tools does a redirection to a PTY, which at that point could be
redirected to anywhere the user wants.
What features might be interesting to do on top of that?
> > * Not much ways existed yet for external apps or user to query the guest
> > informations. But this might be changed soon per KVM tool grows up
> > quickly.
>
> What sort of guest info are you thinking about ? The most immediate
> pieces of info I can imagine we need are
>
> - Mapping between PIDs and vCPU threads
> - Current balloon driver value
Those are pretty easily added using the IPC interface I've mentioned
above. For example, 'kvm balloon' and 'kvm stat' will return a lot of
info out of the balloon driver (including the memory stats VQ - which
afaik we're probably the only ones who actually do that (but I might be
wrong) :)
Any other commands are added on-demand. Just let us know what you want
to see there.
--
Sasha.
next prev parent reply other threads:[~2011-12-07 6:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-11 11:56 [libvirt] (no subject) Osier Yang
2011-11-11 11:30 ` [libvirt] Add driver support for Native Linux KVM Tool Osier Yang
2011-11-11 11:56 ` [libvirt] [PATCH 1/7] kvmtool: Add configure support Osier Yang
2011-11-11 11:57 ` [libvirt] [PATCH] kvm tools: Introduce an ENV variable for the state dir Osier Yang
2011-12-06 14:39 ` Daniel P. Berrange
2011-12-09 7:18 ` Osier Yang
2011-11-11 11:57 ` [libvirt] [PATCH 2/7] kvmtool: Add documents Osier Yang
2011-12-06 14:47 ` Daniel P. Berrange
2011-11-11 11:57 ` [libvirt] [PATCH 3/7] kvmtool: Add new enums and error codes for the driver Osier Yang
2011-12-06 14:47 ` Daniel P. Berrange
2011-11-11 11:57 ` [libvirt] [PATCH 4/7] kvmtool: Add hook support for kvmtool domain Osier Yang
2011-12-06 14:48 ` Daniel P. Berrange
2011-11-11 11:57 ` [libvirt] [PATCH 5/7] kvmtool: Add new domain type Osier Yang
2011-12-06 14:46 ` Daniel P. Berrange
2011-12-09 7:22 ` Osier Yang
2011-11-11 11:57 ` [libvirt] [PATCH 6/7] conf: Set source type of the stub console Osier Yang
2011-11-11 11:57 ` [libvirt] [PATCH 7/7] kvmtool: Implementation for kvm tool driver Osier Yang
2011-12-06 14:55 ` Daniel P. Berrange
2011-12-09 7:30 ` Osier Yang
2011-12-06 14:38 ` [libvirt] (no subject) Daniel P. Berrange
2011-12-07 6:21 ` Sasha Levin [this message]
2011-12-07 9:16 ` Daniel P. Berrange
2011-12-09 12:45 ` Osier Yang
2011-12-09 12:41 ` Osier Yang
2011-12-09 12:30 ` Osier Yang
2011-12-10 17:56 ` Pekka Enberg
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=1323238866.8489.21.camel@lappy \
--to=levinsasha928@gmail.com \
--cc=asias.hejun@gmail.com \
--cc=berrange@redhat.com \
--cc=gorcunov@gmail.com \
--cc=jyang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=libvir-list@redhat.com \
--cc=mingo@elte.hu \
--cc=penberg@cs.helsinki.fi \
/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;
as well as URLs for NNTP newsgroup(s).