Re: [libvirt] virsh migrate with libvirt-0.6.2: failed to start listening VM
David Wilcox wrote: On the other machine, the log file that gets created under /var/log/libvirt/qemo/windowsxp.log LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc -m 512 -smp 1 -name windowsxp -uuid 24d2fd62-ed4f-a321-e264-200b347cfa6c -monitor pty -pidfile /var/run/libvirt/qemu//windowsxp.pid -localtime -no-acpi -boot c -drive file=/var/lib/libvirt/images/windowsxp.img,if=ide,index=0,boot=on -drive file=/aml/iso/windows_xp_sp3.iso,if=ide,media=cdrom,index=2 -net nic,macaddr=54:52:00:01:f1:06,vlan=0 -net tap,fd=19,vlan=0 -serial pty -parallel none -usb -usbdevice tablet -vnc 127.0.0.1:0 http://127.0.0.1:0 -soundhw es1370 -incoming tcp:0.0.0.0:49159 http://0.0.0.0:49159 qemu: could not open disk image /var/lib/libvirt/images/windowsxp.img I would think that the virtual machine should copy from the one machine to the other. Isn't libvirt supposed to copy the image file? No. The underlying storage needs to be shared at exactly the same location. That is, if on the source machine your file is located at /var/lib/libvirt/images/windowsxp.img, then you need to nfs share /var/lib/libvirt/images, and mount it on the destination machine as /var/lib/libvirt/images. Then the file windowsxp.img will be available on both sides, and the migration should work. What's even stranger, I've been trying this for awhile. It's failed every time, except once when it succeded. I don't know what made it succeed in that case and fail in all the other cases. That makes no sense, unless you have been moving the location of your NFS mount around. It can't work without the storage being in the same place on the source and the destination. Note that patches have been recently posted to qemu upstream that *does* do a copy of the entire storage along with the memory. If and when those are applied to qemu, it's something we could think about enabling in libvirt. Note, however, that this will quite a long time to migrate, since you have to copy the entire disk image as well as all of the memory. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 00/11] Generic data stream handling
Daniel P. Berrange wrote: 1) Immediately after starting the stream, I get a virStreamRecv() callback on the destination side. The problem is that this is wrong for migration; there's no data that I can read *from* the destination qemu process which makes any sense. While I could implement the method and just throw away the data, that doesn't seem right to me. This leads to... I realize this is due to the remoteAddClientStream() method in qemud/stream.c. It unconditionally sets 'stream-tx' to 1. I didn't notice the problem myself, since the test driver is using pipes which are unidirectional, but yor UNIX domain socket is bi-directional. We could either add a flag to remoteAddClientStream() to indicate whether the stream should allow read or write or both. Or you might be able to call shutdown(sockfd, SHUT_RD) on your UNIX socket to indicate that its only going to be used for write effectively making it unidirectional. I tried the shutdown(sockfd, SHUT_RD) method, without success. Then I commented out the stream-tx = 1 line as a test, and the migration (mostly) worked. At least, it transferred the data to the other side, at which point trying to virsh console on the destination side caused a libvirtd segfault again. So your idea is correct, although I think we still have a problem with the cleanup of the stream. I'm still debugging that. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] Re: Fix Xen virConnectPtr leak
Matthias Bolte wrote: The fix for this problem is simple: remove the virConnectRef/virUnrefConnect calls from the Xen subdrivers (see attached patch). Maybe someone could explain why the Xen Inotify and Xen Store driver do this extra ref-counting, but none of the other Xen subdrivers. It seems unnecessary to me and can be removed without problems. It seems like a perfectly reasonable fix to me. I would like to get a comment from Dan Berrange about it, just to be sure. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Some problem with the save function
Charles Duffy wrote: Chris Lalancette wrote: No, you are right. This was part of the refactoring, and I just didn't re-read the code. I would prefer to move prog to the top of the block myself, and add args there; it just seems tidier. I agree that it's tidier -- but looking at things in context, I'm not very comfortable putting the declarations at the very top of the function. Part of the reason is that everything else there is initialized, even if only to NULL; I hate to break such a convention, but at the same time, I find it dangerous to suppress any warnings the compiler might otherwise be able to generate should a codepath allow a variable be used uninitialized. Does the below (creating a new code block and declaring both variables there) work for everyone? ACK -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Fix Xen virConnectPtr leak
On Sat, Sep 19, 2009 at 11:50:21AM +0200, Matthias Bolte wrote: The commit cb51aa48a777ddae6997faa9f28350cb62655ffd Fix up connection reference counting. changed the driver closing and virConnectPtr unref-logic in virConnectClose(). Before this commit virConnectClose() closed all drivers of the given virConnectPtr and virUnrefConnect()'ed it afterwards. After this commit the driver-closing is done in virUnrefConnect() if and only if the ref-count of the virConnectPtr dropped to zero. [snip] The fix for this problem is simple: remove the virConnectRef/virUnrefConnect calls from the Xen subdrivers (see attached patch). Maybe someone could explain why the Xen Inotify and Xen Store driver do this extra ref-counting, but none of the other Xen subdrivers. It seems unnecessary to me and can be removed without problems. Yes, this ref counting stuff in Xen internal drivers is totally bogus and can be safely removed. ACk to your patch Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/2] Fix net/disk hot-unplug segfault
On Thu, Sep 17, 2009 at 04:02:10PM +0100, Mark McLoughlin wrote: When we hot-unplug the last device, we're currently double-freeing the device definition. Reported by Michal Nowak here: https://bugzilla.redhat.com/523953 * src/qemu_driver.c: fix double free --- src/qemu_driver.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu_driver.c b/src/qemu_driver.c index a65334f..de31581 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -5998,7 +5998,7 @@ try_command: /* ignore, harmless */ } } else { -VIR_FREE(vm-def-disks[0]); +VIR_FREE(vm-def-disks); vm-def-ndisks = 0; } virDomainDiskDefFree(detach); @@ -6100,7 +6100,7 @@ qemudDomainDetachNetDevice(virConnectPtr conn, /* ignore, harmless */ } } else { -VIR_FREE(vm-def-nets[0]); +VIR_FREE(vm-def-nets); vm-def-nnets = 0; } virDomainNetDefFree(detach); ACk Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] Fix leak in PCI hostdev hot-unplug
On Thu, Sep 17, 2009 at 04:03:00PM +0100, Mark McLoughlin wrote: * src/qemu_driver.c: sync the hostdev hot-unplug code with the disk/net code. --- src/qemu_driver.c | 20 +--- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/qemu_driver.c b/src/qemu_driver.c index de31581..2ddcdc0 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -6206,14 +6206,20 @@ static int qemudDomainDetachHostPciDevice(virConnectPtr conn, pciFreeDevice(conn, pci); } -if (i != --vm-def-nhostdevs) -memmove(vm-def-hostdevs[i], -vm-def-hostdevs[i+1], -sizeof(*vm-def-hostdevs) * (vm-def-nhostdevs-i)); -if (VIR_REALLOC_N(vm-def-hostdevs, vm-def-nhostdevs) 0) { -virReportOOMError(conn); -ret = -1; +if (vm-def-nhostdevs 1) { +memmove(vm-def-hostdevs + i, +vm-def-hostdevs + i + 1, +sizeof(*vm-def-hostdevs) * +(vm-def-nhostdevs - (i + 1))); +vm-def-nhostdevs--; +if (VIR_REALLOC_N(vm-def-hostdevs, vm-def-nhostdevs) 0) { +/* ignore, harmless */ +} +} else { +VIR_FREE(vm-def-hostdevs); +vm-def-nhostdevs = 0; } +virDomainHostdevDefFree(detach); return ret; } -- ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] qemu_driver migrateuri handling broken?
On Wed, Sep 16, 2009 at 05:42:50PM +0200, Gregor Schaffrath wrote: Hi all. Short summary on DV's request ;) I ran into a problem migrating kvm machines with libvirt-0.6.5: 1) At first, using the same syntax for the migrateuri as with xen (just the IP) did not work... looking into the source code (! ;) ), I found a different syntax for qemu. The URI schemes should be listed in the driver capabilities XML. The reason they are different is that they are two different ways of doing migration. We are working on a new tunnelled migration scheme that will be uniform across drivers. 2) using tcp://ip:port just produced an 'unknown failure' on the receiving side: r...@loadgen137:~ virsh -c qemu:///system migrate --live kvm-testnode-vnode3 qemu+tcp://10.192.11.136/system?no_verify=1 tcp://10.192.11.136:12345 error: Unknown failure (Note: it was working like a charm when I eliminated the migrateuri altogether, Hmm, try tcp:10.192.11.136:12345 instead - for some unknown reason it is not using correct URI formats. 3) removing the case distinction and the handling of the migrateuri in the qemudDomainMigratePrepare2 function in qemu_driver.c entirely (if-statement, and full else-part) solved both my issues. I don't know what exactly you removed, by you'll almost certainly have broken something else. daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] lxc: suspend/resume support
On Thu, Sep 17, 2009 at 12:42:08AM +0900, Ryota Ozaki wrote: +static int lxcDomainSuspend(virDomainPtr dom) +{ +lxc_driver_t *driver = dom-conn-privateData; +virDomainObjPtr vm; +virDomainEventPtr event = NULL; +int ret = -1; + +lxcDriverLock(driver); +vm = virDomainFindByUUID(driver-domains, dom-uuid); + +if (!vm) { +char uuidstr[VIR_UUID_STRING_BUFLEN]; +virUUIDFormat(dom-uuid, uuidstr); +lxcError(dom-conn, dom, VIR_ERR_NO_DOMAIN, + _(no domain with matching uuid '%s'), uuidstr); +goto cleanup; +} + +if (!virDomainIsActive(vm)) { +lxcError(dom-conn, dom, VIR_ERR_OPERATION_INVALID, + %s, _(domain is not running)); +goto cleanup; +} + +if (vm-state != VIR_DOMAIN_PAUSED) { +if (lxcFreezeContainer(driver, vm) 0) { +lxcError(dom-conn, dom, VIR_ERR_OPERATION_FAILED, + %s, _(suspend operation failed)); +goto cleanup; +} +vm-state = VIR_DOMAIN_PAUSED; +} + +if (virDomainSaveStatus(dom-conn, driver-stateDir, vm) 0) +goto cleanup; +ret = 0; + +event = virDomainEventNewFromObj(vm, + VIR_DOMAIN_EVENT_SUSPENDED, + VIR_DOMAIN_EVENT_SUSPENDED_PAUSED); The virDomainSaveStatus/virDomainEventNewFromObj calls need to be moved up inside the if (vm-state != VIR_DOMAIN_PAUSED) { conditional, since you don't want to dispatch an event if its already paused. +static int lxcDomainResume(virDomainPtr dom) +{ +lxc_driver_t *driver = dom-conn-privateData; +virDomainObjPtr vm; +virDomainEventPtr event = NULL; +int ret = -1; + +lxcDriverLock(driver); +vm = virDomainFindByUUID(driver-domains, dom-uuid); + +if (!vm) { +char uuidstr[VIR_UUID_STRING_BUFLEN]; +virUUIDFormat(dom-uuid, uuidstr); +lxcError(dom-conn, dom, VIR_ERR_NO_DOMAIN, + _(no domain with matching uuid '%s'), uuidstr); +goto cleanup; +} + +if (!virDomainIsActive(vm)) { +lxcError(dom-conn, dom, VIR_ERR_OPERATION_INVALID, + %s, _(domain is not running)); +goto cleanup; +} + +if (vm-state == VIR_DOMAIN_PAUSED) { +if (lxcUnfreezeContainer(driver, vm) 0) { +lxcError(dom-conn, dom, VIR_ERR_OPERATION_FAILED, + %s, _(resume operation failed)); +goto cleanup; +} +vm-state = VIR_DOMAIN_RUNNING; +} + +if (virDomainSaveStatus(dom-conn, driver-stateDir, vm) 0) +goto cleanup; +ret = 0; + +event = virDomainEventNewFromObj(vm, + VIR_DOMAIN_EVENT_RESUMED, + VIR_DOMAIN_EVENT_RESUMED_UNPAUSED); Same as above - the virDomainSaveStatus/virDomainEventNewFromObj cals need to be moved inside the if (vm-state == VIR_DOMAIN_PAUSED) conditional Aside from that, this patch looks good. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] ESX [01/12]: Add esxNodeGetFreeMemory()
On Mon, Sep 14, 2009 at 02:40:13AM +0200, Matthias Bolte wrote: * src/esx/esx_driver.c: add esxNodeGetFreeMemory(), cache IP address * src/esx/esx_vi.[ch]: refactor resource pool query into esxVI_GetResourcePool() * src/esx/esx_vi_types.[ch]: bind VI type ResourcePoolResourceUsage ACK, to all 12 patches in this series. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Remove an unnecessary variable from remoteIOReadMessage().
Signed-off-by: Chris Lalancette clala...@redhat.com --- src/remote_internal.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/remote_internal.c b/src/remote_internal.c index dd7b31e..b89d45d 100644 --- a/src/remote_internal.c +++ b/src/remote_internal.c @@ -6942,10 +6942,9 @@ remoteIOReadMessage(virConnectPtr conn, struct private_data *priv, if (priv-saslconn) { if (priv-saslDecoded == NULL) { char encoded[8192]; -unsigned int encodedLen = sizeof(encoded); int ret, err; ret = remoteIOReadBuffer(conn, priv, in_open, - encoded, encodedLen); + encoded, sizeof(encoded)); if (ret 0) return -1; if (ret == 0) -- 1.6.0.6 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Fix up 'neccessary - necessary' in a comment.
Signed-off-by: Chris Lalancette clala...@redhat.com --- src/virterror.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/virterror.c b/src/virterror.c index 77b295c..e421ab7 100644 --- a/src/virterror.c +++ b/src/virterror.c @@ -641,7 +641,7 @@ virRaiseErrorFull(virConnectPtr conn, /* * All errors are recorded in thread local storage * For compatability, public API calls will copy them - * to the per-connection error object when neccessary + * to the per-connection error object when necessary */ to = virLastErrorObject(); if (!to) -- 1.6.0.6 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Don't do virSetConnError when virDrvSupportsFeature is successful.
Signed-off-by: Chris Lalancette clala...@redhat.com --- src/libvirt.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 4a11688..fa59dc7 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -1349,8 +1349,11 @@ virDrvSupportsFeature (virConnectPtr conn, int feature) } ret = VIR_DRV_SUPPORTS_FEATURE (conn-driver, conn, feature); -/* Copy to connection error object for back compatability */ -virSetConnError(conn); + +if (ret 0) +/* Copy to connection error object for back compatability */ +virSetConnError(conn); + return ret; } -- 1.6.0.6 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Fix a double-free in qemudRunLoop()
Signed-off-by: Chris Lalancette clala...@redhat.com --- qemud/qemud.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/qemud/qemud.c b/qemud/qemud.c index 00b9859..087f5da 100644 --- a/qemud/qemud.c +++ b/qemud/qemud.c @@ -2270,7 +2270,6 @@ cleanup: } VIR_FREE(server-workers); -free(server-workers); virMutexUnlock(server-lock); return ret; } -- 1.6.0.6 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Fix up comments for domainXML{To,From}Native.
Signed-off-by: Chris Lalancette clala...@redhat.com --- src/esx/esx_driver.c |4 ++-- src/lxc_driver.c |4 ++-- src/phyp/phyp_driver.c |4 ++-- src/test.c |4 ++-- src/uml_driver.c |4 ++-- src/vbox/vbox_tmpl.c |4 ++-- src/xen_unified.c |4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 07afc10..8fad457 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -3061,8 +3061,8 @@ static virDriver esxDriver = { NULL,/* domainGetSecurityLabel */ NULL,/* nodeGetSecurityModel */ esxDomainDumpXML,/* domainDumpXML */ -esxDomainXMLFromNative, /* domainXmlFromNative */ -NULL,/* domainXmlToNative */ +esxDomainXMLFromNative, /* domainXMLFromNative */ +NULL,/* domainXMLToNative */ esxListDefinedDomains, /* listDefinedDomains */ esxNumberOfDefinedDomains, /* numOfDefinedDomains */ esxDomainCreate, /* domainCreate */ diff --git a/src/lxc_driver.c b/src/lxc_driver.c index 0ec1e92..eafd8ba 100644 --- a/src/lxc_driver.c +++ b/src/lxc_driver.c @@ -1901,8 +1901,8 @@ static virDriver lxcDriver = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ lxcDomainDumpXML, /* domainDumpXML */ -NULL, /* domainXmlFromNative */ -NULL, /* domainXmlToNative */ +NULL, /* domainXMLFromNative */ +NULL, /* domainXMLToNative */ lxcListDefinedDomains, /* listDefinedDomains */ lxcNumDefinedDomains, /* numOfDefinedDomains */ lxcDomainStart, /* domainCreate */ diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 2f8a314..e2a2caf 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1347,8 +1347,8 @@ virDriver phypDriver = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ phypDomainDumpXML, /* domainDumpXML */ -NULL, /* domainXmlFromNative */ -NULL, /* domainXmlToNative */ +NULL, /* domainXMLFromNative */ +NULL, /* domainXMLToNative */ phypListDefinedDomains, /* listDefinedDomains */ phypNumDefinedDomains, /* numOfDefinedDomains */ NULL, /* domainCreate */ diff --git a/src/test.c b/src/test.c index 368a3cb..5f1ba62 100644 --- a/src/test.c +++ b/src/test.c @@ -4227,8 +4227,8 @@ static virDriver testDriver = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ testDomainDumpXML, /* domainDumpXML */ -NULL, /* domainXmlFromNative */ -NULL, /* domainXmlToNative */ +NULL, /* domainXMLFromNative */ +NULL, /* domainXMLToNative */ testListDefinedDomains, /* listDefinedDomains */ testNumOfDefinedDomains, /* numOfDefinedDomains */ testDomainCreate, /* domainCreate */ diff --git a/src/uml_driver.c b/src/uml_driver.c index a2b9495..d28cc30 100644 --- a/src/uml_driver.c +++ b/src/uml_driver.c @@ -1823,8 +1823,8 @@ static virDriver umlDriver = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ umlDomainDumpXML, /* domainDumpXML */ -NULL, /* domainXmlFromNative */ -NULL, /* domainXmlToNative */ +NULL, /* domainXMLFromNative */ +NULL, /* domainXMLToNative */ umlListDefinedDomains, /* listDefinedDomains */ umlNumDefinedDomains, /* numOfDefinedDomains */ umlDomainStart, /* domainCreate */ diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 7270710..c02b18c 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -6426,8 +6426,8 @@ virDriver NAME(Driver) = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ vboxDomainDumpXML, /* domainDumpXML */ -NULL, /* domainXmlFromNative */ -NULL, /* domainXmlToNative */ +NULL, /* domainXMLFromNative */ +NULL, /* domainXMLToNative */ vboxListDefinedDomains, /* listDefinedDomains */ vboxNumOfDefinedDomains, /* numOfDefinedDomains */ vboxDomainCreate, /* domainCreate */ diff --git a/src/xen_unified.c b/src/xen_unified.c index dfa9ca5..b826198 100644 --- a/src/xen_unified.c +++ b/src/xen_unified.c @@ -1692,8 +1692,8 @@ static virDriver xenUnifiedDriver = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ xenUnifiedDomainDumpXML, /* domainDumpXML */ -xenUnifiedDomainXMLFromNative, /* domainXmlFromNative */ -xenUnifiedDomainXMLToNative, /* domainXmlToNative */ +xenUnifiedDomainXMLFromNative, /* domainXMLFromNative */ +xenUnifiedDomainXMLToNative, /* domainXMLToNative */ xenUnifiedListDefinedDomains, /* listDefinedDomains */ xenUnifiedNumOfDefinedDomains, /* numOfDefinedDomains */
[libvirt] [PATCH] Simple fix of a comment in qemuStringToArgvEnv.
Signed-off-by: Chris Lalancette clala...@redhat.com --- src/qemu_conf.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/qemu_conf.c b/src/qemu_conf.c index f92bcef..273aeca 100644 --- a/src/qemu_conf.c +++ b/src/qemu_conf.c @@ -2363,7 +2363,7 @@ static int qemuStringToArgvEnv(const char *args, curr = next; } -/* Iterate over list of args, finding first arg not containining +/* Iterate over list of args, finding first arg not containing * the '=' character (eg, skip over env vars FOO=bar) */ for (envend = 0 ; ((envend argcount) (strchr(arglist[envend], '=') != NULL)); -- 1.6.0.6 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] add doc for graphic and video elements
Hello The title says it all. Here's some doc explaining the new syntax of the video and graphic elements in the domain XML. It (probably) won't get me any literary awards but, eh, it's a start :) Florian diff --git a/docs/formatdomain.html b/docs/formatdomain.html index a715457..f95f72b 100644 --- a/docs/formatdomain.html +++ b/docs/formatdomain.html @@ -175,6 +175,8 @@ /lili a href=#elementsGraphicsGraphical framebuffers/a /lili +a href=#elementsVideoVideo devices/a + /lili a href=#elementsConsoleConsoles, serial amp; parallel devices/a ulli a href=#elementsCharSTDIODomain logfile/a @@ -758,23 +760,65 @@ qemu-kvm -net nic,model=? /dev/null /p pre ... + lt;graphics type='sdl' display=':0.0'/gt; lt;graphics type='vnc' port='5904'/gt; + lt;graphics type='rdp' autoport='yes' multiUser='yes' /gt; + lt;graphics type='desktop' fullscreen='yes'/gt; .../pre dldtcodegraphics/code/dtddThe codegraphics/code element has a mandatory codetype/code - attribute which takes the value sdl or vnc. The former displays - a window on the host desktop, while the latter activates a VNC server. -The former accepts 3 optional arguments: a codedisplay/code -attribute for the display to use, an codexauth/code attribute for -the authentication identifier, and an optional codefullscreen/code -attribute accepting values 'yes' or 'no'. - If the latter is used the codeport/code attribute specifies the TCP - port number (with -1 as legacy syntax indicating that it should be - auto-allocated). The codeautoport/code attribute is the new - preferred syntax for indicating autoallocation of the TCP port to use. - The codelisten/code attribute is an IP address for the server to - listen on. The codepasswd/code attribute provides a VNC password - in clear text. The codekeymap/code attribute specifies the keymap - to use./dd/dl + attribute which takes the value sdl, vnc, rdp or desktop: +dldtcodesdl/code/dtdd + This displays a window on the host desktop, it can take 3 optional arguments: + a codedisplay/code attribute for the display to use, an codexauth/code + attribute for the authentication identifier, and an optional codefullscreen/code + attribute accepting values 'yes' or 'no'. + /dddtcodevnc/code/dtdd + Starts a VNC server. The codeport/code attribute specifies the TCP + port number (with -1 as legacy syntax indicating that it should be + auto-allocated). The codeautoport/code attribute is the new + preferred syntax for indicating autoallocation of the TCP port to use. + The codelisten/code attribute is an IP address for the server to + listen on. The codepasswd/code attribute provides a VNC password + in clear text. The codekeymap/code attribute specifies the keymap + to use. + /dddtcoderdp/code/dtdd + Starts a RDP server. The codeport/code attribute + specifies the TCP port number (with -1 as legacy syntax indicating + that it should be auto-allocated). The codeautoport/code attribute + is the new preferred syntax for indicating autoallocation of the TCP + port to use. The codereplaceUser/code attribute is a boolean deciding + whether multiple simultaneous connections to the VM are permitted. + The codemultiUser/code whether the existing connection must be dropped + and a new connection must be established by the VRDP server, when a new + client connects in single connection mode. + + /dddtcodedesktop/code/dtdd + This value is reserved for VirtualBox domains for the moment. It displays + a window on the host desktop, similarly to sdl, but using the VirtualBox + viewer. Just like sdl, it accepts the optional attributes codedisplay/code + and codefullscreen/code. + /dd/dl/dd/dl +h4 + a name=elementsVideo id=elementsVideoVideo devices/a +/h4 +p + A video device. +/p +pre + ... + lt;video type='vga' nvram='8192' heads='1'gt; +lt;acceleration accel3d='yes' accel3d='yes' /gt; + lt;/videogt; + ... +/pre +dldtcodevideo/code/dtddThe codevideo/code element has a mandatory codetype/code + attribute which takes the value vga, cirrus, vmvga, xen or vbox. + You can also provide the amount of video memory using codenvram/code, + the number of screen with codeheads/code, and whether acceleration + should be enabled (if supported) using the codeaccel3d/code and + codeaccel2d/code attributes in the codeacceleration/code element. + +/dd/dl h4 a name=elementsConsole id=elementsConsoleConsoles, serial amp; parallel devices/a /h4 diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 915814d..ec4a6e4 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -687,28 +687,83 @@
Re: [libvirt] [PATCH] Fix up 'neccessary - necessary' in a comment.
On Mon, Sep 21, 2009 at 02:53:25PM +0200, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- src/virterror.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/virterror.c b/src/virterror.c index 77b295c..e421ab7 100644 --- a/src/virterror.c +++ b/src/virterror.c @@ -641,7 +641,7 @@ virRaiseErrorFull(virConnectPtr conn, /* * All errors are recorded in thread local storage * For compatability, public API calls will copy them - * to the per-connection error object when neccessary + * to the per-connection error object when necessary */ to = virLastErrorObject(); if (!to) ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Don't do virSetConnError when virDrvSupportsFeature is successful.
On Mon, Sep 21, 2009 at 02:53:31PM +0200, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- src/libvirt.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 4a11688..fa59dc7 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -1349,8 +1349,11 @@ virDrvSupportsFeature (virConnectPtr conn, int feature) } ret = VIR_DRV_SUPPORTS_FEATURE (conn-driver, conn, feature); -/* Copy to connection error object for back compatability */ -virSetConnError(conn); + +if (ret 0) +/* Copy to connection error object for back compatability */ +virSetConnError(conn); + return ret; } -- ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Fix a double-free in qemudRunLoop()
On Mon, Sep 21, 2009 at 02:53:37PM +0200, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- qemud/qemud.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/qemud/qemud.c b/qemud/qemud.c index 00b9859..087f5da 100644 --- a/qemud/qemud.c +++ b/qemud/qemud.c @@ -2270,7 +2270,6 @@ cleanup: } VIR_FREE(server-workers); -free(server-workers); virMutexUnlock(server-lock); return ret; } ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Fix up comments for domainXML{To,From}Native.
On Mon, Sep 21, 2009 at 02:53:43PM +0200, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- src/esx/esx_driver.c |4 ++-- src/lxc_driver.c |4 ++-- src/phyp/phyp_driver.c |4 ++-- src/test.c |4 ++-- src/uml_driver.c |4 ++-- src/vbox/vbox_tmpl.c |4 ++-- src/xen_unified.c |4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 07afc10..8fad457 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -3061,8 +3061,8 @@ static virDriver esxDriver = { NULL,/* domainGetSecurityLabel */ NULL,/* nodeGetSecurityModel */ esxDomainDumpXML,/* domainDumpXML */ -esxDomainXMLFromNative, /* domainXmlFromNative */ -NULL,/* domainXmlToNative */ +esxDomainXMLFromNative, /* domainXMLFromNative */ +NULL,/* domainXMLToNative */ esxListDefinedDomains, /* listDefinedDomains */ esxNumberOfDefinedDomains, /* numOfDefinedDomains */ esxDomainCreate, /* domainCreate */ diff --git a/src/lxc_driver.c b/src/lxc_driver.c index 0ec1e92..eafd8ba 100644 --- a/src/lxc_driver.c +++ b/src/lxc_driver.c @@ -1901,8 +1901,8 @@ static virDriver lxcDriver = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ lxcDomainDumpXML, /* domainDumpXML */ -NULL, /* domainXmlFromNative */ -NULL, /* domainXmlToNative */ +NULL, /* domainXMLFromNative */ +NULL, /* domainXMLToNative */ lxcListDefinedDomains, /* listDefinedDomains */ lxcNumDefinedDomains, /* numOfDefinedDomains */ lxcDomainStart, /* domainCreate */ diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 2f8a314..e2a2caf 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1347,8 +1347,8 @@ virDriver phypDriver = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ phypDomainDumpXML, /* domainDumpXML */ -NULL, /* domainXmlFromNative */ -NULL, /* domainXmlToNative */ +NULL, /* domainXMLFromNative */ +NULL, /* domainXMLToNative */ phypListDefinedDomains, /* listDefinedDomains */ phypNumDefinedDomains, /* numOfDefinedDomains */ NULL, /* domainCreate */ diff --git a/src/test.c b/src/test.c index 368a3cb..5f1ba62 100644 --- a/src/test.c +++ b/src/test.c @@ -4227,8 +4227,8 @@ static virDriver testDriver = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ testDomainDumpXML, /* domainDumpXML */ -NULL, /* domainXmlFromNative */ -NULL, /* domainXmlToNative */ +NULL, /* domainXMLFromNative */ +NULL, /* domainXMLToNative */ testListDefinedDomains, /* listDefinedDomains */ testNumOfDefinedDomains, /* numOfDefinedDomains */ testDomainCreate, /* domainCreate */ diff --git a/src/uml_driver.c b/src/uml_driver.c index a2b9495..d28cc30 100644 --- a/src/uml_driver.c +++ b/src/uml_driver.c @@ -1823,8 +1823,8 @@ static virDriver umlDriver = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ umlDomainDumpXML, /* domainDumpXML */ -NULL, /* domainXmlFromNative */ -NULL, /* domainXmlToNative */ +NULL, /* domainXMLFromNative */ +NULL, /* domainXMLToNative */ umlListDefinedDomains, /* listDefinedDomains */ umlNumDefinedDomains, /* numOfDefinedDomains */ umlDomainStart, /* domainCreate */ diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 7270710..c02b18c 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -6426,8 +6426,8 @@ virDriver NAME(Driver) = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ vboxDomainDumpXML, /* domainDumpXML */ -NULL, /* domainXmlFromNative */ -NULL, /* domainXmlToNative */ +NULL, /* domainXMLFromNative */ +NULL, /* domainXMLToNative */ vboxListDefinedDomains, /* listDefinedDomains */ vboxNumOfDefinedDomains, /* numOfDefinedDomains */ vboxDomainCreate, /* domainCreate */ diff --git a/src/xen_unified.c b/src/xen_unified.c index dfa9ca5..b826198 100644 --- a/src/xen_unified.c +++ b/src/xen_unified.c @@ -1692,8 +1692,8 @@ static virDriver xenUnifiedDriver = { NULL, /* domainGetSecurityLabel */ NULL, /* nodeGetSecurityModel */ xenUnifiedDomainDumpXML, /* domainDumpXML */ -xenUnifiedDomainXMLFromNative, /* domainXmlFromNative */ -xenUnifiedDomainXMLToNative, /* domainXmlToNative */ +xenUnifiedDomainXMLFromNative, /* domainXMLFromNative */ +
Re: [libvirt] [PATCH] Simple fix of a comment in qemuStringToArgvEnv.
On Mon, Sep 21, 2009 at 02:53:49PM +0200, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- src/qemu_conf.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/qemu_conf.c b/src/qemu_conf.c index f92bcef..273aeca 100644 --- a/src/qemu_conf.c +++ b/src/qemu_conf.c @@ -2363,7 +2363,7 @@ static int qemuStringToArgvEnv(const char *args, curr = next; } -/* Iterate over list of args, finding first arg not containining +/* Iterate over list of args, finding first arg not containing * the '=' character (eg, skip over env vars FOO=bar) */ for (envend = 0 ; ((envend argcount) (strchr(arglist[envend], '=') != NULL)); -- ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] add doc for graphic and video elements
On Mon, Sep 21, 2009 at 03:31:44PM +0200, Florian Vichot wrote: Hello The title says it all. Here's some doc explaining the new syntax of the video and graphic elements in the domain XML. It (probably) won't get me any literary awards but, eh, it's a start :) Florian diff --git a/docs/formatdomain.html b/docs/formatdomain.html index a715457..f95f72b 100644 --- a/docs/formatdomain.html +++ b/docs/formatdomain.html @@ -175,6 +175,8 @@ /lili a href=#elementsGraphicsGraphical framebuffers/a /lili +a href=#elementsVideoVideo devices/a + /lili a href=#elementsConsoleConsoles, serial amp; parallel devices/a ulli a href=#elementsCharSTDIODomain logfile/a @@ -758,23 +760,65 @@ qemu-kvm -net nic,model=? /dev/null /p pre ... + lt;graphics type='sdl' display=':0.0'/gt; lt;graphics type='vnc' port='5904'/gt; + lt;graphics type='rdp' autoport='yes' multiUser='yes' /gt; + lt;graphics type='desktop' fullscreen='yes'/gt; .../pre dldtcodegraphics/code/dtddThe codegraphics/code element has a mandatory codetype/code - attribute which takes the value sdl or vnc. The former displays - a window on the host desktop, while the latter activates a VNC server. -The former accepts 3 optional arguments: a codedisplay/code -attribute for the display to use, an codexauth/code attribute for -the authentication identifier, and an optional codefullscreen/code -attribute accepting values 'yes' or 'no'. - If the latter is used the codeport/code attribute specifies the TCP - port number (with -1 as legacy syntax indicating that it should be - auto-allocated). The codeautoport/code attribute is the new - preferred syntax for indicating autoallocation of the TCP port to use. - The codelisten/code attribute is an IP address for the server to - listen on. The codepasswd/code attribute provides a VNC password - in clear text. The codekeymap/code attribute specifies the keymap - to use./dd/dl + attribute which takes the value sdl, vnc, rdp or desktop: +dldtcodesdl/code/dtdd + This displays a window on the host desktop, it can take 3 optional arguments: + a codedisplay/code attribute for the display to use, an codexauth/code + attribute for the authentication identifier, and an optional codefullscreen/code + attribute accepting values 'yes' or 'no'. + /dddtcodevnc/code/dtdd + Starts a VNC server. The codeport/code attribute specifies the TCP + port number (with -1 as legacy syntax indicating that it should be + auto-allocated). The codeautoport/code attribute is the new + preferred syntax for indicating autoallocation of the TCP port to use. + The codelisten/code attribute is an IP address for the server to + listen on. The codepasswd/code attribute provides a VNC password + in clear text. The codekeymap/code attribute specifies the keymap + to use. + /dddtcoderdp/code/dtdd + Starts a RDP server. The codeport/code attribute + specifies the TCP port number (with -1 as legacy syntax indicating + that it should be auto-allocated). The codeautoport/code attribute + is the new preferred syntax for indicating autoallocation of the TCP + port to use. The codereplaceUser/code attribute is a boolean deciding + whether multiple simultaneous connections to the VM are permitted. + The codemultiUser/code whether the existing connection must be dropped + and a new connection must be established by the VRDP server, when a new + client connects in single connection mode. + + /dddtcodedesktop/code/dtdd + This value is reserved for VirtualBox domains for the moment. It displays + a window on the host desktop, similarly to sdl, but using the VirtualBox + viewer. Just like sdl, it accepts the optional attributes codedisplay/code + and codefullscreen/code. + /dd/dl/dd/dl +h4 + a name=elementsVideo id=elementsVideoVideo devices/a +/h4 +p + A video device. +/p +pre + ... + lt;video type='vga' nvram='8192' heads='1'gt; +lt;acceleration accel3d='yes' accel3d='yes' /gt; + lt;/videogt; + ... +/pre +dldtcodevideo/code/dtddThe codevideo/code element has a mandatory codetype/code + attribute which takes the value vga, cirrus, vmvga, xen or vbox. + You can also provide the amount of video memory using codenvram/code, + the number of screen with codeheads/code, and whether acceleration + should be enabled (if supported) using the codeaccel3d/code and + codeaccel2d/code attributes in the codeacceleration/code element. + +/dd/dl h4 a name=elementsConsole
Re: [libvirt] [PATCH] Remove an unnecessary variable from remoteIOReadMessage().
On Mon, Sep 21, 2009 at 02:53:17PM +0200, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- src/remote_internal.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/remote_internal.c b/src/remote_internal.c index dd7b31e..b89d45d 100644 --- a/src/remote_internal.c +++ b/src/remote_internal.c @@ -6942,10 +6942,9 @@ remoteIOReadMessage(virConnectPtr conn, struct private_data *priv, if (priv-saslconn) { if (priv-saslDecoded == NULL) { char encoded[8192]; -unsigned int encodedLen = sizeof(encoded); int ret, err; ret = remoteIOReadBuffer(conn, priv, in_open, - encoded, encodedLen); + encoded, sizeof(encoded)); if (ret 0) return -1; if (ret == 0) ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Remove an unnecessary variable from remoteIOReadMessage().
Daniel P. Berrange wrote: On Mon, Sep 21, 2009 at 02:53:17PM +0200, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- src/remote_internal.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/remote_internal.c b/src/remote_internal.c index dd7b31e..b89d45d 100644 --- a/src/remote_internal.c +++ b/src/remote_internal.c @@ -6942,10 +6942,9 @@ remoteIOReadMessage(virConnectPtr conn, struct private_data *priv, if (priv-saslconn) { if (priv-saslDecoded == NULL) { char encoded[8192]; -unsigned int encodedLen = sizeof(encoded); int ret, err; ret = remoteIOReadBuffer(conn, priv, in_open, - encoded, encodedLen); + encoded, sizeof(encoded)); if (ret 0) return -1; if (ret == 0) ACK Thanks. I'm ready to push these small fixes, but would it be more convenient for me to wait until after you've pushed the big refactoring? As long as you are going to do that soon-ish, I can wait. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Remove an unnecessary variable from remoteIOReadMessage().
On Mon, Sep 21, 2009 at 03:44:51PM +0200, Chris Lalancette wrote: Daniel P. Berrange wrote: On Mon, Sep 21, 2009 at 02:53:17PM +0200, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- src/remote_internal.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/remote_internal.c b/src/remote_internal.c index dd7b31e..b89d45d 100644 --- a/src/remote_internal.c +++ b/src/remote_internal.c @@ -6942,10 +6942,9 @@ remoteIOReadMessage(virConnectPtr conn, struct private_data *priv, if (priv-saslconn) { if (priv-saslDecoded == NULL) { char encoded[8192]; -unsigned int encodedLen = sizeof(encoded); int ret, err; ret = remoteIOReadBuffer(conn, priv, in_open, - encoded, encodedLen); + encoded, sizeof(encoded)); if (ret 0) return -1; if (ret == 0) ACK Thanks. I'm ready to push these small fixes, but would it be more convenient for me to wait until after you've pushed the big refactoring? As long as you are going to do that soon-ish, I can wait. Yeah, i'm about to push it in next 10-15 minutes. Hopefully git should do its magic stuff for you auto-rebase everything correctly :-) Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH: 0/MANY] Re-arrange files in the source tree
On Wed, Sep 16, 2009 at 07:38:14PM +0100, Daniel P. Berrange wrote: This is a followup to http://www.redhat.com/archives/libvir-list/2009-September/msg00477.html I am not actually going to spam the list with all the patches, since it'd generate a HUGE series of mails. Instead I have published a branch containing all the patches which you can directly pull into your GIT checkout. I recommend you do the following set of steps. - make maintainer-clean - git checkout master - git pull - git remote add -f danb git://gitorious.org/~berrange/libvirt/staging.git - git checkout -b rearrange danb/rearrange You will now have a checkout on a branch called 'rearrange' containing all my patches applied. If you want to go straight into building it, the normal build process still applies eg ./autogen make I've committed the changes in a large series of steps to make it easier to see what's going on at each point. To see the list of changes run the following git log -b berrange/rearrange master.. The changes basically follow everything we discussed in the previous thread This series of patches is now applied. Be sure to do a full clean before trying to build. If you see build errors like make[3]: *** No rule to make target `bridge.c', needed by `libvirt_util_la-bridge.lo'. Stop. This is because you didn't do a full 'make distclean' and thus have stale information in the src/.deps directory. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] lxc: suspend/resume support
On Mon, Sep 21, 2009 at 9:05 PM, Daniel P. Berrange berra...@redhat.com wrote: On Thu, Sep 17, 2009 at 12:42:08AM +0900, Ryota Ozaki wrote: +static int lxcDomainSuspend(virDomainPtr dom) +{ + lxc_driver_t *driver = dom-conn-privateData; + virDomainObjPtr vm; + virDomainEventPtr event = NULL; + int ret = -1; + + lxcDriverLock(driver); + vm = virDomainFindByUUID(driver-domains, dom-uuid); + + if (!vm) { + char uuidstr[VIR_UUID_STRING_BUFLEN]; + virUUIDFormat(dom-uuid, uuidstr); + lxcError(dom-conn, dom, VIR_ERR_NO_DOMAIN, + _(no domain with matching uuid '%s'), uuidstr); + goto cleanup; + } + + if (!virDomainIsActive(vm)) { + lxcError(dom-conn, dom, VIR_ERR_OPERATION_INVALID, + %s, _(domain is not running)); + goto cleanup; + } + + if (vm-state != VIR_DOMAIN_PAUSED) { + if (lxcFreezeContainer(driver, vm) 0) { + lxcError(dom-conn, dom, VIR_ERR_OPERATION_FAILED, + %s, _(suspend operation failed)); + goto cleanup; + } + vm-state = VIR_DOMAIN_PAUSED; + } + + if (virDomainSaveStatus(dom-conn, driver-stateDir, vm) 0) + goto cleanup; + ret = 0; + + event = virDomainEventNewFromObj(vm, + VIR_DOMAIN_EVENT_SUSPENDED, + VIR_DOMAIN_EVENT_SUSPENDED_PAUSED); The virDomainSaveStatus/virDomainEventNewFromObj calls need to be moved up inside the if (vm-state != VIR_DOMAIN_PAUSED) { conditional, since you don't want to dispatch an event if its already paused. Oh, you're right. +static int lxcDomainResume(virDomainPtr dom) +{ + lxc_driver_t *driver = dom-conn-privateData; + virDomainObjPtr vm; + virDomainEventPtr event = NULL; + int ret = -1; + + lxcDriverLock(driver); + vm = virDomainFindByUUID(driver-domains, dom-uuid); + + if (!vm) { + char uuidstr[VIR_UUID_STRING_BUFLEN]; + virUUIDFormat(dom-uuid, uuidstr); + lxcError(dom-conn, dom, VIR_ERR_NO_DOMAIN, + _(no domain with matching uuid '%s'), uuidstr); + goto cleanup; + } + + if (!virDomainIsActive(vm)) { + lxcError(dom-conn, dom, VIR_ERR_OPERATION_INVALID, + %s, _(domain is not running)); + goto cleanup; + } + + if (vm-state == VIR_DOMAIN_PAUSED) { + if (lxcUnfreezeContainer(driver, vm) 0) { + lxcError(dom-conn, dom, VIR_ERR_OPERATION_FAILED, + %s, _(resume operation failed)); + goto cleanup; + } + vm-state = VIR_DOMAIN_RUNNING; + } + + if (virDomainSaveStatus(dom-conn, driver-stateDir, vm) 0) + goto cleanup; + ret = 0; + + event = virDomainEventNewFromObj(vm, + VIR_DOMAIN_EVENT_RESUMED, + VIR_DOMAIN_EVENT_RESUMED_UNPAUSED); Same as above - the virDomainSaveStatus/virDomainEventNewFromObj cals need to be moved inside the if (vm-state == VIR_DOMAIN_PAUSED) conditional OK, fixed the two parts. Thanks for the review! And the fixed patch is here! ozaki-r PS: git rebase works well ;-) From abe363de43f5053a01593de6e634f654525cd8b4 Mon Sep 17 00:00:00 2001 From: Ryota Ozaki ozaki.ry...@gmail.com Date: Mon, 21 Sep 2009 23:31:22 +0900 Subject: [PATCH] lxc: suspend/resume support --- src/conf/domain_conf.c | 27 --- src/lxc/lxc_driver.c | 212 +++- src/util/cgroup.c | 23 +- src/util/cgroup.h |4 + 4 files changed, 251 insertions(+), 15 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5ae0775..5e37d96 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4433,19 +4433,22 @@ char *virDomainObjFormat(virConnectPtr conn, virDomainStateTypeToString(obj-state), obj-pid); -switch (obj-monitor_chr-type) { -case VIR_DOMAIN_CHR_TYPE_UNIX: -monitorpath = obj-monitor_chr-data.nix.path; -break; -default: -case VIR_DOMAIN_CHR_TYPE_PTY: -monitorpath = obj-monitor_chr-data.file.path; -break; -} +/* obj-monitor_chr is set only for qemu */ +if (obj-monitor_chr) { +switch (obj-monitor_chr-type) { +case VIR_DOMAIN_CHR_TYPE_UNIX: +monitorpath = obj-monitor_chr-data.nix.path; +break; +default: +case VIR_DOMAIN_CHR_TYPE_PTY: +monitorpath = obj-monitor_chr-data.file.path; +break; +} -virBufferEscapeString(buf, monitor path='%s', monitorpath); -virBufferVSprintf(buf, type='%s'/¥n, - virDomainChrTypeToString(obj-monitor_chr-type)); +virBufferEscapeString(buf, monitor path='%s', monitorpath); +
Re: [libvirt] [PATCH] Power Hypervisor now with libssh2
Daniel Veillard wrote: On Wed, Aug 26, 2009 at 03:53:01AM -0300, Eduardo Otubo wrote: Hello friends, This is the new version of phyp driver now using libssh2. I also did some other changes: * Added some debug information. Sometimes its worth to know which command is being executed and where. So I added the PHYP_CMD_DEBUG macro. actually the macro should use the normal logging facilities, so I intend to clean this up. I Agree, this was an internal debug information only, forgot to remove this out. * All the connection startup is now hard coded in libssh2. For example, I need to open the socket and start the connection all by myself. Not a big deal, but in a near future I am planning to send a patch to libssh2 to encapsulate all these procedures into functions, hence, less code, probably less bugs :) Well for example the code was using gethostbyname which is deprecated not reentrant and the code was leaking the socket if the call failed I cleaned this up and switched to getaddrinfo() as other parts of libvirt code. Please make sure to run make syntax-check before sending a patch in the future, thank in advance ! I won't forgot to do the syntax-check next time. My bad. Anyway the modified patch is now commited. Please try the code as I modified the socket connection handling, The new socket connection handling is working fine, thanks :) -- Eduardo Otubo Software Engineer Linux Technology Center IBM Systems Technology Group Mobile: +55 19 8135 0885 eot...@linux.vnet.ibm.com -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] network: add 'bootp' and 'tftp' config
Currently, libvirtd will start a dnsmasq process for the virtual network, but (aside from killing the dnsmasq process and replacing it), there's no way to define tftp boot options. This change introduces the appropriate tags to the dhcp configuration: network namedefault/name bridge name=virbr%d / forward/ ip address=192.168.122.1 netmask=255.255.255.0 tftp root=/var/lib/tftproot / dhcp range start=192.168.122.2 end=192.168.122.254 / bootp file=pxeboot.img/ /dhcp /ip /network When the attributes are present, these are passed to the arguments to dnsmasq: dnsmasq [...] --enable-tftp --tftp-root /srv/tftp --dhcp-boot pxeboot.img ^^^ ^^^ from tftp / from bootp / At present, only local tftp servers are supported (ie, dnsmasq runs as the tftp server), but we could improve this in future by adding a server= attribute. Signed-off-by: Jeremy Kerr j...@ozlabs.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com 2009-09-21 Paolo Bonzini pbonz...@redhat.com Jeremy Kerr j...@ozlabs.org * docs/formatnetwork.html.in: Document new tags. * docs/formatnetwork.html: Regenerate. * docs/schemas/network.rng: Update. * src/network_conf.c (virNetworkDefFree): Free new fields. (virNetworkDHCPRangeDefParseXML): Parse bootp. (virNetworkIPParseXML): New, parsing dhcp and tftp. (virNetworkDefParseXML): Use virNetworkIPParseXML instead of virNetworkDHCPRangeDefParseXML. (virNetworkDefFormat): Pretty print new fields. * src/network_conf.h (struct _virNetworkDef): Add netboot fields. * src/network_driver.c (networkBuildDnsmasqArgv): Add TFTP and BOOTP arguments. * tests/Makefile.am (EXTRA_DIST): Add networkschemadata. * tests/networkschematest: Look in networkschemadata. * tests/networkschemadata/netboot-network.xml: New. --- Changes from v2: Rebased after the big tree reorg. docs/formatnetwork.html.in | 17 ++-- docs/schemas/network.rng| 10 src/conf/network_conf.c | 60 +- src/conf/network_conf.h |3 + src/network/bridge_driver.c | 14 ++ tests/Makefile.am |1 + tests/networkschemadata/netboot-network.xml | 12 + tests/networkschematest |2 +- 8 files changed, 111 insertions(+), 8 deletions(-) create mode 100644 tests/networkschemadata/netboot-network.xml diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in index fd68430..e471385 100644 --- a/docs/formatnetwork.html.in +++ b/docs/formatnetwork.html.in @@ -113,9 +113,13 @@ address will be their default route. The codenetmask/code attribute defines the significant bits of the network address, again specified in dotted-decimal format. span class=sinceSince 0.3.0/span - /dd - dtcodedhcp/code/dt - ddImmediately within the codeip/code element there is an + /dddtcodetftp/code/dtddImmediately within + the codeip/code element there is an optional codetftp/code + element. The presence of this element and of its attribute + coderoot/code enables TFTP services. The attribute specifies + the path to the root directory served via TFTP. + span class=sinceSince 0.7.1/span + /dddtcodedhcp/code/dtddAlso within the codeip/code element there is an optional codedhcp/code element. The presence of this element enables DHCP services on the virtual network. It will further contain one or more coderange/code elements. @@ -137,7 +141,12 @@ assigned to that host (via the codeip/code attribute), and the name to be given that host by the DHCP server (via the codename/code attribute). span class=sinceSince 0.4.5/span - /dd + /dddtcodebootp/code/dtddThe optional codebootp/code + element specifies BOOTP options to be provided by the DHCP server. + Only one attribute is supported, codefile/code, giving the file + to be used for the boot image). The BOOTP options currently have to + be the same for all address ranges and statically assigned addresses.span + class=sinceSince 0.7.1./span /dl h2a name=examplesExample configuration/a/h2 diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng index a4281a5..042e013 100644 --- a/docs/schemas/network.rng +++ b/docs/schemas/network.rng @@ -60,6 +60,11 @@ optional attribute name=netmasktext//attribute /optional + optional + element name=tftp + attribute name=roottext//attribute + /element + /optional !-- Define the range(s) of IP addresses that the DHCP server should hand out -- element
Re: [libvirt] [PATCH] network: add 'bootp' and 'tftp' config
On Mon, Sep 21, 2009 at 10:50:25PM +0200, Paolo Bonzini wrote: Currently, libvirtd will start a dnsmasq process for the virtual network, but (aside from killing the dnsmasq process and replacing it), there's no way to define tftp boot options. This change introduces the appropriate tags to the dhcp configuration: network namedefault/name bridge name=virbr%d / forward/ ip address=192.168.122.1 netmask=255.255.255.0 tftp root=/var/lib/tftproot / dhcp range start=192.168.122.2 end=192.168.122.254 / bootp file=pxeboot.img/ /dhcp /ip /network When the attributes are present, these are passed to the arguments to dnsmasq: dnsmasq [...] --enable-tftp --tftp-root /srv/tftp --dhcp-boot pxeboot.img ^^^ ^^^ from tftp / from bootp / At present, only local tftp servers are supported (ie, dnsmasq runs as the tftp server), but we could improve this in future by adding a server= attribute. Signed-off-by: Jeremy Kerr j...@ozlabs.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com 2009-09-21 Paolo Bonzini pbonz...@redhat.com Jeremy Kerr j...@ozlabs.org * docs/formatnetwork.html.in: Document new tags. * docs/formatnetwork.html: Regenerate. * docs/schemas/network.rng: Update. * src/network_conf.c (virNetworkDefFree): Free new fields. (virNetworkDHCPRangeDefParseXML): Parse bootp. (virNetworkIPParseXML): New, parsing dhcp and tftp. (virNetworkDefParseXML): Use virNetworkIPParseXML instead of virNetworkDHCPRangeDefParseXML. (virNetworkDefFormat): Pretty print new fields. * src/network_conf.h (struct _virNetworkDef): Add netboot fields. * src/network_driver.c (networkBuildDnsmasqArgv): Add TFTP and BOOTP arguments. * tests/Makefile.am (EXTRA_DIST): Add networkschemadata. * tests/networkschematest: Look in networkschemadata. * tests/networkschemadata/netboot-network.xml: New. --- Changes from v2: Rebased after the big tree reorg. docs/formatnetwork.html.in | 17 ++-- docs/schemas/network.rng| 10 src/conf/network_conf.c | 60 +- src/conf/network_conf.h |3 + src/network/bridge_driver.c | 14 ++ tests/Makefile.am |1 + tests/networkschemadata/netboot-network.xml | 12 + tests/networkschematest |2 +- 8 files changed, 111 insertions(+), 8 deletions(-) create mode 100644 tests/networkschemadata/netboot-network.xml ACK, lets commit this now. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list