[libvirt] [PATCH] Support virDomainAttachDevice and virDomainDetachDevice for disks in UML

2010-08-19 Thread soren
From: Soren Hansen so...@linux2go.dk UML supports hot plugging and unplugging of various devices. This patch exposes this functionality for disks. Signed-off-by: Soren Hansen so...@linux2go.dk --- src/uml/uml_driver.c | 223 +- 1 files changed,

Re: [libvirt] [PATCH] Support virDomainAttachDevice and virDomainDetachDevice for disks in UML

2010-08-19 Thread Daniel P. Berrange
On Thu, Aug 19, 2010 at 02:49:34PM +0200, so...@linux2go.dk wrote: From: Soren Hansen so...@linux2go.dk UML supports hot plugging and unplugging of various devices. This patch exposes this functionality for disks. Nice, I had no idea they supported that. Signed-off-by: Soren Hansen

Re: [libvirt] [PATCH 2/2] qemu: Update next usable PCI slot on domain reconnect

2010-08-19 Thread Eric Blake
On 08/18/2010 05:26 AM, Daniel P. Berrange wrote: On Wed, Aug 18, 2010 at 01:15:55PM +0200, Jiri Denemark wrote: Why do we need it to be exactly the same value ? nextslot is just an efficiency optimization isn't it. ie, so instead of starting from slot 0 and iterating over 'N' already used

Re: [libvirt] web page suggestion

2010-08-19 Thread Daniel P. Berrange
On Mon, Aug 16, 2010 at 11:29:04AM -0600, Eric Blake wrote: My XSL skills are less than stellar, so I'm throwing this out to the list in case someone else can pick it up and come up with a decent patch in less time. Right now, http://libvirt.org/ChangeLog.html is worthless; it is linked

Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-19 Thread Daniel P. Berrange
On Wed, Aug 18, 2010 at 01:35:29PM +0200, so...@linux2go.dk wrote: From: Soren Hansen so...@linux2go.dk Like that comment suggested, we just open the file and pass the file descriptor to uml. The input stream is set to null, since I couldn't find any useful way to actually use a file for

Re: [libvirt] Xen string2sexpr and sexpr2string lose quotes?

2010-08-19 Thread Daniel P. Berrange
On Tue, Aug 17, 2010 at 08:26:09PM -0700, Thomas Graves wrote: Hello all, I am running xen on rhel5 and using libvirt0.7.2 (I also tried 0.7.7) and it looks like the routines string2sexpr and sexpr2string seem to lose the quotes around the image args in the configuration. Has anyone seen

[libvirt] [PATCH] qemu: Fix JSON migrate_set_downtime command

2010-08-19 Thread Jiri Denemark
--- src/qemu/qemu_monitor_json.c |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e8609aa..8a586bc 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -1481,17 +1481,12 @@

Re: [libvirt] [PATCH 2/2] qemu: Update next usable PCI slot on domain reconnect

2010-08-19 Thread Jiri Denemark
There's no requirement to plug devices in ascending slot order - we can have gaps at will with any ordering. At this point, I'm starting to think that we can just drop this 2/2 patch and not worry about nextslot being stable across libvirtd restarts. Which means we don't even need most of

Re: [libvirt] [PATCH] Support virDomainAttachDevice and virDomainDetachDevice for disks in UML

