Re: [libvirt] [PATCH 1/5] Fix formatting of XML for an inactive guest
On Thu, Nov 12, 2009 at 03:00:47PM +, Daniel P. Berrange wrote: If the virDomainDefPtr object has an 'id' of -1, then forcably set the VIR_DOMAIN_XML_INACTIVE flag to ensure generated XML does not include any cruft from the previously running guest such as console PTY path, or VNC port. * src/conf/domain_conf.c: Set VIR_DOMAIN_XML_INACTIVE if def-id is -1. Replace checks for def-id == -1 with check against flags VIR_DOMAIN_XML_INACTIVE. --- src/conf/domain_conf.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9e37452..c2c07ca 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4407,7 +4407,6 @@ virDomainInputDefFormat(virConnectPtr conn, static int virDomainGraphicsDefFormat(virConnectPtr conn, virBufferPtr buf, - virDomainDefPtr vm, virDomainGraphicsDefPtr def, int flags) { @@ -4424,7 +4423,7 @@ virDomainGraphicsDefFormat(virConnectPtr conn, switch (def-type) { case VIR_DOMAIN_GRAPHICS_TYPE_VNC: if (def-data.vnc.port -(!def-data.vnc.autoport || vm-id != -1)) +(!def-data.vnc.autoport || !(flags VIR_DOMAIN_XML_INACTIVE))) virBufferVSprintf(buf, port='%d', def-data.vnc.port); else if (def-data.vnc.autoport) @@ -4579,7 +4578,10 @@ char *virDomainDefFormat(virConnectPtr conn, goto cleanup; } -if (def-id = 0) +if (def-id == -1) +flags |= VIR_DOMAIN_XML_INACTIVE; + +if (!(flags VIR_DOMAIN_XML_INACTIVE)) virBufferVSprintf(buf, domain type='%s' id='%d'\n, type, def-id); else virBufferVSprintf(buf, domain type='%s'\n, type); @@ -4770,7 +4772,7 @@ char *virDomainDefFormat(virConnectPtr conn, goto cleanup; for (n = 0 ; n def-ngraphics ; n++) -if (virDomainGraphicsDefFormat(conn, buf, def, def-graphics[n], flags) 0) +if (virDomainGraphicsDefFormat(conn, buf, def-graphics[n], flags) 0) goto cleanup; } ACK Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/5] Fix race condition in HAL driver startup
On Thu, Nov 12, 2009 at 03:00:48PM +, Daniel P. Berrange wrote: There is a race condition in HAL driver startup where the callback can get triggered before we have finished startup. This then causes a deadlock in the driver. * src/node_device/node_device_hal.c: RElease driver lock before registering DBus callbacks --- src/node_device/node_device_hal.c | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index 818c7d6..918a3a9 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -742,6 +742,16 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) goto failure; } +/* Populate with known devices */ +driverState-privateData = hal_ctx; + +/* We need to unlock state now, since setting these callbacks cause + * a dbus RPC call, and while this call is waiting for the reply, + * a signal may already arrive, triggering the callback and thus + * requiring the lock ! + */ +nodeDeviceUnlock(driverState); + /* Register HAL event callbacks */ if (!libhal_ctx_set_device_added(hal_ctx, device_added) || !libhal_ctx_set_device_removed(hal_ctx, device_removed) || @@ -753,10 +763,6 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) goto failure; } -/* Populate with known devices */ -driverState-privateData = hal_ctx; - -nodeDeviceUnlock(driverState); udi = libhal_get_all_devices(hal_ctx, num_devs, err); if (udi == NULL) { VIR_ERROR0(libhal_get_all_devices failed\n); Tricky, ACK, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 5/5] Check that domain is running when starting console
On Thu, Nov 12, 2009 at 03:00:51PM +, Daniel P. Berrange wrote: The 'virsh console' command did not check if the domain was already running before attempting to fetch the XML and extract the console PTY path. This caused a slightly unhelpful / misleading error message for the user. The explicit check ensures the user gets an explicit 'domain is not running' message. * tools/virsh.c: Validate that state != VIR_DOMAIN_SHUTOFF in virsh console command --- tools/virsh.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 0d0ebca..9faac35 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -523,6 +523,7 @@ cmdRunConsole(vshControl *ctl, virDomainPtr dom) char *doc; char *thatHost = NULL; char *thisHost = NULL; +virDomainInfo dominfo; if (!(thisHost = virGetHostname(ctl-conn))) { vshError(ctl, %s, _(Failed to get local hostname)); @@ -539,6 +540,16 @@ cmdRunConsole(vshControl *ctl, virDomainPtr dom) goto cleanup; } +if (virDomainGetInfo(dom, dominfo) 0) { +vshError(ctl, %s, _(Unable to get domain status)); +goto cleanup; +} + +if (dominfo.state == VIR_DOMAIN_SHUTOFF) { +vshError(ctl, %s, _(The domain is not running)); +goto cleanup; +} + doc = virDomainGetXMLDesc(dom, 0); if (!doc) goto cleanup; Ah, right, ACK ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] make install fails, missing HTML files
On Thursday 12 November 2009 16:01:39 Matthias Bolte wrote: I came across this problem some time ago, too. I'm using Ubuntu, so it's basically Debian. I somewhat solved it by hacking my /etc/xml/catalog. I added this into the catalog element: rewriteSystem systemIdStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// rewriteURI uriStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// Matthias Thanks for the tip, but it still fails. http://pastebin.com/m3bf17c73 http://pastebin.com/m90f9ba6 catalog xmlns=urn:oasis:names:tc:entity:xmlns:xml:catalog rewriteSystem systemIdStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// rewriteURI uriStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// delegatePublic publicIdStartString=ISO 8879:1986//ENTITIES catalog=file:///etc/xml/sgml-data.xml/ /catalog # ls -l /usr/share/xml/xhtml/schema/dtd/1.0/ total 104 -rw-r--r-- 1 root root 898 2004-08-11 06:17 catalog -rw-r--r-- 1 root root 1385 2004-08-11 06:17 catalog.xml lrwxrwxrwx 1 root root31 2009-11-12 12:50 xhtml1.dcl - ../../../../declaration/xml.dcl -rw-r--r-- 1 root root 32950 2002-08-01 20:23 xhtml1-frameset.dtd -rw-r--r-- 1 root root 25473 2002-08-01 20:23 xhtml1-strict.dtd -rw-r--r-- 1 root root 32112 2002-08-01 20:23 xhtml1-transitional.dtd Any suggestions? kr,tom -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix virt-aa-helper failure when host arch and os.type arch are different
On Fri, Oct 16, 2009 at 01:38:23PM +0100, Daniel P. Berrange wrote: On Wed, Oct 14, 2009 at 05:29:02PM -0500, Jamie Strandboge wrote: This is a fix for Ubuntu bug #448671[1]. virt-aa-helper's get_definition() now calls the new caps_mockup() function which will parse the XML for os.type, os.type.arch and then sets the wordsize. These attributes are needed only to get a valid virCapsPtr for virDomainDefParseString(). The -H and -b options are now removed from virt-aa-helper (they weren't used yet anyway). The patch also adds several tests and fixes another. Please also 'chmod 755 tests/virt-aa-helper-test' so it can be run with 'make check'. Thanks! Jamie ACK, this looks good. Agreed, pushed now, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Fix initscript to check daemon pidfile
On Thu, Nov 12, 2009 at 07:33:30PM +, Daniel P. Berrange wrote: The libvirtd initscript could get confused between the system and session instances of the daemon. To avoid this it is neccessary to check the pidfile explicitly. * daemon/libvirtd.init.in: Always check the pidfile of the system daemon to avoid confusion with the session daemons --- daemon/libvirtd.init.in | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/daemon/libvirtd.init.in b/daemon/libvirtd.init.in index 43c2d68..071fe2c 100644 --- a/daemon/libvirtd.init.in +++ b/daemon/libvirtd.init.in @@ -40,6 +40,7 @@ SERVICE=libvirtd PROCESS=libvirtd +pidfi...@localstatedir@/run/$SERVICE.pid LIBVIRTD_CONFIG= LIBVIRTD_ARGS= @@ -59,7 +60,7 @@ start() { echo -n $Starting $SERVICE daemon: mkdir -p @localstatedir@/cache/libvirt rm -rf @localstatedir@/cache/libvirt/* -KRB5_KTNAME=$KRB5_KTNAME daemon --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS +KRB5_KTNAME=$KRB5_KTNAME daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS RETVAL=$? echo [ $RETVAL -eq 0 ] touch @localstatedir@/lock/subsys/$SERVICE @@ -68,12 +69,12 @@ start() { stop() { echo -n $Stopping $SERVICE daemon: -killproc $PROCESS +killproc -p $PIDFILE $PROCESS RETVAL=$? echo if [ $RETVAL -eq 0 ]; then rm -f @localstatedir@/lock/subsys/$SERVICE -rm -f @localstatedir@/run/$SERVICE.pid +rm -f $PIDFILE rm -rf @localstatedir@/cache/libvirt/* fi } @@ -86,7 +87,7 @@ restart() { reload() { echo -n $Reloading $SERVICE configuration: -killproc $PROCESS -HUP +killproc -p $PIDFILE $PROCESS -HUP RETVAL=$? echo return $RETVAL @@ -98,7 +99,7 @@ case $1 in $1 ;; status) -status $PROCESS +status -p $PIDFILE $PROCESS RETVAL=$? ;; force-reload) ACK, fairly annoying ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] Segmentation fault when shutting down VMs
Hi, I'm facing another problem with latest git. This happens regularly when shutting down VM(s): http://pastebin.com/m4ef1d93f It doesn't depend on which or how many VM is/are shut down, or if I have a VNC connection to a VM that is shutting down. Sometimes after a segv, I get this: http://pastebin.com/m5260bf21 It seems to me that libvirt tries to query a qemu monitor that is no longer alive? kr,tom -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Fix incorrect reference counting logic in qemu monitor open
The QEMU monitor open method would not take a reference on the virDomainObjPtr until it had successfully opened the monitor. The cleanup code upon failure to open though would call qemuMonitorClose() which would in turn decrement the reference count. This caused the virDoaminObjPtr to be mistakenly freed and then the whole driver crashes * src/qemu/qemu_monitor.c: Fix reference counting in qemuMonitorOpen --- src/qemu/qemu_monitor.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 2357734..f0ef81b 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -456,6 +456,7 @@ qemuMonitorOpen(virDomainObjPtr vm, mon-vm = vm; mon-eofCB = eofCB; qemuMonitorLock(mon); +virDomainObjRef(vm); switch (vm-monitor_chr-type) { case VIR_DOMAIN_CHR_TYPE_UNIX: @@ -499,8 +500,6 @@ qemuMonitorOpen(virDomainObjPtr vm, goto cleanup; } -virDomainObjRef(vm); - VIR_DEBUG(New mon %p fd =%d watch=%d, mon, mon-fd, mon-watch); qemuMonitorUnlock(mon); -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Segmentation fault when shutting down VMs
On Fri, Nov 13, 2009 at 11:42:46AM +0100, Thomas Treutner wrote: Hi, I'm facing another problem with latest git. This happens regularly when shutting down VM(s): http://pastebin.com/m4ef1d93f It doesn't depend on which or how many VM is/are shut down, or if I have a VNC connection to a VM that is shutting down. Sometimes after a segv, I get this: http://pastebin.com/m5260bf21 It seems to me that libvirt tries to query a qemu monitor that is no longer alive? This second problem is fixed by http://www.redhat.com/archives/libvir-list/2009-November/msg00458.html I'm still trying to figure out what's going on with the first problem 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 4/5] Fix incorrect variable passed to LXC event callback
On Fri, Nov 13, 2009 at 06:01:46AM +0900, Ryota Ozaki wrote: On Fri, Nov 13, 2009 at 12:00 AM, Daniel P. Berrange berra...@redhat.com wrote: The wrong variable was being passed in with the LXC event callback resulting in a later deadlock or crash * src/lxc/lxc_driver.c: Pass 'vm' instead of 'driver' to event callback --- src/lxc/lxc_driver.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 2baff65..7c78df2 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -941,7 +941,8 @@ static void lxcMonitorEvent(int watch, } cleanup: - virDomainObjUnlock(vm); + if (vm) + virDomainObjUnlock(vm); Hem, if vm is possible to be NULL, above virDomainObjLock(vm) likely fails prior to here. So we also need non-NULL check before virDomainObjLock? No, it is only needed in the cleanup path, due to this bit of code: if (!vm-persistent) { virDomainRemoveInactive(driver-domains, vm); vm = NULL; } cleanup: virDomainObjUnlock(vm); Regards, 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 v0.4] iSCSI Multi-IQN (Libvirt Support)
The following patch set realizes the multi-IQN concept discussed in an earlier thread http://www.mail-archive.com/libvir-list@redhat.com/msg16706.html And here .. http://www.mail-archive.com/libvir-list@redhat.com/msg17499.html The patch realizes an XML schema like the one below and allows libvirt to read through it to create storage pools. These XMLs when created using a virtualization manager realize unique VM to storage LUN mappings through a single console and thus opening up possibilities for the following scenarios - * possibility of multiple IQNs for a single Guest * option for hypervisor's initiator to use these IQNs on behalf of the guest Change Log from v0.3: 1) Set default tab space to 4 2) Use Case Description for Commit Log 3) Review comments from Dave Allan a) No initiator iqn in the xml would mean use of the default initiator iqn name b) Initiator iqn provided would mean a unique session to be created using the provided iqn name. c) Single iSCSI session per pool 4) Added syntax in doc/schemas/storagepool.rng There are no new errors introduced by this patch with make check and make syntax-check tests. Signed-off-by: Sudhir Bellad sudhir_bel...@dell.com Signed-off-by: Shyam Iyer shyam_i...@dell.com libvirt_changes_0.4 Description: libvirt_changes_0.4 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 4/5] Fix incorrect variable passed to LXC event callback
On Fri, Nov 13, 2009 at 8:49 PM, Daniel P. Berrange berra...@redhat.com wrote: On Fri, Nov 13, 2009 at 06:01:46AM +0900, Ryota Ozaki wrote: On Fri, Nov 13, 2009 at 12:00 AM, Daniel P. Berrange berra...@redhat.com wrote: The wrong variable was being passed in with the LXC event callback resulting in a later deadlock or crash * src/lxc/lxc_driver.c: Pass 'vm' instead of 'driver' to event callback --- src/lxc/lxc_driver.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 2baff65..7c78df2 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -941,7 +941,8 @@ static void lxcMonitorEvent(int watch, } cleanup: - virDomainObjUnlock(vm); + if (vm) + virDomainObjUnlock(vm); Hem, if vm is possible to be NULL, above virDomainObjLock(vm) likely fails prior to here. So we also need non-NULL check before virDomainObjLock? No, it is only needed in the cleanup path, due to this bit of code: if (!vm-persistent) { virDomainRemoveInactive(driver-domains, vm); vm = NULL; } cleanup: virDomainObjUnlock(vm); Oh, I missed that... You're right, the fix is correct. ozaki-r Regards, 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 cleanup when state driver init fails
On Fri, Nov 13, 2009 at 9:21 PM, Daniel P. Berrange berra...@redhat.com wrote: * daemon/libvirtd.c: Fix incorrect goto label causing cleanup to be missed when state driver init fails --- daemon/libvirtd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index ef07460..1caa4ce 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -3153,7 +3153,7 @@ int main(int argc, char **argv) { * seriously delay OS bootup process */ if (virStateInitialize(server-privileged) 0) { VIR_ERROR0(Driver state initialization failed); - goto error; + goto shutdown; } ACK ozaki-r /* Start accepting new clients from network */ -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 1/2] Fix guestfwdTarget indentation in domain.rng
* docs/schemas/domain.rng: Fix up some 4 space indentation --- docs/schemas/domain.rng | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index b75f17e..1bf44fd 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -1052,11 +1052,11 @@ /define define name=guestfwdTarget element name=target -attribute name=type -valueguestfwd/value -/attribute -attribute name=address/ -attribute name=port/ + attribute name=type +valueguestfwd/value + /attribute + attribute name=address/ + attribute name=port/ /element /define define name=channel -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 2/2] guestfwd code tidy up
This patch removes qemudBuildCommandLineChrDevTargetStr and inlines its single use. It was intended to be generic, but on reflection this can't work. Instead it just makes the code slightly harder to read. * src/qemu/qemu_conf.c: Remove and inline qemudBuildCommandLineChrDevTargetStr --- src/qemu/qemu_conf.c | 32 1 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 62b42fe..c807688 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1495,29 +1495,6 @@ static void qemudBuildCommandLineChrDevChardevStr(virDomainChrDefPtr dev, } } -static int qemudBuildCommandLineChrDevTargetStr(virDomainChrDefPtr dev, -const char *const id, -virBufferPtr buf) -{ -int ret = 0; -const char *addr = NULL; - -int port; -switch (dev-targetType) { -case VIR_DOMAIN_CHR_TARGET_TYPE_GUESTFWD: -addr = virSocketFormatAddr(dev-target.addr); -port = virSocketGetPort(dev-target.addr); - -virBufferVSprintf(buf, user,guestfwd=tcp:%s:%i-chardev:%s, - addr, port, id); - -VIR_FREE(addr); -break; -} - -return ret; -} - static void qemudBuildCommandLineChrDevStr(virDomainChrDefPtr dev, virBufferPtr buf) { @@ -2205,7 +2182,14 @@ int qemudBuildCommandLine(virConnectPtr conn, ADD_ARG_LIT(-chardev); ADD_ARG(virBufferContentAndReset(buf)); -qemudBuildCommandLineChrDevTargetStr(channel, id, buf); +const char *addr = virSocketFormatAddr(channel-target.addr); +int port = virSocketGetPort(channel-target.addr); + +virBufferVSprintf(buf, user,guestfwd=tcp:%s:%i-chardev:%s, + addr, port, id); + +VIR_FREE(addr); + if (virBufferError(buf)) goto error; -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 1/2] Remove obsolte devicekit checks
Device kit support was removed, but the configure.ac checks were left in place. A number of the XXX_REQUIRED=X.Y.Z variables were not declared in the correct location (ie top of the file) * configure.in: Remove device kit checks move mis-placed variables to correct location --- configure.in | 66 + 1 files changed, 6 insertions(+), 60 deletions(-) diff --git a/configure.in b/configure.in index df8eba2..1c705b2 100644 --- a/configure.in +++ b/configure.in @@ -34,6 +34,12 @@ AVAHI_REQUIRED=0.6.0 POLKIT_REQUIRED=0.6 PARTED_REQUIRED=1.8.0 NETCF_REQUIRED=0.1.3 +UDEV_REQUIRED=145 +PCIACCESS_REQUIRED=0.10.0 +XMLRPC_REQUIRED=1.14.0 +HAL_REQUIRED=0.5.0 +DEVMAPPER_REQUIRED=1.0.0 +LIBCURL_REQUIRED=7.18.0 dnl Checks for C compiler. AC_PROG_CC @@ -472,8 +478,6 @@ PKG_PROG_PKG_CONFIG dnl OpenNebula driver Compilation setting dnl -XMLRPC_REQUIRED=1.14.0 - XMLRPC_CFLAGS= XMLRPC_LIBS= if test x$with_one = xyes -o x$with_one = xcheck; then @@ -1304,7 +1308,6 @@ fi AM_CONDITIONAL([WITH_STORAGE_MPATH], [test $with_storage_mpath = yes]) if test $with_storage_mpath = yes; then - DEVMAPPER_REQUIRED=0.0 DEVMAPPER_CFLAGS= DEVMAPPER_LIBS= PKG_CHECK_MODULES([DEVMAPPER], [devmapper = $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no]) @@ -1379,7 +1382,6 @@ dnl LIBCURL_CFLAGS= LIBCURL_LIBS= -LIBCURL_REQUIRED=7.18.0 LIBCURL_FOUND=no if test $with_esx = yes -o $with_esx = check; then @@ -1655,7 +1657,6 @@ LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.} AC_SUBST([LV_LIBTOOL_OBJDIR]) dnl HAL, DeviceKit, or libudev library for host device enumeration -HAL_REQUIRED=0.0 HAL_CFLAGS= HAL_LIBS= AC_ARG_WITH([hal], @@ -1694,61 +1695,7 @@ AM_CONDITIONAL([HAVE_HAL], [test x$with_hal = xyes]) AC_SUBST([HAL_CFLAGS]) AC_SUBST([HAL_LIBS]) -DEVKIT_REQUIRED=0.0 -DEVKIT_CFLAGS= -DEVKIT_LIBS= -AC_ARG_WITH([devkit], - [ --with-devkit use DeviceKit for host device enumeration], - [], - [with_devkit=no]) -if test $with_libvirtd = no ; then - with_devkit=no -fi - -dnl Extra check needed while devkit pkg-config info missing glib2 dependency -PKG_CHECK_MODULES(GLIB2, glib-2.0 = 0.0,,[ - if test x$with_devkit = xcheck; then -with_devkit=no - elif test x$with_devkit = xyes; then -AC_MSG_ERROR([required package DeviceKit requires package glib-2.0]) - fi]) - -if test x$with_devkit = xyes -o x$with_devkit = xcheck; then - PKG_CHECK_MODULES(DEVKIT, devkit-gobject = $DEVKIT_REQUIRED, -[with_devkit=yes], [ -if test x$with_devkit = xcheck ; then - with_devkit=no -else - AC_MSG_ERROR( - [You must install DeviceKit-devel = $DEVKIT_REQUIRED to compile libvirt]) -fi - ]) - if test x$with_devkit = xyes ; then -AC_DEFINE_UNQUOTED([HAVE_DEVKIT], 1, - [use DeviceKit for host device enumeration]) - -dnl Add glib2 flags explicitly while devkit pkg-config info missing glib2 dependency -DEVKIT_CFLAGS=$GLIB2_CFLAGS $DEVKIT_CFLAGS -DEVKIT_LIBS=$GLIB2_LIBS $DEVKIT_LIBS - -dnl Add more flags apparently required for devkit to work properly -DEVKIT_CFLAGS=$DEVKIT_CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT - -old_CFLAGS=$CFLAGS -old_LDFLAGS=$LDFLAGS -CFLAGS=$CFLAGS $DEVKIT_CFLAGS -LDFLAGS=$LDFLAGS $DEVKIT_LIBS -AC_CHECK_FUNCS([devkit_client_connect],,[with_devkit=no]) -CFLAGS=$old_CFLAGS -LDFLAGS=$old_LDFLAGS - fi -fi -AM_CONDITIONAL([HAVE_DEVKIT], [test x$with_devkit = xyes]) -AC_SUBST([DEVKIT_CFLAGS]) -AC_SUBST([DEVKIT_LIBS]) - -UDEV_REQUIRED=145 UDEV_CFLAGS= UDEV_LIBS= AC_ARG_WITH([udev], @@ -1781,7 +1728,6 @@ if test x$with_udev = xyes -o x$with_udev = xcheck; then CFLAGS=$old_CFLAGS LDFLAGS=$old_LDFLAGS fi - PCIACCESS_REQUIRED=0.10.0 PCIACCESS_CFLAGS= PCIACCESS_LIBS= PKG_CHECK_MODULES([PCIACCESS], [pciaccess = $PCIACCESS_REQUIRED], [], [PCIACCESS_FOUND=no]) -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 2/2] Don't return fatal error in HAL driver init if HAL isn't running
The HAL driver returns a fatal error code in the case where HAL is not running. This causes the entire libvirtd daemon to quit which isn't desirable. Instead it should simply disable the HAL driver * src/node_device/node_device_hal.c: Quietly disable HAL if it is not running --- src/node_device/node_device_hal.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index 918a3a9..1e1d872 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -692,6 +692,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) DBusError err; char **udi = NULL; int num_devs, i; +int ret = -1; /* Ensure caps_tbl is sorted by capability name */ qsort(caps_tbl, ARRAY_CARDINALITY(caps_tbl), sizeof(caps_tbl[0]), @@ -728,7 +729,11 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) goto failure; } if (!libhal_ctx_init(hal_ctx, err)) { -VIR_ERROR0(libhal_ctx_init failed\n); +VIR_ERROR0(libhal_ctx_init failed, haldaemon is probably not running\n); +/* We don't want to show a fatal error here, + otherwise entire libvirtd shuts down when + hald isn't running */ +ret = 0; goto failure; } @@ -787,7 +792,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) nodeDeviceUnlock(driverState); VIR_FREE(driverState); -return -1; +return ret; } -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 1/2] Fix cleanup when state driver init fails
* daemon/libvirtd.c: Fix incorrect goto label causing cleanup to be missed when state driver init fails --- daemon/libvirtd.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index ef07460..1caa4ce 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -3153,7 +3153,7 @@ int main(int argc, char **argv) { * seriously delay OS bootup process */ if (virStateInitialize(server-privileged) 0) { VIR_ERROR0(Driver state initialization failed); -goto error; +goto shutdown; } /* Start accepting new clients from network */ -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 2/2] Fix probing for libpciaccess
If 'with_udev=check' then missing pciaccess should not be a fatal error. It should merely disable the udev driver. * configure.in: Fix pciaccess check to be non-fatal --- configure.in | 33 + 1 files changed, 17 insertions(+), 16 deletions(-) diff --git a/configure.in b/configure.in index 1c705b2..760369c 100644 --- a/configure.in +++ b/configure.in @@ -1656,7 +1656,7 @@ test $enable_shared = no lt_cv_objdir=. LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.} AC_SUBST([LV_LIBTOOL_OBJDIR]) -dnl HAL, DeviceKit, or libudev library for host device enumeration +dnl HAL library check for host device enumeration HAL_CFLAGS= HAL_LIBS= AC_ARG_WITH([hal], @@ -1696,8 +1696,11 @@ AC_SUBST([HAL_CFLAGS]) AC_SUBST([HAL_LIBS]) +dnl udev/libpciaccess library check for alternate host device enumeration UDEV_CFLAGS= UDEV_LIBS= +PCIACCESS_CFLAGS= +PCIACCESS_LIBS= AC_ARG_WITH([udev], [ --with-udevuse libudev for host device enumeration], [], @@ -1708,7 +1711,7 @@ if test $with_libvirtd = no ; then fi if test x$with_udev = xyes -o x$with_udev = xcheck; then PKG_CHECK_MODULES(UDEV, libudev = $UDEV_REQUIRED, -[with_udev=yes], [ +[], [ if test x$with_udev = xcheck ; then with_udev=no else @@ -1716,24 +1719,22 @@ if test x$with_udev = xyes -o x$with_udev = xcheck; then [You must install libudev-devel = $UDEV_REQUIRED to compile libvirt]) fi ]) + if test x$with_udev != xno; then +PKG_CHECK_MODULES(PCIACCESS, pciaccess = $PCIACCESS_REQUIRED, + [with_udev=yes], + [ +if test x$with_udev = xcheck ; then + with_udev=no +else + AC_MSG_ERROR( + [You must install libpciaccess-devel = $PCIACCESS_REQUIRED to compile libvirt]) +fi + ]) + fi if test x$with_udev = xyes ; then AC_DEFINE_UNQUOTED([HAVE_UDEV], 1, [use UDEV for host device enumeration]) - -old_CFLAGS=$CFLAGS -old_LDFLAGS=$LDFLAGS -CFLAGS=$CFLAGS $UDEV_CFLAGS -LDFLAGS=$LDFLAGS $UDEV_LIBS -AC_CHECK_FUNCS([udev_new],,[with_udev=no]) -CFLAGS=$old_CFLAGS -LDFLAGS=$old_LDFLAGS fi - PCIACCESS_CFLAGS= - PCIACCESS_LIBS= - PKG_CHECK_MODULES([PCIACCESS], [pciaccess = $PCIACCESS_REQUIRED], [], [PCIACCESS_FOUND=no]) - if test $PCIACCESS_FOUND = no ; then - AC_MSG_ERROR([You must install libpciaccess/libpciaccess-devel = $PCIACCESS_REQUIRED to compile libvirt]) - fi fi AM_CONDITIONAL([HAVE_UDEV], [test x$with_udev = xyes]) AC_SUBST([UDEV_CFLAGS]) -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Fix incorrect reference counting logic in qemu monitor open
On Fri, Nov 13, 2009 at 8:45 PM, Daniel P. Berrange berra...@redhat.com wrote: The QEMU monitor open method would not take a reference on the virDomainObjPtr until it had successfully opened the monitor. The cleanup code upon failure to open though would call qemuMonitorClose() which would in turn decrement the reference count. This caused the virDoaminObjPtr to be mistakenly freed and then the whole driver crashes ACK, actually this fix and a fix for hal make my libvirtd worked successfully! ozaki-r * src/qemu/qemu_monitor.c: Fix reference counting in qemuMonitorOpen --- src/qemu/qemu_monitor.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 2357734..f0ef81b 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -456,6 +456,7 @@ qemuMonitorOpen(virDomainObjPtr vm, mon-vm = vm; mon-eofCB = eofCB; qemuMonitorLock(mon); + virDomainObjRef(vm); switch (vm-monitor_chr-type) { case VIR_DOMAIN_CHR_TYPE_UNIX: @@ -499,8 +500,6 @@ qemuMonitorOpen(virDomainObjPtr vm, goto cleanup; } - virDomainObjRef(vm); - VIR_DEBUG(New mon %p fd =%d watch=%d, mon, mon-fd, mon-watch); qemuMonitorUnlock(mon); -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] Don't return fatal error in HAL driver init if HAL isn't running
On Fri, Nov 13, 2009 at 9:21 PM, Daniel P. Berrange berra...@redhat.com wrote: The HAL driver returns a fatal error code in the case where HAL is not running. This causes the entire libvirtd daemon to quit which isn't desirable. Instead it should simply disable the HAL driver I'm not sure what happens on this defect though, I guess this may be a timing problem. I encountered this error during host and libvirtd bootup. However, once the host bootup has complete and then I starts libvirtd again, it succeeds. This behavior had never occurred with 0.7.2. Anyway, this fix certainly avoids worse result, ie, libvirtd quit, so ACK ozaki-r * src/node_device/node_device_hal.c: Quietly disable HAL if it is not running --- src/node_device/node_device_hal.c | 9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index 918a3a9..1e1d872 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -692,6 +692,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) DBusError err; char **udi = NULL; int num_devs, i; + int ret = -1; /* Ensure caps_tbl is sorted by capability name */ qsort(caps_tbl, ARRAY_CARDINALITY(caps_tbl), sizeof(caps_tbl[0]), @@ -728,7 +729,11 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) goto failure; } if (!libhal_ctx_init(hal_ctx, err)) { - VIR_ERROR0(libhal_ctx_init failed\n); + VIR_ERROR0(libhal_ctx_init failed, haldaemon is probably not running\n); + /* We don't want to show a fatal error here, + otherwise entire libvirtd shuts down when + hald isn't running */ + ret = 0; goto failure; } @@ -787,7 +792,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) nodeDeviceUnlock(driverState); VIR_FREE(driverState); - return -1; + return ret; } -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Segmentation fault when shutting down VMs
On Friday 13 November 2009 12:46:24 Daniel P. Berrange wrote: I'm still trying to figure out what's going on with the first problem Uhm, it's getting stranger. When trying to do: # export LIBVIRT_DEBUG=1 # strace -o libvirt.log -s 1000 -ff libvirtd -l -v strace crashes with: *** glibc detected *** strace: malloc(): memory corruption (fast): 0x00af75b0 *** during startup, although /usr/local/var/run/libvirt/qemu/ is wiped out and no stale pids or kvms running. http://pastebin.com/m45c03cfb strace's logs until crash: http://tt.scripty.at/tmp/glibc_mem_corrupt.log.tar.bz2 Time for doing a memtest? -t -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/4] AppArmor updates
On Thu, Nov 12, 2009 at 11:47:38AM -0600, Jamie Strandboge wrote: Hi, The following patchset contains various cleanups for the AppArmor driver. It assumes that the patch contained in the email with the following subject is already applied: [libvirt] [PATCH] fix virt-aa-helper failure when host arch and os.type arch are different This patch was ACKed but never applied. When committing that patch, please also chmod 755 ./tests/virt-aa-helper-test. done, 1_aa_profile_updates.patch: Adds pulseaudio, alsa and preliminary save/restore to the example apparmor abstraction. Also allows libvirtd access to inet dgram, inet6 dgram, inet6 stream and /usr/lib/libvirt/*. 2_aa_require_absolute_path.patch: Require absolute path for dynamic added files. This is required by AppArmor and conveniently prevents adding tcp consoles to the profile. This fixes https://launchpad.net/bugs/460271. 3_aa_deny_write_to_readonly.patch: Suppress confusing and misleading apparmor denied message when kvm/qemu tries to open a libvirt specified readonly file (such as a cdrom) with write permissions. libvirt uses the readonly attribute for the security driver only, and has no way of telling kvm/qemu that the device should be opened readonly. This fixes https://launchpad.net/bugs/453335. 4_aa_driver_cleanups.patch: Implements all changes requested by DV except for getting rid of readlink(). I can't use virFileResolveLink() because it lstat()s the file and uses st.st_size to create a buffer. Unfortunately, running lstat() on /proc/self/exe results in st.st_size to be 0. Okay, ot a big deal, fixes all look fine, I applied and pushed them ! The changes pass 'syntax-check'. secaatest and virt-aa-helper-test both pass (there are several problems in the test suite causing 'make check' to fail. These are all unrelated to these patches). Hum, make check works for me, but I don't have apparmor to test thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/2] Remove obsolte devicekit checks
On Fri, Nov 13, 2009 at 12:20:06PM +, Daniel P. Berrange wrote: Device kit support was removed, but the configure.ac checks were left in place. A number of the XXX_REQUIRED=X.Y.Z variables were not declared in the correct location (ie top of the file) * configure.in: Remove device kit checks move mis-placed variables to correct location ACK ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] Fix probing for libpciaccess
On Fri, Nov 13, 2009 at 12:20:07PM +, Daniel P. Berrange wrote: If 'with_udev=check' then missing pciaccess should not be a fatal error. It should merely disable the udev driver. * configure.in: Fix pciaccess check to be non-fatal --- configure.in | 33 + 1 files changed, 17 insertions(+), 16 deletions(-) diff --git a/configure.in b/configure.in index 1c705b2..760369c 100644 --- a/configure.in +++ b/configure.in @@ -1656,7 +1656,7 @@ test $enable_shared = no lt_cv_objdir=. LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.} AC_SUBST([LV_LIBTOOL_OBJDIR]) -dnl HAL, DeviceKit, or libudev library for host device enumeration +dnl HAL library check for host device enumeration HAL_CFLAGS= HAL_LIBS= AC_ARG_WITH([hal], @@ -1696,8 +1696,11 @@ AC_SUBST([HAL_CFLAGS]) AC_SUBST([HAL_LIBS]) +dnl udev/libpciaccess library check for alternate host device enumeration UDEV_CFLAGS= UDEV_LIBS= +PCIACCESS_CFLAGS= +PCIACCESS_LIBS= AC_ARG_WITH([udev], [ --with-udevuse libudev for host device enumeration], [], @@ -1708,7 +1711,7 @@ if test $with_libvirtd = no ; then fi if test x$with_udev = xyes -o x$with_udev = xcheck; then PKG_CHECK_MODULES(UDEV, libudev = $UDEV_REQUIRED, -[with_udev=yes], [ +[], [ if test x$with_udev = xcheck ; then with_udev=no else @@ -1716,24 +1719,22 @@ if test x$with_udev = xyes -o x$with_udev = xcheck; then [You must install libudev-devel = $UDEV_REQUIRED to compile libvirt]) fi ]) + if test x$with_udev != xno; then +PKG_CHECK_MODULES(PCIACCESS, pciaccess = $PCIACCESS_REQUIRED, + [with_udev=yes], + [ +if test x$with_udev = xcheck ; then + with_udev=no +else + AC_MSG_ERROR( + [You must install libpciaccess-devel = $PCIACCESS_REQUIRED to compile libvirt]) +fi + ]) + fi if test x$with_udev = xyes ; then AC_DEFINE_UNQUOTED([HAVE_UDEV], 1, [use UDEV for host device enumeration]) - -old_CFLAGS=$CFLAGS -old_LDFLAGS=$LDFLAGS -CFLAGS=$CFLAGS $UDEV_CFLAGS -LDFLAGS=$LDFLAGS $UDEV_LIBS -AC_CHECK_FUNCS([udev_new],,[with_udev=no]) -CFLAGS=$old_CFLAGS -LDFLAGS=$old_LDFLAGS fi - PCIACCESS_CFLAGS= - PCIACCESS_LIBS= - PKG_CHECK_MODULES([PCIACCESS], [pciaccess = $PCIACCESS_REQUIRED], [], [PCIACCESS_FOUND=no]) - if test $PCIACCESS_FOUND = no ; then - AC_MSG_ERROR([You must install libpciaccess/libpciaccess-devel = $PCIACCESS_REQUIRED to compile libvirt]) - fi fi AM_CONDITIONAL([HAVE_UDEV], [test x$with_udev = xyes]) AC_SUBST([UDEV_CFLAGS]) ACK, this also cleans up some of the comments ... We will have to give a bit of love to the spec file too Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/2] Fix cleanup when state driver init fails
On Fri, Nov 13, 2009 at 12:21:10PM +, Daniel P. Berrange wrote: * daemon/libvirtd.c: Fix incorrect goto label causing cleanup to be missed when state driver init fails --- daemon/libvirtd.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index ef07460..1caa4ce 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -3153,7 +3153,7 @@ int main(int argc, char **argv) { * seriously delay OS bootup process */ if (virStateInitialize(server-privileged) 0) { VIR_ERROR0(Driver state initialization failed); -goto error; +goto shutdown; } /* Start accepting new clients from network */ ACK, having a separate thread run the cleanup makes things a bit harder, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] Don't return fatal error in HAL driver init if HAL isn't running
On Fri, Nov 13, 2009 at 12:21:11PM +, Daniel P. Berrange wrote: The HAL driver returns a fatal error code in the case where HAL is not running. This causes the entire libvirtd daemon to quit which isn't desirable. Instead it should simply disable the HAL driver * src/node_device/node_device_hal.c: Quietly disable HAL if it is not running --- src/node_device/node_device_hal.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index 918a3a9..1e1d872 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -692,6 +692,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) DBusError err; char **udi = NULL; int num_devs, i; +int ret = -1; /* Ensure caps_tbl is sorted by capability name */ qsort(caps_tbl, ARRAY_CARDINALITY(caps_tbl), sizeof(caps_tbl[0]), @@ -728,7 +729,11 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) goto failure; } if (!libhal_ctx_init(hal_ctx, err)) { -VIR_ERROR0(libhal_ctx_init failed\n); +VIR_ERROR0(libhal_ctx_init failed, haldaemon is probably not running\n); +/* We don't want to show a fatal error here, + otherwise entire libvirtd shuts down when + hald isn't running */ +ret = 0; goto failure; } @@ -787,7 +792,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) nodeDeviceUnlock(driverState); VIR_FREE(driverState); -return -1; +return ret; } ACK, makes sense, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] guestfwd code tidy up
On Fri, Nov 13, 2009 at 12:42:12PM +, Matthew Booth wrote: This patch removes qemudBuildCommandLineChrDevTargetStr and inlines its single use. It was intended to be generic, but on reflection this can't work. Instead it just makes the code slightly harder to read. * src/qemu/qemu_conf.c: Remove and inline qemudBuildCommandLineChrDevTargetStr --- src/qemu/qemu_conf.c | 32 1 files changed, 8 insertions(+), 24 deletions(-) Okay, I have applied and pushed the 2 cleanup patches, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] Don't return fatal error in HAL driver init if HAL isn't running
On Fri, Nov 13, 2009 at 10:14:22PM +0900, Ryota Ozaki wrote: On Fri, Nov 13, 2009 at 9:21 PM, Daniel P. Berrange berra...@redhat.com wrote: The HAL driver returns a fatal error code in the case where HAL is not running. This causes the entire libvirtd daemon to quit which isn't desirable. Instead it should simply disable the HAL driver I'm not sure what happens on this defect though, I guess this may be a timing problem. I encountered this error during host and libvirtd bootup. However, once the host bootup has complete and then I starts libvirtd again, it succeeds. Ah well for me, the issue arose when I did 'service haldaemon stop' in order to test the new udev code in libvirt. Not sure of any timing issues that would cause this, unless HAL is being started after libvirt during system bootup 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] Entering freeze for 0.7.3
I think that all expected feature patches have been pushed to git head so it's time to enter feature freeze, and just do cleanup and bug fixing patches until next friday. So the plan is to get 0.7.3 out on the 20th and we then have one month before the end of year holliday season to push the following release (probably 0.7.4 as I don't see a major feature landing in next month, but we never know). so let's focuse on debug for the coming week ! happy hacking :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] make install fails, missing HTML files
2009/11/13 Thomas Treutner tho...@scripty.at: On Thursday 12 November 2009 16:01:39 Matthias Bolte wrote: I came across this problem some time ago, too. I'm using Ubuntu, so it's basically Debian. I somewhat solved it by hacking my /etc/xml/catalog. I added this into the catalog element: rewriteSystem systemIdStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// rewriteURI uriStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// Matthias Thanks for the tip, but it still fails. http://pastebin.com/m3bf17c73 http://pastebin.com/m90f9ba6 catalog xmlns=urn:oasis:names:tc:entity:xmlns:xml:catalog rewriteSystem systemIdStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// rewriteURI uriStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// delegatePublic publicIdStartString=ISO 8879:1986//ENTITIES catalog=file:///etc/xml/sgml-data.xml/ /catalog # ls -l /usr/share/xml/xhtml/schema/dtd/1.0/ total 104 -rw-r--r-- 1 root root 898 2004-08-11 06:17 catalog -rw-r--r-- 1 root root 1385 2004-08-11 06:17 catalog.xml lrwxrwxrwx 1 root root 31 2009-11-12 12:50 xhtml1.dcl - ../../../../declaration/xml.dcl -rw-r--r-- 1 root root 32950 2002-08-01 20:23 xhtml1-frameset.dtd -rw-r--r-- 1 root root 25473 2002-08-01 20:23 xhtml1-strict.dtd -rw-r--r-- 1 root root 32112 2002-08-01 20:23 xhtml1-transitional.dtd Any suggestions? kr,tom Strange. Does it help if you revert the changes to /etc/xml/catalog and apply the attached patch? Matthias diff --git a/docs/Makefile.am b/docs/Makefile.am index d819869..d53f305 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -106,7 +106,7 @@ ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl %.html: %.html.tmp @(if [ -x $(XMLLINT) -a -x $(XMLCATALOG) ] ; then \ - if $(XMLCATALOG) /etc/xml/catalog http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; /dev/null ; then \ + if $(XMLCATALOG) /etc/xml/catalog -//W3C//DTD XHTML 1.0 Strict//EN /dev/null ; then \ echo Validating $@ ; \ $(XMLLINT) --nonet --format --valid $ $@ || : ; \ else echo missing XHTML1 DTD ; fi ; fi ); @@ -117,7 +117,7 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in echo Rebuilding the HTML pages from the XML API ; \ $(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi ) -@(if [ -x $(XMLLINT) -a -x $(XMLCATALOG) ] ; then \ - if $(XMLCATALOG) /etc/xml/catalog http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; /dev/null ; then \ + if $(XMLCATALOG) /etc/xml/catalog -//W3C//DTD XHTML 1.0 Strict//EN /dev/null ; then \ echo Validating the resulting XHTML pages ; \ $(XMLLINT) --nonet --valid --noout html/*.html ; \ else echo missing XHTML1 DTD ; fi ; fi ); diff --git a/docs/site.xsl b/docs/site.xsl index b2983bd..a673f6b 100644 --- a/docs/site.xsl +++ b/docs/site.xsl @@ -11,8 +11,8 @@ method=xml encoding=ISO-8859-1 indent=yes -doctype-public=-//W3C//DTD XHTML 1.0//EN -doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd/ +doctype-public=-//W3C//DTD XHTML 1.0 Strict//EN +doctype-system=-//W3C//DTD XHTML 1.0 Strict//EN/ xsl:variable name=href_base select=''/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] make install fails, missing HTML files
2009/11/13 Matthias Bolte matthias.bo...@googlemail.com: 2009/11/13 Thomas Treutner tho...@scripty.at: On Thursday 12 November 2009 16:01:39 Matthias Bolte wrote: I came across this problem some time ago, too. I'm using Ubuntu, so it's basically Debian. I somewhat solved it by hacking my /etc/xml/catalog. I added this into the catalog element: rewriteSystem systemIdStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// rewriteURI uriStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// Matthias Thanks for the tip, but it still fails. http://pastebin.com/m3bf17c73 http://pastebin.com/m90f9ba6 catalog xmlns=urn:oasis:names:tc:entity:xmlns:xml:catalog rewriteSystem systemIdStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// rewriteURI uriStartString=http://www.w3.org/TR/xhtml1/DTD/; rewritePrefix=file:///usr/share/xml/xhtml/schema/dtd/1.0// delegatePublic publicIdStartString=ISO 8879:1986//ENTITIES catalog=file:///etc/xml/sgml-data.xml/ /catalog # ls -l /usr/share/xml/xhtml/schema/dtd/1.0/ total 104 -rw-r--r-- 1 root root 898 2004-08-11 06:17 catalog -rw-r--r-- 1 root root 1385 2004-08-11 06:17 catalog.xml lrwxrwxrwx 1 root root 31 2009-11-12 12:50 xhtml1.dcl - ../../../../declaration/xml.dcl -rw-r--r-- 1 root root 32950 2002-08-01 20:23 xhtml1-frameset.dtd -rw-r--r-- 1 root root 25473 2002-08-01 20:23 xhtml1-strict.dtd -rw-r--r-- 1 root root 32112 2002-08-01 20:23 xhtml1-transitional.dtd Any suggestions? kr,tom Strange. Does it help if you revert the changes to /etc/xml/catalog and apply the attached patch? Matthias Ah, I can reproduce your pastebin'ed output if I uninstall xsltproc. So I assume you're missing the xsltproc package. The Makefile output is not very helpful in this situation, it tries to validate files that have not been generated, because xsltproc is missing. Matthias -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Make QEMU driver use -chardev everywhere when it's available
Change -monitor, -serial and -parallel output to use -chardev if it is available. * src/qemu/qemu_conf.c: Update qemudBuildCommandLine to use -chardev where available. * tests/qemuxml2argvtest.c tests/qemuxml2argvdata/: Add -chardev equivalents for all current serial and parallel tests. --- src/qemu/qemu_conf.c | 102 +--- .../qemuxml2argv-channel-guestfwd.args |2 +- .../qemuxml2argv-console-compat-chardev.args |1 + .../qemuxml2argv-console-compat-chardev.xml| 28 ++ .../qemuxml2argv-parallel-tcp-chardev.args |1 + .../qemuxml2argv-parallel-tcp-chardev.xml | 27 + .../qemuxml2argv-serial-dev-chardev.args |1 + .../qemuxml2argv-serial-dev-chardev.xml| 30 ++ .../qemuxml2argv-serial-file-chardev.args |1 + .../qemuxml2argv-serial-file-chardev.xml | 30 ++ .../qemuxml2argv-serial-many-chardev.args |1 + .../qemuxml2argv-serial-many-chardev.xml | 32 ++ .../qemuxml2argv-serial-pty-chardev.args |1 + .../qemuxml2argv-serial-pty-chardev.xml| 28 ++ .../qemuxml2argv-serial-tcp-chardev.args |1 + .../qemuxml2argv-serial-tcp-chardev.xml| 32 ++ .../qemuxml2argv-serial-tcp-telnet-chardev.args|1 + .../qemuxml2argv-serial-tcp-telnet-chardev.xml | 32 ++ .../qemuxml2argv-serial-udp-chardev.args |1 + .../qemuxml2argv-serial-udp-chardev.xml| 32 ++ .../qemuxml2argv-serial-unix-chardev.args |1 + .../qemuxml2argv-serial-unix-chardev.xml | 30 ++ .../qemuxml2argv-serial-vc-chardev.args|1 + .../qemuxml2argv-serial-vc-chardev.xml | 28 ++ tests/qemuxml2argvtest.c | 12 +++ 25 files changed, 440 insertions(+), 16 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-compat-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-compat-chardev.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp-chardev.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-dev-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-dev-chardev.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-file-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-file-chardev.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-many-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-many-chardev.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-pty-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-pty-chardev.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-chardev.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet-chardev.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-udp-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-udp-chardev.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-unix-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-unix-chardev.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-vc-chardev.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-vc-chardev.xml diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index c807688..4f4b3db 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1844,12 +1844,36 @@ int qemudBuildCommandLine(virConnectPtr conn, if (monitor_chr) { virBuffer buf = VIR_BUFFER_INITIALIZER; -qemudBuildCommandLineChrDevStr(monitor_chr, buf); -if (virBufferError(buf)) -goto error; +/* Use -chardev if it's available */ +if (qemuCmdFlags QEMUD_CMD_FLAG_CHARDEV) { +char id[16]; + +if (snprintf(id, sizeof(id), monitor%i, i) sizeof(id)) +goto error; -ADD_ARG_LIT(-monitor); -ADD_ARG(virBufferContentAndReset(buf)); +qemudBuildCommandLineChrDevChardevStr(monitor_chr, id, buf); +if (virBufferError(buf)) +goto error; + +ADD_ARG_LIT(-chardev); +ADD_ARG(virBufferContentAndReset(buf)); + +virBufferVSprintf(buf, chardev:%s, id); +if (virBufferError(buf)) +goto error; + +ADD_ARG_LIT(-monitor); +ADD_ARG(virBufferContentAndReset(buf)); +} + +else { +qemudBuildCommandLineChrDevStr(monitor_chr, buf); +
Re: [libvirt] [Patch v0.4] iSCSI Multi-IQN (Libvirt Support)
On Fri, Nov 13, 2009 at 05:18:54PM +0530, sudhir_bel...@dell.com wrote: The following patch set realizes the multi-IQN concept discussed in an earlier thread http://www.mail-archive.com/libvir-list@redhat.com/msg16706.html And here .. http://www.mail-archive.com/libvir-list@redhat.com/msg17499.html The patch realizes an XML schema like the one below and allows libvirt to read through it to create storage pools. These XMLs when created using a virtualization manager realize unique VM to storage LUN mappings through a single console and thus opening up possibilities for the following scenarios - * possibility of multiple IQNs for a single Guest * option for hypervisor's initiator to use these IQNs on behalf of the guest Change Log from v0.3: 1) Set default tab space to 4 I don't know what you did with indentation but the patch looks completely broken in this respect ... 2) Use Case Description for Commit Log 3) Review comments from Dave Allan a) No initiator iqn in the xml would mean use of the default initiator iqn name b) Initiator iqn provided would mean a unique session to be created using the provided iqn name. c) Single iSCSI session per pool 4) Added syntax in doc/schemas/storagepool.rng There are no new errors introduced by this patch with make check and make syntax-check tests. Please attach patches with mime type text/plain or something so that they can be viewed and commented in line even if attached :-) From 7d76cba952e67317dc6f19b480a89d0077299cd8 Mon Sep 17 00:00:00 2001 From: Sudhir Bellad sudhir_bel...@dell.com Date: Fri, 13 Nov 2009 14:42:49 +0530 Subject: [PATCH 2/2] ISCSI Multi-IQN The following patch set realizes the multi-IQN concept discussed in an earlier thread http://www.mail-archive.com/libvir-list@redhat.com/msg16706.html And here .. http://www.mail-archive.com/libvir-list@redhat.com/msg17499.html The patch realizes an XML schema like the one below and allows libvirt to read through it to create storage pools. These XMLs when created using a virtualization manager realize unique VM to storage LUN mappings through a single console and thus opening up possibilities for the following scenarios - * possibility of multiple IQNs for a single Guest * option for hypervisor's initiator to use these IQNs on behalf of the guest Change Log from v0.3: 1) Set default tab space to 4 2) Use Case Description for Commit Log 3) Review comments from Dave Allan a) No initiator iqn in the xml would mean use of the default initiator iqn name b) Initiator iqn provided would mean a unique session to be created using the provided iqn name. c) Single iSCSI session per pool 4) Added syntax in doc/schemas/storagepool.rng There are no new errors introduced by this patch with make check and make syntax-check tests. Signed-off-by: Sudhir Bellad sudhir_bel...@dell.com Signed-off-by: Shyam Iyer shyam_i...@dell.com --- docs/schemas/storagepool.rng | 10 +++ src/storage_backend_iscsi.c | 59 +- src/storage_backend_iscsi.h |2 + src/storage_conf.c | 20 ++ src/storage_conf.h |9 ++ 5 files changed, 87 insertions(+), 13 deletions(-) diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng index d225f97..ea14f31 100644 --- a/docs/schemas/storagepool.rng +++ b/docs/schemas/storagepool.rng @@ -175,6 +175,15 @@ /element /define + define name='initiatorinfoiqnname' +element name='iqnname' + attribute name='name' + text/ need indent + /attribute + empty/ +/element + /define + define name='devextents' oneOrMore element name='freeExtent' @@ -328,6 +337,7 @@ element name='source' ref name='sourceinfohost'/ ref name='sourceinfodev'/ + ref name='initiatorinfoiqnname'/ /element /define looks fine from a schemas POV diff --git a/src/storage_backend_iscsi.c b/src/storage_backend_iscsi.c index b516add..1fb21a5 100644 --- a/src/storage_backend_iscsi.c +++ b/src/storage_backend_iscsi.c @@ -39,6 +39,10 @@ #include storage_backend_iscsi.h #include util.h #include memory.h +#include sys/types.h +#include sys/stat.h +#include fcntl.h +#include unistd.h #define VIR_FROM_THIS VIR_FROM_STORAGE @@ -159,13 +163,54 @@ virStorageBackendISCSIConnection(virConnectPtr conn, const char *portal, const char *action) { -const char *const cmdargv[] = { -ISCSIADM, --mode, node, --portal, portal, ---targetname, pool-def-source.devices[0].path, action, NULL -}; - -if (virRun(conn, cmdargv, NULL) 0) -return -1; +DIR *dir; +struct dirent *entry; + + + if (pool-def-source.initiator.iqnname != NULL) { + if (!(dir = opendir(IFACES_DIR))) { + if (errno == ENOENT) +
Re: [libvirt] [PATCH] only remove masquerade rules in NAT mode
On Thu, Nov 05, 2009 at 08:35:20PM +0100, Guido Günther wrote: Hi, attached patch makes sure we only remove the masquerade rules if forwardType == VIR_NETWORK_FORWARD_NAT and not if forwardType == VIR_NETWORK_FORWARD_ROUTE since we don't use them there. This fixes: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549949 O.k. to apply? Does this look sane? -- Guido -- Guido From 84dc7d595fbd0302077aa767a1fcc840f2a25878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= a...@sigxcpu.org Date: Thu, 5 Nov 2009 20:28:11 +0100 Subject: [PATCH] only remove masquerade roles for VIR_NETWORK_FORWARD_NAT --- src/network/bridge_driver.c | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 95bc810..86ec392 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -765,16 +765,15 @@ static void networkRemoveIptablesRules(struct network_driver *driver, virNetworkObjPtr network) { if (network-def-forwardType != VIR_NETWORK_FORWARD_NONE) { -iptablesRemoveForwardMasquerade(driver-iptables, -network-def-network, -network-def-forwardDev); - -if (network-def-forwardType == VIR_NETWORK_FORWARD_NAT) +if (network-def-forwardType == VIR_NETWORK_FORWARD_NAT) { +iptablesRemoveForwardMasquerade(driver-iptables, +network-def-network, +network-def-forwardDev); iptablesRemoveForwardAllowRelatedIn(driver-iptables, network-def-network, network-def-bridge, network-def-forwardDev); -else if (network-def-forwardType == VIR_NETWORK_FORWARD_ROUTE) +} else if (network-def-forwardType == VIR_NETWORK_FORWARD_ROUTE) iptablesRemoveForwardAllowIn(driver-iptables, network-def-network, network-def-bridge, -- 1.6.5.2 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] make install fails, missing HTML files
On Friday 13 November 2009 16:41:02 Matthias Bolte wrote: Ah, I can reproduce your pastebin'ed output if I uninstall xsltproc. So I assume you're missing the xsltproc package. The Makefile output is not very helpful in this situation, it tries to validate files that have not been generated, because xsltproc is missing. Thx a lot, that works (even w/o your patches)! kr,t -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Fix compilation of libvirt against xen-unstable
libvirt fails to compile against current xen-unstable. This patch fixes it. Regards, Jim commit d08067f04248c7f1bd797f4401308ea9a8971f1b Author: Jim Fehlig jfeh...@novell.com Date: Fri Nov 13 14:44:56 2009 -0700 xen-unstable changeset 19788 removed MAX_VIRT_CPUS from public headers, breaking compilation of libvirt on -unstable. Its semanitc was retained with XEN_LEGACY_MAX_VCPUS. Ensure MAX_VIRT_CPUS is defined accordingly. diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c index 6d8bfdd..843102a 100644 --- a/src/xen/xen_hypervisor.c +++ b/src/xen/xen_hypervisor.c @@ -109,6 +109,14 @@ typedef privcmd_hypercall_t hypercall_t; #define SYS_IFACE_MIN_VERS_NUMA 4 #endif +/* xen-unstable changeset 19788 removed MAX_VIRT_CPUS from public + * headers. Its semanitc was retained with XEN_LEGACY_MAX_VCPUS. + * Ensure MAX_VIRT_CPUS is defined accordingly. + */ +#if !defined(MAX_VIRT_CPUS) defined(XEN_LEGACY_MAX_VCPUS) +#define MAX_VIRT_CPUS XEN_LEGACY_MAX_VCPUS +#endif + static int xen_ioctl_hypercall_cmd = 0; static int initialized = 0; static int in_init = 0; -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] make install fails, missing HTML files
2009/11/13 Thomas Treutner tho...@scripty.at: On Friday 13 November 2009 16:41:02 Matthias Bolte wrote: Ah, I can reproduce your pastebin'ed output if I uninstall xsltproc. So I assume you're missing the xsltproc package. The Makefile output is not very helpful in this situation, it tries to validate files that have not been generated, because xsltproc is missing. Thx a lot, that works (even w/o your patches)! kr,t Well, I assume you still have the two rewite lines in your /etc/xml/catalog, that's why it's working without the patch. Matthias -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] fix detach-disk for inactive xen domains
detach-disk was not working for inactive xen domains due to lookup of device ID from xenstore. When detaching disks there is no need to use device id as device name can be used directly. Unfortunately that same is not true for network devices. In fact, AFAICT, there is no way to hot unplug a network device from inactive domain using xen tools. I have tested attaching/detaching disks to/from both active and inactive domains. I've also ensured no regressions in attaching/detaching network devices on active domains and attaching network devices on inactive domains. As noted above, detaching network devices from inactive domains does not work, but I'm not sure what we can do about that since xen tools themselves don't support this. Any suggestions are kindly welcomed. Oh, and I also ensured all of these scenarios work with both PV and HVM domains. Regards, Jim commit 769a887434faf76f8e80aa505e3880d4fdbe572e Author: Jim Fehlig jfeh...@novell.com Date: Fri Nov 13 15:34:44 2009 -0700 Fix detach-disk for inactive xen domains. Looking in xenstore for device ID of disk won't work for inactive xen domains. Instead, use the device name, e.g. xvda, hda, etc. The device name can be used to remove disk device regardless if domain is active or inactive. diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index d61e9e6..b98e83b 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -96,6 +96,14 @@ virDomainXMLDevID(virDomainPtr domain, char *class, char *ref, int ref_len); + +static int +virDomainGetDevInfo(virDomainPtr domain, +virDomainDeviceDefPtr dev, +char *class, +int class_len, +char *ref, +int ref_len); #endif #define virXendError(conn, code, fmt...) \ @@ -4231,8 +4239,8 @@ xenDaemonDetachDevice(virDomainPtr domain, const char *xml) def, xml, VIR_DOMAIN_XML_INACTIVE))) goto cleanup; -if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref))) -goto cleanup; +if (virDomainGetDevInfo(domain, dev, class, sizeof(class), +ref, sizeof(ref))) ret = xend_op(domain-conn, domain-name, op, device_destroy, type, class, dev, ref, force, 0, rm_cfg, 1, NULL); @@ -5967,4 +5975,52 @@ virDomainXMLDevID(virDomainPtr domain, return 0; } + +/** + * virDomainGetDevInfo: + * @domain: pointer to domain object + * @dev: pointer to device config object + * @class: Xen device class vbd, tap, or vif (OUT) + * @class_len: Length of class + * @ref: Xen device reference (OUT) + * @ref_len: Length of ref + * + * Set class according to driver name, and: + * - if disk, copy in ref the target name from description + * - otherwise call virDomainXMLDevID to populate class and ref + * + * Returns 0 in case of success, -1 in case of failure. + */ +static int +virDomainGetDevInfo(virDomainPtr domain, +virDomainDeviceDefPtr dev, +char *class, +int class_len, +char *ref, +int ref_len) +{ +char *tmp; + +if (dev-type == VIR_DOMAIN_DEVICE_DISK) { +if (dev-data.disk-driverName +STREQ(dev-data.disk-driverName, tap)) +tmp = virStrcpy(class, tap, class_len); +else +tmp = virStrcpy(class, vbd, class_len); +if (tmp == NULL) +return -1; + +if (dev-data.disk-dst == NULL) +return -1; + +tmp = virStrcpy(ref, dev-data.disk-dst, ref_len); +if (tmp == NULL) +return -1; + +return 0; +} + +return virDomainXMLDevID(domain, dev, class, ref, ref_len); +} + #endif /* ! PROXY */ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] esx: Add documentation to the website
* docs/drivers.html.in: list the ESX driver * docs/drvesx.html.in: the new ESX driver documentation * docs/hvsupport.html.in: add the ESX driver to the matrix * docs/index.html.in, docs/sitemap.html.in: list the ESX driver * src/esx/esx_driver.c: fix and cleanup some comments --- docs/drivers.html.in |1 + docs/drvesx.html.in| 497 docs/hvsupport.html.in | 69 +++- docs/index.html.in |3 + docs/sitemap.html.in |4 + src/esx/esx_driver.c |8 +- 6 files changed, 574 insertions(+), 8 deletions(-) create mode 100644 docs/drvesx.html.in diff --git a/docs/drivers.html.in b/docs/drivers.html.in index 983115a..7e31434 100644 --- a/docs/drivers.html.in +++ b/docs/drivers.html.in @@ -24,6 +24,7 @@ listronga href=drvopenvz.htmlOpenVZ/a/strong/li listronga href=drvvbox.htmlVirtualBox/a/strong/li listronga href=drvone.htmlOpenNebula/a/strong/li + listronga href=drvesx.htmlVMware ESX/a/strong/li /ul /body /html diff --git a/docs/drvesx.html.in b/docs/drvesx.html.in new file mode 100644 index 000..893c1e2 --- /dev/null +++ b/docs/drvesx.html.in @@ -0,0 +1,497 @@ +htmlbody +h1VMware ESX hypervisor driver/h1 +ul id=toc/ul +p +The libvirt VMware ESX driver can manage VMware ESX/ESXi 3.5/4.0 and +VMware GSX 2.0, also called VMware Server 2.0, and possibly later +versions. +/p + + +h2a name=prereqDeployment pre-requisites/a/h2 +p +None. Any out-of-the-box installation of ESX/GSX should work. No +preparations are required on the server side, no libvirtd must be +installed on the ESX server. The driver uses version 2.5 of the remote, +SOAP based +a href=http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/; +VMware Virtual Infrastructure API/a to communicate with the +ESX server, like the VMware Virtual Infrastructure Client does. Since +version 4.0 this API is called +a href=http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/; +VMware vSphere API/a. +/p + +h2a name=uriConnections to the VMware ESX driver/a/h2 +p +Some example remote connection URIs for the driver are: +/p +pre +esx://example.com (ESX over HTTPS) +gsx://example.com (GSX over HTTPS) +esx://example.com/?transport=http (ESX over HTTP) +esx://example.com/?no_verify=1 (ESX over HTTPS, but doesn't verify the server's SSL certificate) +/pre + + +h3a name=uriformatURI Format/a/h3 +p +URIs have this general form ('[...]' marks an optional part). +/p +pre +type://[usern...@]hostname[:port]/[?extraparameters] +/pre +p +The codetype:///code is either codeesx:///code or +codegsx:///code and the driver selects the default port depending +on it. For ESX the default HTTPS port is 443, for GSX it is 8333. If +the port parameter is given, it overrides the default port. +/p + + +h4Extra parameters/h4 +p +Extra parameters can be added to a URI as part of the query string +(the part following '?'). The driver understands the extra parameters +shown below. +/p +table class=top_table +tr +thName/th +thValues/th +thMeaning/th +/tr +tr +td +codetransport/code +/td +td +codehttp/code or codehttps/code +/td +td +Overrides the default HTTPS transport. For ESX the default +HTTP port is 80, for GSX it is 8222. +/td +/tr +tr +td +codevcenter/code +/td +td +Hostname of a VMware vCenter +/td +td +In order to perform a migration the driver needs to know the +VMware vCenter for the ESX server. +/td +/tr +tr +td +codeno_verify/code +/td +td +code0/code or code1/code +/td +td +If set to 1, this disables libcurl client checks of the server's +SSL certificate. The default value it 0. +/td +/tr +/table + + +h3a name=authAuthentication/a/h3 +p +In order to perform any useful operation the driver needs to log into +the ESX server. Therefore, only codevirConnectOpenAuth/code can be +used to connect to an ESX server, codevirConnectOpen/code and +codevirConnectOpenReadOnly/code don't work. +To log into an ESX server or vCenter the driver will request +credentials using the callback passed to the +codevirConnectOpenAuth/code function. The driver passes the +hostname as
[libvirt] [PATCH] esx: Handle 'vmxnet3' in esxVMX_FormatEthernet()
In commit 3c80fac2588cbc9e5ee7e7069e1ca4468f2359d3 'vmxnet3' handling was added to esxVMX_ParseEthernet(), but not to the inverse function esxVMX_FormatEthernet(). --- src/esx/esx_vmx.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/esx/esx_vmx.c b/src/esx/esx_vmx.c index 536bf2d..97ad43e 100644 --- a/src/esx/esx_vmx.c +++ b/src/esx/esx_vmx.c @@ -1758,7 +1758,8 @@ esxVMX_ParseEthernet(virConnectPtr conn, virConfPtr conf, int controller, STRCASENEQ(virtualDev, e1000)) { ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR, Expecting VMX entry '%s' to be 'vlance' or 'vmxnet' or - 'vmxnet3' or 'e1000' but found '%s', virtualDev_name, virtualDev); + 'vmxnet3' or 'e1000' but found '%s', virtualDev_name, + virtualDev); goto failure; } @@ -2646,11 +2647,12 @@ esxVMX_FormatEthernet(virConnectPtr conn, virDomainNetDefPtr def, if (def-model != NULL) { if (STRCASENEQ(def-model, vlance) STRCASENEQ(def-model, vmxnet) +STRCASENEQ(def-model, vmxnet3) STRCASENEQ(def-model, e1000)) { ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR, Expecting domain XML entry 'devices/interfase/model' - to be 'vlance' or 'vmxnet' or 'e1000' but found '%s', - def-model); + to be 'vlance' or 'vmxnet' or 'vmxnet3' or 'e1000' but + found '%s', def-model); return -1; } -- 1.6.0.4 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Change DTD references to use public instead of system identifier
Debian's /etc/xml/catalog doesn't contain system identifiers, so use public identifiers instead. * docs/Makefile.am: use public instead of system identifier * docs/site.xsl: use matching public identifier --- docs/Makefile.am |6 +++--- docs/site.xsl|2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index d819869..d53f305 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -106,7 +106,7 @@ ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl %.html: %.html.tmp @(if [ -x $(XMLLINT) -a -x $(XMLCATALOG) ] ; then \ - if $(XMLCATALOG) /etc/xml/catalog http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; /dev/null ; then \ + if $(XMLCATALOG) /etc/xml/catalog -//W3C//DTD XHTML 1.0 Strict//EN /dev/null ; then \ echo Validating $@ ; \ $(XMLLINT) --nonet --format --valid $ $@ || : ; \ else echo missing XHTML1 DTD ; fi ; fi ); @@ -117,7 +117,7 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in echo Rebuilding the HTML pages from the XML API ; \ $(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi ) -@(if [ -x $(XMLLINT) -a -x $(XMLCATALOG) ] ; then \ - if $(XMLCATALOG) /etc/xml/catalog http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; /dev/null ; then \ + if $(XMLCATALOG) /etc/xml/catalog -//W3C//DTD XHTML 1.0 Strict//EN /dev/null ; then \ echo Validating the resulting XHTML pages ; \ $(XMLLINT) --nonet --valid --noout html/*.html ; \ else echo missing XHTML1 DTD ; fi ; fi ); @@ -159,4 +159,4 @@ uninstall-local: for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \ - rm $(DESTDIR)$(DEVHELP_DIR)$$f ; done \ No newline at end of file + rm $(DESTDIR)$(DEVHELP_DIR)$$f ; done diff --git a/docs/site.xsl b/docs/site.xsl index b2983bd..86cfd41 100644 --- a/docs/site.xsl +++ b/docs/site.xsl @@ -11,7 +11,7 @@ method=xml encoding=ISO-8859-1 indent=yes -doctype-public=-//W3C//DTD XHTML 1.0//EN +doctype-public=-//W3C//DTD XHTML 1.0 Strict//EN doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd/ xsl:variable name=href_base select=''/ -- 1.6.0.4 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Whitespace cleanup for pre-tags on the website
--- docs/drvlxc.html.in | 80 +- docs/drvone.html.in | 89 +++-- docs/drvopenvz.html.in| 22 +++--- docs/drvqemu.html.in | 48 ++-- docs/drvtest.html.in | 16 ++-- docs/drvuml.html.in | 22 +++--- docs/drvvbox.html.in | 194 ++--- docs/drvxen.html.in | 22 +++--- docs/formatdomain.html.in |3 +- docs/storage.html.in | 18 ++--- 10 files changed, 253 insertions(+), 261 deletions(-) diff --git a/docs/drvlxc.html.in b/docs/drvlxc.html.in index f67b7d0..cfcfdab 100644 --- a/docs/drvlxc.html.in +++ b/docs/drvlxc.html.in @@ -13,24 +13,24 @@ start it using p/p pre lt;domain type='lxc'gt; -lt;namegt;vm1lt;/namegt; -lt;memorygt;50lt;/memorygt; -lt;osgt; -lt;typegt;exelt;/typegt; -lt;initgt;/bin/shlt;/initgt; -lt;/osgt; -lt;vcpugt;1lt;/vcpugt; -lt;clock offset='utc'/gt; -lt;on_poweroffgt;destroylt;/on_poweroffgt; -lt;on_rebootgt;restartlt;/on_rebootgt; -lt;on_crashgt;destroylt;/on_crashgt; -lt;devicesgt; -lt;emulatorgt;/usr/libexec/libvirt_lxclt;/emulatorgt; -lt;interface type='network'gt; -lt;source network='default'/gt; -lt;/interfacegt; -lt;console type='pty' /gt; -lt;/devicesgt; + lt;namegt;vm1lt;/namegt; + lt;memorygt;50lt;/memorygt; + lt;osgt; +lt;typegt;exelt;/typegt; +lt;initgt;/bin/shlt;/initgt; + lt;/osgt; + lt;vcpugt;1lt;/vcpugt; + lt;clock offset='utc'/gt; + lt;on_poweroffgt;destroylt;/on_poweroffgt; + lt;on_rebootgt;restartlt;/on_rebootgt; + lt;on_crashgt;destroylt;/on_crashgt; + lt;devicesgt; +lt;emulatorgt;/usr/libexec/libvirt_lxclt;/emulatorgt; +lt;interface type='network'gt; + lt;source network='default'/gt; +lt;/interfacegt; +lt;console type='pty' /gt; + lt;/devicesgt; lt;/domaingt; /pre @@ -42,28 +42,28 @@ debootstrap, whatever) under /opt/vm-1-root: p/p pre lt;domain type='lxc'gt; -lt;namegt;vm1lt;/namegt; -lt;memorygt;32768lt;/memorygt; -lt;osgt; -lt;typegt;exelt;/typegt; -lt;initgt;/initlt;/initgt; -lt;/osgt; -lt;vcpugt;1lt;/vcpugt; -lt;clock offset='utc'/gt; -lt;on_poweroffgt;destroylt;/on_poweroffgt; -lt;on_rebootgt;restartlt;/on_rebootgt; -lt;on_crashgt;destroylt;/on_crashgt; -lt;devicesgt; -lt;emulatorgt;/usr/libexec/libvirt_lxclt;/emulatorgt; -lt;filesystem type='mount'gt; -lt;source dir='/opt/vm-1-root'/gt; -lt;target dir='/'/gt; -lt;/filesystemgt; -lt;interface type='network'gt; -lt;source network='default'/gt; -lt;/interfacegt; -lt;console type='pty' /gt; -lt;/devicesgt; + lt;namegt;vm1lt;/namegt; + lt;memorygt;32768lt;/memorygt; + lt;osgt; +lt;typegt;exelt;/typegt; +lt;initgt;/initlt;/initgt; + lt;/osgt; + lt;vcpugt;1lt;/vcpugt; + lt;clock offset='utc'/gt; + lt;on_poweroffgt;destroylt;/on_poweroffgt; + lt;on_rebootgt;restartlt;/on_rebootgt; + lt;on_crashgt;destroylt;/on_crashgt; + lt;devicesgt; +lt;emulatorgt;/usr/libexec/libvirt_lxclt;/emulatorgt; +lt;filesystem type='mount'gt; + lt;source dir='/opt/vm-1-root'/gt; + lt;target dir='/'/gt; +lt;/filesystemgt; +lt;interface type='network'gt; + lt;source network='default'/gt; +lt;/interfacegt; +lt;console type='pty' /gt; + lt;/devicesgt; lt;/domaingt; /pre diff --git a/docs/drvone.html.in b/docs/drvone.html.in index 1745be1..036c0c7 100644 --- a/docs/drvone.html.in +++ b/docs/drvone.html.in @@ -27,12 +27,13 @@ tools and VM description files./p pThe Uri of the driver protocol is one. Some example connection Uris for the driver are: /p -preone:/// (local access) -one+unix:/// (local access) -one://example.com/ (remote access) -one+tcp://example.com/ (remote access, SASl/Kerberos) -one+ssh://u...@example.com/ (remote access, SSH tunnelled) -/pre +pre +one:/// (local access) +one+unix:/// (local access) +one://example.com/ (remote access) +one+tcp://example.com/ (remote access, SASl/Kerberos) +one+ssh://u...@example.com/ (remote access, SSH tunnelled) +/pre h2 a name=xmlconfig/aExample domain XML config/h2 pThere are some limitations on the XML attributes that may be @@ -42,51 +43,51 @@ driver:/p h3Paravirtualized guest direct kernel boot /h3 -prelt;domain type='one'gt; -lt;namegt;vm01lt;/namegt; -lt;memorygt;32768lt;/memorygt; -lt;vcpugt;1lt;/vcpugt; +pre +lt;domain type='one'gt; + lt;namegt;vm01lt;/namegt; +