[libvirt] [PATCH 0/4] Fix a pair of crashes in DNS XML parsing
by Ján Tomko
*** BLUAAARRRGHB HERE ***
Ján Tomko (4):
Set the number of elements to 0 in virNetwork*Clear
Don't check validity of missing attributes in DNS SRV XML
Remove double space in error messages
Remove redundant free in virNetworkDNSHostDefParseXML
src/conf/network_conf.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--
1.8.1.5
11 years, 4 months
[libvirt] [PATCH] conf:Fix a copy paste error
by Alex Jia
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 10cb7f6..0e74039 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5153,7 +5153,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
xmlStrEqual(cur->name, BAD_CAST "product")) {
product = (char *)xmlNodeGetContent(cur);
- if (strlen(vendor) > PRODUCT_LEN) {
+ if (strlen(product) > PRODUCT_LEN) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("disk product is more than 16 characters"));
goto error;
--
1.8.3.1
11 years, 4 months
[libvirt] [PATCH] formatdomain.html.in: Correctly use <code/> in #elementQoS
by Michal Privoznik
Interestingly, we had <code>floor<code> ... </code>outbound</code> which
results in much larger block of text to be written in code style that
intended.
---
docs/formatdomain.html.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 7601aaa..d2cee67 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3539,12 +3539,12 @@ qemu-kvm -net nic,model=? /dev/null
forward type of route, nat, or no forward at all). Moreover, the
virtual network the interface is connected to is required to have at least
inbound QoS set (<code>average</code> at least). Moreover, with
- <code>floor<code> attribute users don't need to specify
+ <code>floor</code> attribute users don't need to specify
<code>average</code>. However, <code>peak</code> and <code>burst</code>
attributes still require <code>average</code>. Currently, linux kernel
doesn't allow ingress qdiscs to have any classes therefore
<code>floor</code> can be applied only on <code>inbound</code> and not
- </code>outbound</code>. <span class="since">Since 1.0.1</span>
+ <code>outbound</code>. <span class="since">Since 1.0.1</span>
</p>
<h5><a name="elementVlanTag">Setting VLAN tag (on supported network types only)</a></h5>
--
1.8.1.5
11 years, 4 months
[libvirt] [PATCH] Fix virsh snapshot-list error reporting
by Jim Fehlig
Noticed that the expected "not supported" error is dropped when
invoking 'virsh snapshot-list dom' on a Xen installation running
the libxl driver
virsh snapshot-list test
error: Invalid snapshot: virDomainSnapshotFree
The error is overwritten by a call to virDomainSnapshotFree
in cleanup code within cmdSnapshotList. Prevent overwritting
the real error by not calling virDomainSnapshotFree with a NULL
virDomainSnapshotPtr.
---
This is one possible fix for the bug. The other would be to
silently return in virDomainSnapshotFree on a NULL
virDomainSnapshotPtr.
tools/virsh-snapshot.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index cfe8ee9..db9715b 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -1678,7 +1678,8 @@ cleanup:
vshSnapshotListFree(snaplist);
VIR_FREE(parent_snap);
VIR_FREE(state);
- virDomainSnapshotFree(start);
+ if (start)
+ virDomainSnapshotFree(start);
xmlXPathFreeContext(ctxt);
xmlFreeDoc(xml);
VIR_FREE(doc);
--
1.8.1.4
11 years, 4 months
[libvirt] [PATCH 0/7] backport of getGroupList to v0.10.2-maint
by Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=964358
Since it was on Fedora 18 that I first noticed the deadlock possible
when a child process calls getpwuid_r while the parent owned the
lock in a different thread, I'm interested in backporting my recent
work on virGetGroupList to v0.10.2-maint. However, I hit enough
conflict resolution that I'd like a review of my backport decisions
before pushing this to the stable branch.
Daniel P. Berrange (1):
Fix potential deadlock across fork() in QEMU driver
Eric Blake (6):
util: improve user lookup helper
util: add virGetGroupList
util: make virSetUIDGID async-signal-safe
security: framework for driver PreFork handler
security_dac: compute supplemental groups before fork
security: fix deadlock with prefork
configure.ac | 6 +-
src/libvirt_private.syms | 3 +
src/lxc/lxc_container.c | 2 +-
src/qemu/qemu_process.c | 8 ++
src/security/security_dac.c | 56 ++++++++--
src/security/security_driver.h | 4 +
src/security/security_manager.c | 30 +++++
src/security/security_manager.h | 3 +
src/security/security_stack.c | 28 +++++
src/storage/storage_backend.c | 16 ++-
src/util/util.c | 237 ++++++++++++++++++++++++----------------
src/util/util.h | 4 +-
12 files changed, 285 insertions(+), 112 deletions(-)
--
1.8.3.1
11 years, 4 months
[libvirt] [PATCH 0/5] Fix detecting cgroups at libvirtd restart with QEMU
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The recent refactoring of cgroups broke the ability to detect
cgroups for running guests in the QEMU driver during libvirtd
startup. This was due to it not considering the existance of
the 'emulator' child group, as well as not honouring the
'cgroups_controllers' setting when it was present
Daniel P. Berrange (5):
Introduce a more convenient virCgroupNewDetectMachine
Make virCgroupIsValidMachine static
Fix detection of 'emulator' cgroup
Add 'controllers' arg to virCgroupNewDetect
Skip detecting placement if controller is disabled
src/libvirt_private.syms | 2 +-
src/lxc/lxc_process.c | 20 +++++++---------
src/qemu/qemu_cgroup.c | 17 ++++----------
src/util/vircgroup.c | 60 +++++++++++++++++++++++++++++++++++++++++-------
src/util/vircgroup.h | 12 ++++++----
5 files changed, 73 insertions(+), 38 deletions(-)
--
1.8.1.4
11 years, 4 months
[libvirt] Cannot compile libvirt
by Abhishek Sharma
Hi,
I am new to libvirt and I am trying to compile libvirt from the git
repository. I mainly plan to use it for managing ESX server. However I get
the following error during make.
*"libvirt undefined reference to virNetTLSInit"*
Here are the steps which I took.
1. Get the code. git clone git://libvirt.org/libvirt.git
2. Run autogen
./autogen.sh --without-xen --with-esx --without-numactl --without-remote
--without-libvirtd --without-one --without-openvz --without-qemu
--without-uml --without-phyp --without-vbox --without-lxc --without-one
--without-test --without-network --without-selinux --with-python
3. make
Looks like the following commit somehow separated the gnutls symbols.
*commit 83d7e4e4607a96b6959a6b0afd44a10a783fd928
Author: Daniel P. Berrange <berrange(a)redhat.com>
Date: Wed Mar 13 13:37:29 2013 +0000
Use separate symbol file for GNUTLS symbols*
How can I successfully compile libvirt ?
Thanks,
Abhishek
11 years, 4 months
[libvirt] [PATCH] virdbustest: Don't pass number of arguments as long long
by Guido Günther
since sizeof(size_t) != sizeof(long long) on 32bit archs.
This unbreaks virdbustest which otherwise fails like:
(gdb) bt
#0 __strlen_sse2_bsf () at ../sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S:50
#1 0x405907d2 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#2 0x4057c140 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#3 0x4057e7ec in dbus_message_iter_append_basic () from /lib/i386-linux-gnu/libdbus-1.so.3
#4 0x400742ec in virDBusMessageIterEncode (args=0xbfd4b8f0 "k\321\004\b.", types=0x804d260 "",
rootiter=0xbfd4b844) at util/virdbus.c:560
#5 virDBusMessageEncodeArgs (msg=msg@entry=0x893c278, types=types@entry=0x804d25c "sais",
args=args@entry=0xbfd4b8d8 "r\320\004\b\003") at util/virdbus.c:921
#6 0x40075917 in virDBusMessageEncode (msg=0x893c278, types=0x804d25c "sais") at util/virdbus.c:959
#7 0x0804a4a1 in testMessageArray (args=0x0) at virdbustest.c:195
#8 0x0804c404 in virtTestRun (title=title@entry=0x804cfcb "Test message array ",
nloops=nloops@entry=1, body=body@entry=0x804a3f0 <testMessageArray>, data=data@entry=0x0)
at testutils.c:168
#9 0x08049346 in mymain () at virdbustest.c:384
#10 0x0804cb2e in virtTestMain (argc=argc@entry=1, argv=argv@entry=0xbfd4bb24,
func=func@entry=0x80492c0 <mymain>) at testutils.c:764
#11 0x080491af in main (argc=1, argv=0xbfd4bb24) at virdbustest.c:393
---
tests/virdbustest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/virdbustest.c b/tests/virdbustest.c
index e054716..ac57422 100644
--- a/tests/virdbustest.c
+++ b/tests/virdbustest.c
@@ -195,7 +195,7 @@ static int testMessageArray(const void *args ATTRIBUTE_UNUSED)
if (virDBusMessageEncode(msg,
"sais",
in_str1,
- (long long)3, in_int32a, in_int32b, in_int32c,
+ (size_t)3, in_int32a, in_int32b, in_int32c,
in_str2) < 0) {
VIR_DEBUG("Failed to encode arguments");
goto cleanup;
--
1.8.3.2
11 years, 4 months
[libvirt] [PATCH] tests: PCI controller checks
by Ján Tomko
Check if PCI bridges with duplicate indexes are rejected.
PCI root controllers with non-zero indexes or addresses should
also be rejected.
---
.../qemuxml2argv-pci-bridge-duplicate-index.xml | 16 ++++++++++++++++
tests/qemuxml2argvdata/qemuxml2argv-pci-root-address.xml | 16 ++++++++++++++++
.../qemuxml2argv-pci-root-nonzero-index.xml | 14 ++++++++++++++
tests/qemuxml2argvtest.c | 6 ++++++
4 files changed, 52 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-bridge-duplicate-index.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-root-address.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-root-nonzero-index.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge-duplicate-index.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge-duplicate-index.xml
new file mode 100644
index 0000000..0aea45d
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge-duplicate-index.xml
@@ -0,0 +1,16 @@
+<domain type='qemu'>
+ <name>fdr-br</name>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-1.2'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='pci' index='1' model='pci-bridge'/>
+ <controller type='pci' index='1' model='pci-bridge'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-root-address.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-root-address.xml
new file mode 100644
index 0000000..7b43246
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-root-address.xml
@@ -0,0 +1,16 @@
+<domain type='qemu'>
+ <name>fdr-br</name>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-1.2'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <controller type='pci' index='0' model='pci-root'>
+ <address type='pci' domain='0' bus='0' slot='0' function='0'/>
+ </controller>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-root-nonzero-index.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-root-nonzero-index.xml
new file mode 100644
index 0000000..1a21d3b
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-root-nonzero-index.xml
@@ -0,0 +1,14 @@
+<domain type='qemu'>
+ <name>fdr-br</name>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static' cpuset='0-1'>2</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-1.2'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <controller type='pci' index='7' model='pci-root'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 0f96eef..75f1c4a 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1018,6 +1018,12 @@ mymain(void)
DO_TEST_PARSE_ERROR("pci-bridge-negative-index-invalid",
QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE);
+ DO_TEST_PARSE_ERROR("pci-bridge-duplicate-index",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE);
+ DO_TEST_PARSE_ERROR("pci-root-nonzero-index",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE);
+ DO_TEST_PARSE_ERROR("pci-root-address",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE);
virObjectUnref(driver.config);
virObjectUnref(driver.caps);
--
1.8.1.5
11 years, 4 months
[libvirt] [PATCH v2] Don't overwrite errors in qemuTranslateDiskSourcePool
by Ján Tomko
Both virStoragePoolFree and virStorageVolFree reset the last error,
which might lead to the cryptic message:
An error occurred, but the cause is unknown
When the volume wasn't found, virStorageVolFree was called with NULL,
leading to an error:
invalid storage volume pointer in virStorageVolFree
This patch changes it to:
Storage volume not found: no storage vol with matching name 'tomato'
---
v1: https://www.redhat.com/archives/libvir-list/2013-July/msg01522.html
v2: only save/restore the error when ret < 0
src/qemu/qemu_conf.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 3e7b78a..18e926c 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1248,6 +1248,7 @@ qemuTranslateDiskSourcePool(virConnectPtr conn,
char *poolxml = NULL;
virStorageVolInfo info;
int ret = -1;
+ virErrorPtr savedError = NULL;
if (def->type != VIR_DOMAIN_DISK_TYPE_VOLUME)
return 0;
@@ -1324,8 +1325,17 @@ qemuTranslateDiskSourcePool(virConnectPtr conn,
def->srcpool->voltype = info.type;
ret = 0;
cleanup:
- virStoragePoolFree(pool);
- virStorageVolFree(vol);
+ if (ret < 0)
+ savedError = virSaveLastError();
+ if (pool)
+ virStoragePoolFree(pool);
+ if (vol)
+ virStorageVolFree(vol);
+ if (savedError) {
+ virSetError(savedError);
+ virFreeError(savedError);
+ }
+
VIR_FREE(poolxml);
virStoragePoolDefFree(pooldef);
return ret;
--
1.8.1.5
11 years, 4 months