2010-08-19 Thread Soren Hansen
On 19-08-2010 15:22, Daniel P. Berrange wrote: +static inline void umlShrinkDisks(virDomainDefPtr def, size_t i) +{ +if (def-ndisks 1) { +memmove(def-disks + i, +def-disks + i + 1, +sizeof(*def-disks) * +(def-ndisks - (i + 1)));

Re: [libvirt] [PATCH 2/2] qemu: Update next usable PCI slot on domain reconnect

2010-08-19 Thread Daniel P. Berrange
On Thu, Aug 19, 2010 at 04:57:17PM +0200, Jiri Denemark wrote: There's no requirement to plug devices in ascending slot order - we can have gaps at will with any ordering. At this point, I'm starting to think that we can just drop this 2/2 patch and not worry about nextslot being

Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-19 Thread Soren Hansen
On 19-08-2010 15:41, Daniel P. Berrange wrote: + case VIR_DOMAIN_CHR_TYPE_PIPE: +/* XXX could open the pipe just pass the FDs */ Any reason not to let the code deal with PIPE too ? It seems like the code should work equally well for both PIPE FILE. (well drop the O_CREATE|O_APPEND

Re: [libvirt] using sync_manager with libvirt

2010-08-19 Thread David Teigland
On Wed, Aug 18, 2010 at 07:44:18PM -0400, Perry Myers wrote: On 08/11/2010 05:27 PM, Daniel P. Berrange wrote: On Wed, Aug 11, 2010 at 03:37:12PM -0400, David Teigland wrote: On Wed, Aug 11, 2010 at 05:59:55PM +0100, Daniel P. Berrange wrote: On Tue, Aug 10, 2010 at 12:44:06PM -0400, David

[libvirt] New save/restore api proposal

2010-08-19 Thread Jean-Baptiste Rouault
Hello all, I'd like to add support for save and restore to the OpenVZ and VirtualBox drivers because I have to support these operations in the application I'm working on. However, the save/restore API in its current state doesn't fit well to our needs. The main problem is that the domain

Re: [libvirt] [PATCH] qemu: Fix JSON migrate_set_downtime command

2010-08-19 Thread Eric Blake
On 08/19/2010 08:47 AM, Jiri Denemark wrote: --- src/qemu/qemu_monitor_json.c |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e8609aa..8a586bc 100644 --- a/src/qemu/qemu_monitor_json.c +++

Re: [libvirt] [PATCH] qemu: Fix JSON migrate_set_downtime command

2010-08-19 Thread Eric Blake
On 08/19/2010 10:33 AM, Eric Blake wrote: On 08/19/2010 08:47 AM, Jiri Denemark wrote: --- src/qemu/qemu_monitor_json.c |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e8609aa..8a586bc 100644

Re: [libvirt] using sync_manager with libvirt

2010-08-19 Thread David Teigland
On Thu, Aug 19, 2010 at 11:12:25AM -0400, David Teigland wrote: I'm only aware of one goal, and the current plan is to implement it correctly and completely. That goal is to lock vm images so if the vm happens to run on two hosts, only one instance can access the image. (That's slightly

Re: [libvirt] [PATCH 02/10] nwfilter: use consistent OOM reporting

2010-08-19 Thread Stefan Berger
libvir-list-boun...@redhat.com wrote on 08/18/2010 07:45:05 PM: libvir-list-boun...@redhat.com * src/nwfilter/nwfilter_driver.c (nwfilterLog): Delete. (nwfilterDriverStartup): Use virReportOOMError instead. --- No point making printf uses harder to audit by hiding them in a macro,

Re: [libvirt] [PATCH 02/10] nwfilter: use consistent OOM reporting

2010-08-19 Thread Eric Blake
On 08/19/2010 12:41 PM, Stefan Berger wrote: libvir-list-boun...@redhat.com wrote on 08/18/2010 07:45:05 PM: libvir-list-boun...@redhat.com * src/nwfilter/nwfilter_driver.c (nwfilterLog): Delete. (nwfilterDriverStartup): Use virReportOOMError instead. ACK. Thanks; pushed. -- Eric

Re: [libvirt] [PATCH 1/7] Change calling conventions in remote driver client internals

2010-08-19 Thread Eric Blake
On 08/17/2010 11:02 AM, Daniel P. Berrange wrote: The remoteIO() method has wierd calling conventions, where it is passed a pre-allocated 'struct remote_call *' but then free()s it itself, instead of letting the caller free(). This fixes those wierd semantics s/wierd/weird/g *

Re: [libvirt] [PATCH 2/7] Support callbacks on virStream APIs in remote driver client

2010-08-19 Thread Eric Blake
On 08/17/2010 11:02 AM, Daniel P. Berrange wrote: The current remote driver code for streams only supports blocking I/O mode. This is fine for the usage with migration but is a problem for more general use cases, in particular bi-directional streams. This adds supported for the stream

Re: [libvirt] [PATCH 3/7] Introduce a virDomainOpenConsole API

2010-08-19 Thread Eric Blake
On 08/17/2010 11:02 AM, Daniel P. Berrange wrote: To enable virsh console (or equivalent) to be used remotely it is neccessary to provide remote access to the /dev/pts/XXX s/neccessary/necessary psuedo-TTY associated with the console/serial/parallel device s/psuedo/pseudo/ in the guest.

Re: [libvirt] [PATCH 4/7] Remote driver client and server for virDomainOpenConsole

2010-08-19 Thread Eric Blake
On 08/17/2010 11:02 AM, Daniel P. Berrange wrote: This provides an implementation of the virDomainOpenConsole API for the remote driver client and server. * daemon/remote.c: Server side impl * src/remote/remote_driver.c: Client impl * src/remote/remote_protocol.x: Wire definition ---

Re: [libvirt] [PATCH 5/7] Support virDomainOpenConsole with QEMU

2010-08-19 Thread Eric Blake
On 08/17/2010 11:02 AM, Daniel P. Berrange wrote: This provides an implementation of the virDomainOpenConsole API with the QEMU driver. For the streams code, this reuses most of the code previously added for the tunnelled migration streams since it is generic. * src/qemu/qemu_driver.c:

Re: [libvirt] [PATCH 01/10] uml: fix logic bug in checking reply length

2010-08-19 Thread Matthias Bolte
2010/8/19 Eric Blake ebl...@redhat.com: * src/uml/uml_driver.c (umlMonitorCommand): Validate that enough bytes were read to dereference both res.length, and that many bytes from res.data. Reported by Soren Hansen. --- Whoops; this is a resend of an unrelated issue, but it is still sitting

Re: [libvirt] [PATCH 03/10] build: delete dead comment

2010-08-19 Thread Matthias Bolte
2010/8/19 Eric Blake ebl...@redhat.com: * src/qemu/qemu_driver.c (qemudGetProcessInfo): Clean up. ---  src/qemu/qemu_driver.c |    1 -  1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3d61ccd..656a1e4 100644 ---

Re: [libvirt] [PATCH 6/7] Re-write virsh console to use streams

2010-08-19 Thread Eric Blake
On 08/17/2010 11:02 AM, Daniel P. Berrange wrote: This re-writes the 'virsh console' command so that it uses the new streams API. This lets it run remotely and/or as a non-root user. This requires that virsh be linked against the simple event loop from libvirtd in daemon/event.c As an added

Re: [libvirt] [PATCH 05/10] storage: avoid s[n]printf

2010-08-19 Thread Matthias Bolte
2010/8/19 Eric Blake ebl...@redhat.com: * src/storage/storage_backend.c (virStorageBackendCreateQemuImg) (virStorageBackendCreateQcowCreate): Use virAsprintf instead. * src/storage/storage_backend_disk.c (virStorageBackendDiskCreateVol, virStorageBackendDiskPartFormat): Likewise. ---

Re: [libvirt] [PATCH 06/10] squash to dead comment

2010-08-19 Thread Matthias Bolte
2010/8/19 Eric Blake ebl...@redhat.com: * src/uml/uml_driver.c (umlGetProcessInfo): Likewise. * src/xen/sexpr.c (_string2sexpr): Likewise. --- Oops - I hit 'git send-email' before rebasing one last time. This one will be squashed into 3/10 before I push anything.  src/uml/uml_driver.c |    

Re: [libvirt] [PATCH 07/10] xenapi: avoid sprintf

2010-08-19 Thread Matthias Bolte
2010/8/19 Eric Blake ebl...@redhat.com: * src/xenapi/xenapi_utils.h (createVifNetwork): Delete prototype. * src/xenapi/xenapi_utils.c (createVifNetwork): Change signature, and use virAsprintf.  Detect allocation failure. (createVMRecordFromXml): Adjust caller. --- I couldn't find any other

Re: [libvirt] [PATCH 7/7] Fix busy-wait loop on closed file descriptor

2010-08-19 Thread Eric Blake
On 08/17/2010 11:02 AM, Daniel P. Berrange wrote: When closing open streams after a client quits, the event callback was not removed. This mean that poll() was using a closed FD and returning POLLNVAL in a busy-wait loop. * daemon/stream.c: Disconnect stream callbacks --- daemon/stream.c

Re: [libvirt] [PATCH 08/10] vbox: add location used in rpmfusion release

2010-08-19 Thread Matthias Bolte
2010/8/19 Eric Blake ebl...@redhat.com: * configure.ac (vbox_xpcomc_dir): Add another potential dir. --- To test that my vbox changes would still compile, I had to install vbox.  But VirtualBox-OSE-3.2.6-2.fc13.x86_64 from rpmfusion-free installs to a new location.  configure.ac |    1 +  

Re: [libvirt] [PATCH 09/10] vbox: factor a large function

2010-08-19 Thread Matthias Bolte
2010/8/19 Eric Blake ebl...@redhat.com: * src/vbox/vbox_tmpl.c (vboxDomainCreateWithFlags): Split... (vboxStartMachine): ...into new helper. --- This function was just too unbearable with that much nested indentation. This should be a no-op refactoring. Looks fine and I can still start a

Re: [libvirt] [PATCH] Add support for Vendor and Model in Storage Pool XML

2010-08-19 Thread Eric Blake
On 08/17/2010 11:44 AM, Patrick Dignan wrote: +if (src-product != NULL) { +virBufferVSprintf(buf,product name='%s'/\n, src-product); +} + virBufferAddLit(buf,/source\n); The only change is that these should use virBufferEscapeString since vendor/product strings might

Re: [libvirt] [PATCH 10/10] vbox: avoid sprintf

2010-08-19 Thread Matthias Bolte
2010/8/19 Eric Blake ebl...@redhat.com: Work in progress: This gets 2 of the 5 suspect uses; I ran out of time today. * src/vbox/vbox_tmpl.c (vboxStartMachine): Use virAsprintf instead. --- I could check this in as is (after tweaking the commit comment) and do the other three sprintf uses

Re: [libvirt] [PATCH 04/10] maint: whitespace cleanups

2010-08-19 Thread Eric Blake
On 08/19/2010 02:59 PM, Matthias Bolte wrote: 2010/8/19 Eric Blake ebl...@redhat.com: * src/storage/storage_backend_disk.c (virStorageBackendDiskPartFormat): Fix spacing. --- Should be cosmetic only. src/storage/storage_backend_disk.c | 66 +++- 1

Re: [libvirt] [PATCH 05/10] storage: avoid s[n]printf

2010-08-19 Thread Eric Blake
On 08/19/2010 03:10 PM, Matthias Bolte wrote: 2010/8/19 Eric Blake ebl...@redhat.com: * src/storage/storage_backend.c (virStorageBackendCreateQemuImg) (virStorageBackendCreateQcowCreate): Use virAsprintf instead. * src/storage/storage_backend_disk.c (virStorageBackendDiskCreateVol,

Re: [libvirt] [PATCH 07/10] xenapi: avoid sprintf

2010-08-19 Thread Eric Blake
On 08/19/2010 03:14 PM, Matthias Bolte wrote: 2010/8/19 Eric Blake ebl...@redhat.com: * src/xenapi/xenapi_utils.h (createVifNetwork): Delete prototype. * src/xenapi/xenapi_utils.c (createVifNetwork): Change signature, and use virAsprintf. Detect allocation failure. (createVMRecordFromXml):

Re: [libvirt] [PATCH 08/10] vbox: add location used in rpmfusion release

2010-08-19 Thread Eric Blake
On 08/19/2010 03:17 PM, Matthias Bolte wrote: 2010/8/19 Eric Blake ebl...@redhat.com: * configure.ac (vbox_xpcomc_dir): Add another potential dir. --- To test that my vbox changes would still compile, I had to install vbox. But VirtualBox-OSE-3.2.6-2.fc13.x86_64 from rpmfusion-free

Re: [libvirt] [PATCH 09/10] vbox: factor a large function

2010-08-19 Thread Eric Blake
On 08/19/2010 03:44 PM, Matthias Bolte wrote: 2010/8/19 Eric Blake ebl...@redhat.com: * src/vbox/vbox_tmpl.c (vboxDomainCreateWithFlags): Split... (vboxStartMachine): ...into new helper. --- This function was just too unbearable with that much nested indentation. This should be a no-op

Re: [libvirt] [PATCH 10/10] vbox: avoid sprintf

2010-08-19 Thread Eric Blake
On 08/19/2010 04:14 PM, Matthias Bolte wrote: if (guiPresent) { if (guiDisplay) { -sprintf(displayutf8, DISPLAY=%.24s, guiDisplay); -VBOX_UTF8_TO_UTF16(displayutf8, env); +char *displayutf8; +if (virAsprintf(displayutf8, DISPLAY=%s,