[libvirt] [PATCH] fixed segfault in virauth
by Martin Kletzander
No check for conn->uri being NULL in virAuthGetConfigFilePath (valid state) made the client segfault. This happens with fresh defalt VDSM configuration for example.
The check ought to be enough as conn->uri being NULL is valid in later code.
---
src/util/virauth.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/util/virauth.c b/src/util/virauth.c
index e6b1db0..2c1a4ae 100644
--- a/src/util/virauth.c
+++ b/src/util/virauth.c
@@ -1,7 +1,7 @@
/*
* virauth.c: authentication related utility functions
*
- * Copyright (C) 2010 Matthias Bolte <matthias.bolte(a)googlemail.com>
+ * Copyright (C) 2010, 2012 Matthias Bolte <matthias.bolte(a)googlemail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -54,14 +54,16 @@ int virAuthGetConfigFilePath(virConnectPtr conn,
return 0;
}
- for (i = 0 ; i < conn->uri->paramsCount ; i++) {
- if (STREQ_NULLABLE(conn->uri->params[i].name, "authfile") &&
- conn->uri->params[i].value) {
- VIR_DEBUG("Using path from URI '%s'",
- conn->uri->params[i].value);
- if (!(*path = strdup(conn->uri->params[i].value)))
- goto no_memory;
- return 0;
+ if (conn && conn->uri) {
+ for (i = 0 ; i < conn->uri->paramsCount ; i++) {
+ if (STREQ_NULLABLE(conn->uri->params[i].name, "authfile") &&
+ conn->uri->params[i].value) {
+ VIR_DEBUG("Using path from URI '%s'",
+ conn->uri->params[i].value);
+ if (!(*path = strdup(conn->uri->params[i].value)))
+ goto no_memory;
+ return 0;
+ }
}
}
--
1.7.8.6
12 years, 4 months
[libvirt] [PATCH] qemu: Set swap_hard_limit before hard_limit
by Osier Yang
Setting hard_limit larger than previous swap_hard_limit must fail,
it's not that good if one wants to change the swap_hard_limit
and hard_limit together. E.g.
% virsh memtune rhel6
hard_limit : 1000000
soft_limit : 1000000
swap_hard_limit: 1000000
% virsh memtune rhel6 --hard-limit 1000020 --soft-limit 1000020 \
--swap-hard-limit 1000020 --live
This patch reoder the limits setting to set the swap_hard_limit
first.
---
src/qemu/qemu_driver.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index dc04d13..1abdd27 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6625,43 +6625,43 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
for (i = 0; i < nparams; i++) {
virTypedParameterPtr param = ¶ms[i];
- if (STREQ(param->field, VIR_DOMAIN_MEMORY_HARD_LIMIT)) {
+ if (STREQ(param->field, VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT)) {
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
- rc = virCgroupSetMemoryHardLimit(group, params[i].value.ul);
+ rc = virCgroupSetMemSwapHardLimit(group, params[i].value.ul);
if (rc != 0) {
virReportSystemError(-rc, "%s",
- _("unable to set memory hard_limit tunable"));
+ _("unable to set swap_hard_limit tunable"));
ret = -1;
}
}
-
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
- persistentDef->mem.hard_limit = params[i].value.ul;
+ persistentDef->mem.swap_hard_limit = params[i].value.ul;
}
- } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_SOFT_LIMIT)) {
+ } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_HARD_LIMIT)) {
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
- rc = virCgroupSetMemorySoftLimit(group, params[i].value.ul);
+ rc = virCgroupSetMemoryHardLimit(group, params[i].value.ul);
if (rc != 0) {
virReportSystemError(-rc, "%s",
- _("unable to set memory soft_limit tunable"));
+ _("unable to set memory hard_limit tunable"));
ret = -1;
}
}
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
- persistentDef->mem.soft_limit = params[i].value.ul;
+ persistentDef->mem.hard_limit = params[i].value.ul;
}
- } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT)) {
+ } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_SOFT_LIMIT)) {
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
- rc = virCgroupSetMemSwapHardLimit(group, params[i].value.ul);
+ rc = virCgroupSetMemorySoftLimit(group, params[i].value.ul);
if (rc != 0) {
virReportSystemError(-rc, "%s",
- _("unable to set swap_hard_limit tunable"));
+ _("unable to set memory soft_limit tunable"));
ret = -1;
}
}
+
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
- persistentDef->mem.swap_hard_limit = params[i].value.ul;
+ persistentDef->mem.soft_limit = params[i].value.ul;
}
}
}
--
1.7.7.3
12 years, 4 months
[libvirt] [PATCH] More advanced auto-detection of driver module directory
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
When running directly from GIT, libvirtd attempts to locate
the directory containing loadable modules. This currently
only works if executing libvirtd with a CWD inside the libvirt
source tree. Switch to locate based on the path to the current
binary instead
---
daemon/libvirtd.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index b5c0102..a7bb9dd 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -972,9 +972,27 @@ int main(int argc, char **argv) {
virLogSetFromEnv();
#ifdef WITH_DRIVER_MODULES
- if (strstr(argv[0], "lt-libvirtd") &&
- (access("./.git", R_OK) >= 0 || access("../.git", R_OK) >= 0))
- virDriverModuleInitialize("./src/.libs");
+ if (strstr(argv[0], "lt-libvirtd")) {
+ char *tmp = strrchr(argv[0], '/');
+ if (!tmp) {
+ fprintf(stderr, _("%s: cannot identify driver directory\n"), argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ *tmp = '\0';
+ char *driverdir;
+ if (virAsprintf(&driverdir, "%s/../../src/.libs", argv[0]) < 0) {
+ fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ if (access(driverdir, R_OK) < 0) {
+ fprintf(stderr, _("%s: expected driver directory '%s' is missing\n"),
+ argv[0], driverdir);
+ exit(EXIT_FAILURE);
+ }
+ virDriverModuleInitialize(driverdir);
+ *tmp = '/';
+ /* Must not free 'driverdir' - it is still used */
+ }
#endif
while (1) {
--
1.7.10.4
12 years, 4 months
[libvirt] [PATCH] Make ESX & Hyper-V code generator safe with parallel builds
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
If from a clean GIT checkout 'make -j 8' is run, the ESX
and Hyper-V code will be generated multiple times over.
This is because there are multiple files being generated
from one invocation of the generator script. make does not
realize this and so invokes the generator once per file.
This doesn't matter with serialized builds, but with
parallel builds multiple instances of the generator get
run at once.
make[2]: Entering directory `/home/berrange/src/virt/libvirt/src'
GEN util/virkeymaps.h
GEN remote/remote_protocol.h
GEN remote/remote_client_bodies.h
GEN remote/qemu_protocol.h
GEN remote/qemu_client_bodies.h
GEN esx/esx_vi_methods.generated.c
GEN esx/esx_vi_methods.generated.h
GEN esx/esx_vi_methods.generated.macro
GEN esx/esx_vi_types.generated.c
GEN esx/esx_vi_types.generated.h
GEN esx/esx_vi_types.generated.typedef
GEN esx/esx_vi_types.generated.typedef
GEN esx/esx_vi_types.generated.typeenum
GEN esx/esx_vi_types.generated.typetostring
GEN esx/esx_vi_types.generated.typefromstring
GEN esx/esx_vi_types.generated.h
GEN esx/esx_vi_types.generated.c
GEN esx/esx_vi_methods.generated.h
GEN esx/esx_vi_methods.generated.c
GEN esx/esx_vi_methods.generated.macro
GEN esx/esx_vi.generated.h
GEN esx/esx_vi.generated.c
GEN esx/esx_vi_types.generated.typeenum
GEN esx/esx_vi_types.generated.typedef
GEN esx/esx_vi_types.generated.typeenum
GEN esx/esx_vi_types.generated.typetostring
GEN esx/esx_vi_types.generated.typefromstring
GEN esx/esx_vi_types.generated.h
GEN esx/esx_vi_types.generated.c
GEN esx/esx_vi_methods.generated.h
...snip...
GEN hyperv/hyperv_wmi.generated.h
GEN libvirt_qemu_probes.h
GEN locking/qemu-sanlock.conf
GEN hyperv/hyperv_wmi.generated.c
GEN rpc/virnetprotocol.h
GEN hyperv/hyperv_wmi_classes.generated.typedef
GEN hyperv/hyperv_wmi_classes.generated.h
GEN hyperv/hyperv_wmi_classes.generated.c
GEN rpc/virkeepaliveprotocol.h
GEN remote/remote_protocol.c
GEN remote/qemu_protocol.c
GEN rpc/virkeepaliveprotocol.c
GEN rpc/virnetprotocol.c
GEN libvirt.def
Prevent this using a timestamp file to control generation,
as was previously done for the python bindings in commit
a7868e0131516ef2dece82586edd52dc87fe336c
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
.gitignore | 1 +
src/Makefile.am | 25 ++++++++++++++++++++-----
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore
index 46dbcdf..b4cbb5f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -93,6 +93,7 @@
/python/libvirt.py
/python/libvirt_qemu.py
/sc_*
+/src/.*.stamp
/src/esx/*.generated.*
/src/hyperv/*.generated.*
/src/libvirt*.def
diff --git a/src/Makefile.am b/src/Makefile.am
index a9f8d94..93fcf3b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -874,9 +874,17 @@ endif
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
-$(ESX_DRIVER_GENERATED): $(srcdir)/esx/esx_vi_generator.input \
+ESX_GENERATED_STAMP = .esx_vi_generator.stamp
+
+$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)
+
+$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
$(srcdir)/esx/esx_vi_generator.py
- $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py
+ $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
+ && touch $@
+
+MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)
+
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
@@ -892,9 +900,16 @@ endif
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)
-$(HYPERV_DRIVER_GENERATED): $(srcdir)/hyperv/hyperv_wmi_generator.input \
+HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp
+
+$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)
+
+$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
$(srcdir)/hyperv/hyperv_wmi_generator.py
- $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/hyperv/hyperv_wmi_generator.py
+ $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/hyperv/hyperv_wmi_generator.py \
+ && touch $@
+
+MAINTAINERCLEANFILES += $(HYPERV_DRIVER_GENERATED) $(HYPERV_GENERATED_STAMP)
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
@@ -1675,4 +1690,4 @@ endif
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
-MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED) $(ESX_DRIVER_GENERATED)
+MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)
--
1.7.10.4
12 years, 4 months
[libvirt] [PATCH libguestfs 0/4] Add a libvirt backend to libguestfs.
by Richard W.M. Jones
This preliminary patch series adds a libvirt backend to libguestfs.
It's for review only because although it launches the guest OK, there
are some missing features that need to be implemented.
The meat of the patch is in part 4/4.
To save you the trouble of interpreting libxml2 fragments, an example
of the generated XML and the corresponding qemu command line are
attached below. Note the hack required to work around lack of support
for '-drive [...]snapshot=on'
Some questions:
- I've tried to use the minimum set of XML possible to create the
guest, leaving libvirt to fill out as much as possible. How does
this XML look?
- The <name> is mandatory, and I generate one randomly. Is this a
good idea? I notice that my $HOME/.libvirt directory fills up with
random files. Really I'd like libvirt to generate a random name and
just deal with the logfiles.
- How do we query libvirt to find out if qemu supports virtio-scsi?
- Will <source file> work if the source is a host device?
- Since when has <memory unit> attribute been available? For example,
is it available in RHEL 6?
- I'm using type="kvm" and I've only tested this on baremetal, but I
don't want to force KVM. If only software emulation is available,
I'd like to use it.
- Is there an easy way to get -cpu host? Although I have the libvirt
capabilities, I'd prefer not to have to parse it if I can avoid
that, since libxml2 from C is so arcane.
Comments:
- <source mode> attribute is undocumented.
Rich.
----------------------------------------------------------------------
<?xml version="1.0"?>
<domain type="kvm" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
<name>1dhdpe3sb9ub2vxd</name>
<memory unit="MiB">500</memory>
<currentMemory unit="MiB">500</currentMemory>
<vcpu>1</vcpu>
<clock offset="utc"/>
<os>
<type>hvm</type>
<kernel>/home/rjones/d/libguestfs/.guestfs-500/kernel.3198</kernel>
<initrd>/home/rjones/d/libguestfs/.guestfs-500/initrd.3198</initrd>
<cmdline>panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=xterm </cmdline>
</os>
<devices>
<controller type="scsi" index="0" model="virtio-scsi"/>
<disk type="file" device="disk">
<source file="/home/rjones/d/libguestfs/test1.img"/>
<target dev="sda" bus="scsi"/>
<driver name="qemu" format="raw" cache="none"/>
<address type="drive" controller="0" bus="0" target="0" unit="0"/>
</disk>
<disk type="file" device="disk">
<source file="/home/rjones/d/libguestfs/.guestfs-500/root.3198"/>
<target dev="sdb" bus="scsi"/>
<driver name="qemu" format="raw" cache="unsafe"/>
<address type="drive" controller="0" bus="0" target="1" unit="0"/>
</disk>
<channel type="unix">
<source mode="bind" path="/home/rjones/d/libguestfs/libguestfsSSg3Kl/guestfsd.sock"/>
<target type="virtio" name="org.libguestfs.channel.0"/>
</channel>
</devices>
<qemu:commandline>
<qemu:arg value="-set"/>
<qemu:arg value="drive.drive-scsi0-0-1-0.snapshot=on"/>
</qemu:commandline>
</domain>
/usr/bin/qemu-kvm -S -M pc-1.1 -enable-kvm -m 500 -smp 1,sockets=1,cores=1,threads=1 -name 1dhdpe3sb9ub2vxd -uuid efcc8ab8-7193-da14-a72c-acbb82a1b975 -nographic -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/home/rjones/.libvirt/qemu/lib/1dhdpe3sb9ub2vxd.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -no-acpi -kernel /home/rjones/d/libguestfs/.guestfs-500/kernel.3198 -initrd /home/rjones/d/libguestfs/.guestfs-500/initrd.3198 -append panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=xterm -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 -drive file=/home/rjones/d/libguestfs/test1.img,if=none,id=drive-scsi0-0-0-0,format=raw,cache=none -device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=driv!
e-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 -drive file=/home/rjones/d/libguestfs/.guestfs-500/root.3198,if=none,id=drive-scsi0-0-1-0,format=raw,cache=unsafe -device scsi-disk,bus=scsi0.0,channel=0,scsi-id=1,lun=0,drive=drive-scsi0-0-1-0,id=scsi0-0-1-0 -chardev socket,id=charchannel0,path=/home/rjones/d/libguestfs/libguestfsSSg3Kl/guestfsd.sock,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.libguestfs.channel.0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -set drive.drive-scsi0-0-1-0.snapshot=on
12 years, 4 months
[libvirt] [PATCHv5 0/2] Implementation of virConnectListAllDomains() for esx and hyperv
by Peter Krempa
This is the rest of the virConnectListAllDomains() that is not yet merged. I've
rebased it to current upstream and bumped the version numbers.
Peter Krempa (2):
hyperv: Add implementation for virConnectListAllDomains()
esx: Add implementation for virConnectListAllDomains()
src/esx/esx_driver.c | 195 ++++++++++++++++++++++++++++++++++++++++++++
src/hyperv/hyperv_driver.c | 136 ++++++++++++++++++++++++++++++
2 files changed, 331 insertions(+), 0 deletions(-)
--
1.7.8.6
12 years, 4 months
[libvirt] [PATCH 00/23] Convert remaining areas of code to use virReportError
by Daniel P. Berrange
This converts all the remaining areas of libvirt code to use the
virReportError macro for reporting errors. As before this is a
mechanical change which should be a no-op.
cfg.mk | 25
daemon/libvirtd-config.c | 60 -
daemon/remote.c | 214 ++--
daemon/stream.c | 22
src/cpu/cpu.c | 86 -
src/cpu/cpu.h | 5
src/cpu/cpu_generic.c | 18
src/cpu/cpu_map.c | 22
src/cpu/cpu_x86.c | 132 +-
src/esx/esx_driver.c | 422 ++++----
src/esx/esx_private.h | 4
src/esx/esx_storage_driver.c | 100 +-
src/esx/esx_util.c | 74 -
src/esx/esx_vi.c | 626 ++++++------
src/esx/esx_vi.h | 7
src/esx/esx_vi_methods.c | 12
src/esx/esx_vi_types.c | 216 ++--
src/fdstream.c | 69 -
src/hyperv/hyperv_driver.c | 142 +-
src/hyperv/hyperv_private.h | 4
src/hyperv/hyperv_util.c | 10
src/hyperv/hyperv_wmi.c | 114 +-
src/libxl/libxl_conf.c | 42
src/libxl/libxl_conf.h | 4
src/libxl/libxl_driver.c | 614 ++++++------
src/locking/lock_driver_sanlock.c | 157 +--
src/locking/lock_manager.c | 30
src/network/bridge_driver.c | 344 +++----
src/nodeinfo.c | 104 +-
src/openvz/openvz_conf.c | 132 +-
src/openvz/openvz_conf.h | 4
src/openvz/openvz_driver.c | 282 ++---
src/openvz/openvz_util.c | 5
src/phyp/phyp_driver.c | 76 -
src/qemu/qemu_agent.c | 142 +-
src/qemu/qemu_capabilities.c | 16
src/qemu/qemu_cgroup.c | 26
src/qemu/qemu_command.c | 1066 +++++++++++-----------
src/qemu/qemu_conf.c | 26
src/qemu/qemu_conf.h | 4
src/qemu/qemu_domain.c | 94 -
src/qemu/qemu_driver.c | 1834 +++++++++++++++++++-------------------
src/qemu/qemu_hostdev.c | 59 -
src/qemu/qemu_hotplug.c | 362 +++----
src/qemu/qemu_migration.c | 284 ++---
src/qemu/qemu_monitor.c | 384 +++----
src/qemu/qemu_monitor_json.c | 546 +++++------
src/qemu/qemu_monitor_text.c | 532 +++++------
src/qemu/qemu_process.c | 216 ++--
src/remote/remote_driver.c | 310 +++---
src/rpc/gendispatch.pl | 24
src/security/security_apparmor.c | 94 -
src/security/security_driver.c | 8
src/security/security_manager.c | 50 -
src/security/security_manager.h | 5
src/security/security_selinux.c | 106 +-
src/test/test_driver.c | 509 +++++-----
src/uml/uml_conf.c | 24
src/uml/uml_conf.h | 5
src/uml/uml_driver.c | 108 +-
src/vbox/vbox_driver.c | 20
src/vbox/vbox_tmpl.c | 779 ++++++++--------
src/vmware/vmware_conf.c | 56 -
src/vmware/vmware_conf.h | 4
src/vmware/vmware_driver.c | 110 +-
src/vmx/vmx.c | 738 +++++++--------
src/xen/block_stats.c | 54 -
src/xen/xen_driver.c | 114 +-
src/xen/xen_hypervisor.c | 211 ++--
src/xen/xen_inotify.c | 48
src/xen/xend_internal.c | 461 ++++-----
src/xen/xm_internal.c | 134 +-
src/xen/xs_internal.c | 40
src/xenapi/xenapi_driver.c | 12
src/xenxs/xen_sxpr.c | 256 ++---
src/xenxs/xen_xm.c | 220 ++--
src/xenxs/xenxs_private.h | 4
77 files changed, 7063 insertions(+), 7210 deletions(-)
12 years, 4 months
[libvirt] [PATCHv2 0/6] Add usb controller model="none"
by Peter Krempa
This is a rebase of the previous version. There are no changes except solving
conflicts in tests/qemuxml2argvtest.c after new tests were added lately.
This series adds support for completely disabling USB bus for a host if a user
requires this. For this to work a new USB controller model "none" was added
that removes the USB bus.
The controller is added in patches 2-4. Patch 1 cleans up some nits (and is not
necessary) and patches 5 and 6 tweak qemuxml2argvtest and add tests to check the
new controller.
Peter Krempa (6):
maint: Clean up coding style
domain_conf: Add USB controler model "none"
domain_conf: Add helpers to verify if device configuration is valid
qemu: Add support for "none" USB controller
tests: Add support for catching domain XML parsing errors
tests: Add tests to check the new USB "none" controller
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 121 +++++-
src/conf/domain_conf.h | 6 +
src/libvirt_private.syms | 2 +
src/qemu/qemu_command.c | 29 +-
src/qemu/qemu_driver.c | 13 +-
.../qemuxml2argvdata/qemuxml2argv-usb-none-hub.xml | 19 +
.../qemuxml2argv-usb-none-other.xml | 19 +
.../qemuxml2argv-usb-none-usbtablet.xml | 21 +
tests/qemuxml2argvdata/qemuxml2argv-usb-none.args | 5 +
tests/qemuxml2argvdata/qemuxml2argv-usb-none.xml | 16 +
tests/qemuxml2argvtest.c | 515 ++++++++++----------
12 files changed, 495 insertions(+), 272 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-none-hub.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-none-other.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-none-usbtablet.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-none.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-none.xml
--
1.7.8.6
12 years, 4 months
[libvirt] [PATCH] Fix time keeping example for the guest clock
by Doug Goldstein
The time keeping example was missing quotes which resulted in an error
if you copied and pasted the example into a domain's XML. Additionally
the rest of the examples use single quotes (') instead of double quotes
(") so standardized that.
---
docs/formatdomain.html.in | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index b6e0d5d..b8db76e 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -983,11 +983,11 @@
<pre>
...
- <clock offset="localtime">
- <timer name="rtc" tickpolicy="catchup" track="guest">
- <catchup threshold=123 slew=120 limit=10000/>
+ <clock offset='localtime'>
+ <timer name='rtc' tickpolicy='catchup' track='guest'>
+ <catchup threshold='123' slew='120' limit='10000'/>
</timer>
- <timer name="pit" tickpolicy="delay"/>
+ <timer name='pit' tickpolicy='delay'/>
</clock>
...</pre>
--
1.7.8.6
12 years, 4 months
[libvirt] [PATCH] Fix test failure when no IPv6 is avail
by Doug Goldstein
When the system doesn't have IPv6 available (e.g. not built into the
kernel or the module isn't loaded), you can not create an IPv6 socket.
The test determines earlier on that IPv6 isn't available then goes and
creates a socket. This makes socket creation conditional on IPv6
availability.
---
tests/virnetsockettest.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 204113e..33c6fd4 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -90,11 +90,13 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6,
if ((s4 = socket(AF_INET, SOCK_STREAM, 0)) < 0)
goto cleanup;
- if ((s6 = socket(AF_INET6, SOCK_STREAM, 0)) < 0)
- goto cleanup;
+ if (*hasIPv6) {
+ if ((s6 = socket(AF_INET6, SOCK_STREAM, 0)) < 0)
+ goto cleanup;
- if (setsockopt(s6, IPPROTO_IPV6, IPV6_V6ONLY, &only, sizeof(only)) < 0)
- goto cleanup;
+ if (setsockopt(s6, IPPROTO_IPV6, IPV6_V6ONLY, &only, sizeof(only)) < 0)
+ goto cleanup;
+ }
memset(&in4, 0, sizeof(in4));
memset(&in6, 0, sizeof(in6));
@@ -114,13 +116,16 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6,
}
goto cleanup;
}
- if (bind(s6, (struct sockaddr *)&in6, sizeof(in6)) < 0) {
- if (errno == EADDRINUSE) {
- VIR_FORCE_CLOSE(s4);
- VIR_FORCE_CLOSE(s6);
- continue;
+
+ if (*hasIPv6) {
+ if (bind(s6, (struct sockaddr *)&in6, sizeof(in6)) < 0) {
+ if (errno == EADDRINUSE) {
+ VIR_FORCE_CLOSE(s4);
+ VIR_FORCE_CLOSE(s6);
+ continue;
+ }
+ goto cleanup;
}
- goto cleanup;
}
*freePort = BASE_PORT + i;
--
1.7.8.6
12 years, 4 months