diff options
author | Thomas Tai <thomas.tai@windriver.com> | 2013-06-28 13:26:01 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-06-28 14:08:23 -0400 |
commit | 422934f846ec908adcf7ef4d191338c851372dc8 (patch) | |
tree | 21720dee0aee0873ae6d615a230efd8c133c6791 | |
parent | c4432c79f96394f0a874436fc769f093c6f3bcd5 (diff) |
libvirt: fix libvirtd crash if path part of URI is missing
If the user forgets to include the path portion of the URI, instead of
receiving an error message, libvirtd crashes.
So for example attempting to make this call will cause libvirtd to
fall over.
virsh -c qemu+ssh://root@my.host.com list
(forgetting the trailing /system after the host name)
The reason for the crash is that libvirtd is trying to output an error
message with a uninitialized variable. This problem is already fixed
in the upstream so applying this fix to our tree allows this issue to
be avoided.
Signed-off-by: Thomas Tai <thomas.tai@windriver.com>
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r-- | recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch | 39 | ||||
-rw-r--r-- | recipes-extended/libvirt/libvirt_1.0.3.bb | 5 |
2 files changed, 42 insertions, 2 deletions
diff --git a/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch b/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch new file mode 100644 index 0000000..3cf9e83 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch @@ -0,0 +1,39 @@ +From 74bff2509080912ea8abf1de8fd95fa2412b659a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com> +Date: Thu, 11 Apr 2013 11:37:25 +0200 +Subject: [PATCH] qemu: fix crash in qemuOpen + +commit 74bff2509080912ea8abf1de8fd95fa2412b659a from upsteam +git://libvirt.org/libvirt.git + +If the path part of connection URI is not present, cfg is used +unitialized. + +https://bugzilla.redhat.com/show_bug.cgi?id=950855 +--- + src/qemu/qemu_driver.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 2c0d7d1..0d41e39 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -1026,6 +1026,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, + goto cleanup; + } + ++ cfg = virQEMUDriverGetConfig(qemu_driver); + if (conn->uri->path == NULL) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("no QEMU URI path given, try %s"), +@@ -1033,7 +1034,6 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, + goto cleanup; + } + +- cfg = virQEMUDriverGetConfig(qemu_driver); + if (cfg->privileged) { + if (STRNEQ(conn->uri->path, "/system") && + STRNEQ(conn->uri->path, "/session")) { +-- +1.7.1 + diff --git a/recipes-extended/libvirt/libvirt_1.0.3.bb b/recipes-extended/libvirt/libvirt_1.0.3.bb index 768ccc8..845baf5 100644 --- a/recipes-extended/libvirt/libvirt_1.0.3.bb +++ b/recipes-extended/libvirt/libvirt_1.0.3.bb @@ -3,7 +3,7 @@ HOMEPAGE = "http://libvirt.org" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=fb919cc88dbe06ec0b0bd50e001ccf1f" SECTION = "console/tools" -PR = "r6" +PR = "r7" DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \ iptables ebtables dnsmasq readline" @@ -25,7 +25,8 @@ RCONFLICTS_${PN}_libvirtd = "connman" SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz \ file://libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch \ file://libvirtd.sh \ - file://libvirtd.conf" + file://libvirtd.conf \ + file://qemu-fix-crash-in-qemuOpen.patch " SRC_URI[md5sum] = "3d9f85d586c9aa3d819b626622f3fc97" SRC_URI[sha256sum] = "f64f4acd7cdcfc6ab5e803195ed58b949f262b54e3659d8c37b33f0fec112757" |