From 82df7d10ec7dde4544fac16d989477c00e5a310956dd65e2812f53e597a5bfd1 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Tue, 13 Oct 2009 04:56:00 +0000 Subject: [PATCH] Build phyp driver, fate#307096 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=14 --- libvirt.changes | 8 +++++++ libvirt.spec | 10 +++++++++ msg-proc-memleak.patch | 48 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 msg-proc-memleak.patch diff --git a/libvirt.changes b/libvirt.changes index f43dbec..e2e6164 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Oct 12 22:39:42 MDT 2009 - jfehlig@novell.com + +- Build phyp driver ifarch ppc64 + fate#307096 +- Fix memory leaks in libvirtd's message processing + msg-proc-memleak.patch + ------------------------------------------------------------------- Tue Sep 29 08:34:28 MDT 2009 - jfehlig@novell.com diff --git a/libvirt.spec b/libvirt.spec index c108622..ae667ac 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -20,6 +20,7 @@ %define with_xen 1 %define with_lxc 0 %define with_selinux 0 +%define with_phyp 0 # Xen is available only on i386 x86_64 %ifnarch %ix86 x86_64 %define with_xen 0 @@ -28,6 +29,10 @@ %define with_lxc 1 %define with_selinux 1 %endif +# Build phyp backend for IBM Power systems +%ifarch ppc64 +%define with_phyp 1 +%endif Name: libvirt BuildRequires: bridge-utils cyrus-sasl-devel device-mapper-devel fdupes gettext gnutls-devel hal-devel iptables-devel libxml2-devel lvm2 ncurses-devel parted-devel pkg-config python-devel readline-devel util-linux xhtml-dtd @@ -50,6 +55,9 @@ BuildRequires: polkit >= 0.9 %else BuildRequires: PolicyKit-devel >= 0.6 %endif +%if %{with_phyp} +BuildRequires: libssh2-devel +%endif # Only for directory ownership: BuildRequires: gtk-doc Url: http://libvirt.org/ @@ -86,6 +94,7 @@ Source1: libvirtd.init Patch0: devmap-no-pkgconfig.patch Patch1: xen-refcnt.patch Patch2: vshdeinit-recurse.patch +Patch3: msg-proc-memleak.patch # Need to go upstream Patch100: socat.patch Patch101: clone.patch @@ -190,6 +199,7 @@ Authors: %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %patch100 -p1 %patch101 %patch102 -p1 diff --git a/msg-proc-memleak.patch b/msg-proc-memleak.patch new file mode 100644 index 0000000..cd40f75 --- /dev/null +++ b/msg-proc-memleak.patch @@ -0,0 +1,48 @@ +Index: libvirt-0.7.1/qemud/dispatch.c +=================================================================== +--- libvirt-0.7.1.orig/qemud/dispatch.c ++++ libvirt-0.7.1/qemud/dispatch.c +@@ -191,6 +191,7 @@ remoteSerializeError(struct qemud_client + + xdr_error: + xdr_destroy(&xdr); ++ VIR_FREE(msg); + fatal_error: + xdr_free((xdrproc_t)xdr_remote_error, (char *)rerr); + return -1; +@@ -336,6 +337,7 @@ remoteDispatchClientRequest (struct qemu + struct qemud_client *client, + struct qemud_client_message *msg) + { ++ int ret; + remote_error rerr; + + memset(&rerr, 0, sizeof rerr); +@@ -364,7 +366,12 @@ remoteDispatchClientRequest (struct qemu + } + + error: +- return remoteSerializeReplyError(client, &rerr, &msg->hdr); ++ ret = remoteSerializeReplyError(client, &rerr, &msg->hdr); ++ ++ if (ret >= 0) ++ VIR_FREE(msg); ++ ++ return ret; + } + + +@@ -521,8 +528,12 @@ remoteDispatchClientCall (struct qemud_s + rpc_error: + /* Semi-bad stuff happened, we can still try to send back + * an RPC error message to client */ +- return remoteSerializeReplyError(client, &rerr, &msg->hdr); ++ rv = remoteSerializeReplyError(client, &rerr, &msg->hdr); ++ ++ if (rv >= 0) ++ VIR_FREE(msg); + ++ return rv; + + xdr_error: + /* Seriously bad stuff happened, so we'll kill off this client