Fix freeing of uninitialized pointer

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=31
This commit is contained in:
James Fehlig 2010-01-07 01:07:13 +00:00 committed by Git OBS Bridge
parent d9104d8657
commit 7d0d7ba181
3 changed files with 43 additions and 45 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jan 6 18:02:00 MST 2010 - jfehlig@novell.com
- Fix freeing of uninitialized pointer when using HAL in
node device driver
node-dev-free.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jan 4 14:14:41 MST 2010 - jfehlig@novell.com Mon Jan 4 14:14:41 MST 2010 - jfehlig@novell.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package libvirt (Version 0.7.5) # spec file for package libvirt (Version 0.7.5)
# #
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -141,6 +141,7 @@ Source1: libvirtd.init
# Upstream patches # Upstream patches
Patch0: detach-disk.patch Patch0: detach-disk.patch
Patch1: xen-shr-pages.patch Patch1: xen-shr-pages.patch
Patch2: node-dev-free.patch
# Need to go upstream # Need to go upstream
Patch100: socat.patch Patch100: socat.patch
Patch101: clone.patch Patch101: clone.patch
@ -153,13 +154,12 @@ Patch202: snapshots.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
Libvirt is a C toolkit to interract with the virtualization Libvirt is a C toolkit to interact with the virtualization
capabilities Linux. Virtualization of the Linux Operating System means capabilities of Linux. Virtualization of the Linux Operating System means
the ability to run multiple instances of Operating Systems concurently the ability to run multiple instances of Operating Systems concurrently
on a single hardware system where the basic resources are driven by a on a single hardware system where the basic resources are driven by a
Linux instance. The library aims to provide long term stable C API Linux instance. The library aims to provide long term stable C API
initially for the Xen paravirtualization but should be able to to interact with Linux virtualization technologies.
integrate other virtualization mechanisms if needed.
@ -181,8 +181,10 @@ Requires: cyrus-sasl
Recommends: cyrus-sasl-digestmd5 Recommends: cyrus-sasl-digestmd5
%description client %description client
Shared libraries and client binaries needed to access to the Libvirt is a C toolkit to interract with the virtualization
virtualization capabilities of recent versions of Linux (and other OSes). capabilities of Linux. The libvirt-client package contains shared
libraries and client binaries needed to access the virtualization
capabilities of recent versions of Linux (and other OSes).
@ -203,12 +205,8 @@ Requires: pkg-config
%description devel %description devel
Libvirt is a C toolkit to interract with the virtualization Libvirt is a C toolkit to interract with the virtualization
capabilities Linux. Virtualization of the Linux Operating System means capabilities of Linux. The libvirt-devel package contains headers
the ability to run multiple instances of Operating Systems concurently and libraries needed for developing libvirt applications.
on a single hardware system where the basic resources are driven by a
Linux instance. The library aims to provide long term stable C API
initially for the Xen paravirtualization but should be able to
integrate other virtualization mechanisms if needed.
@ -225,12 +223,8 @@ Requires: %{name} = %{version}
%description doc %description doc
Libvirt is a C toolkit to interract with the virtualization Libvirt is a C toolkit to interract with the virtualization
capabilities Linux. Virtualization of the Linux Operating System means capabilities of Linux. The libvirt-doc packages contains documentation
the ability to run multiple instances of Operating Systems concurently for the libvirt API and tools.
on a single hardware system where the basic resources are driven by a
Linux instance. The library aims to provide long term stable C API
initially for the Xen paravirtualization but should be able to
integrate other virtualization mechanisms if needed.
@ -248,12 +242,8 @@ Requires: %{name} = %{version}
%description python %description python
Libvirt is a C toolkit to interract with the virtualization Libvirt is a C toolkit to interract with the virtualization
capabilities Linux. Virtualization of the Linux Operating System means capabilities of Linux. The libvirt-python package provides python
the ability to run multiple instances of Operating Systems concurently bindings for the libvirt C API.
on a single hardware system where the basic resources are driven by a
Linux instance. The library aims to provide long term stable C API
initially for the Xen paravirtualization but should be able to
integrate other virtualization mechanisms if needed.
@ -266,6 +256,7 @@ Authors:
%setup -q %setup -q
%patch0 -p1 %patch0 -p1
%patch1 -p1 %patch1 -p1
%patch2 -p1
%patch100 -p1 %patch100 -p1
%patch101 %patch101
%patch102 -p1 %patch102 -p1

View File

@ -1,7 +1,7 @@
Index: libvirt-0.7.4/src/xen/xen_hypervisor.c Index: libvirt-0.7.5/src/xen/xen_hypervisor.c
=================================================================== ===================================================================
--- libvirt-0.7.4.orig/src/xen/xen_hypervisor.c --- libvirt-0.7.5.orig/src/xen/xen_hypervisor.c
+++ libvirt-0.7.4/src/xen/xen_hypervisor.c +++ libvirt-0.7.5/src/xen/xen_hypervisor.c
@@ -215,10 +215,26 @@ struct xen_v2d5_getdomaininfo { @@ -215,10 +215,26 @@ struct xen_v2d5_getdomaininfo {
}; };
typedef struct xen_v2d5_getdomaininfo xen_v2d5_getdomaininfo; typedef struct xen_v2d5_getdomaininfo xen_v2d5_getdomaininfo;
@ -44,7 +44,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- (VIR_ALLOC_N(domlist.v2, (size)) == 0) : \ - (VIR_ALLOC_N(domlist.v2, (size)) == 0) : \
- (VIR_ALLOC_N(domlist.v2d5, (size)) == 0))) - (VIR_ALLOC_N(domlist.v2d5, (size)) == 0)))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ (VIR_ALLOC_N(domlist.v2d6, (size)) == 0) : \ + (VIR_ALLOC_N(domlist.v2d6, (size)) == 0) : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ (VIR_ALLOC_N(domlist.v2d5, (size)) == 0) : \ + (VIR_ALLOC_N(domlist.v2d5, (size)) == 0) : \
@ -56,7 +56,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- VIR_FREE(domlist.v2) : \ - VIR_FREE(domlist.v2) : \
- VIR_FREE(domlist.v2d5))) - VIR_FREE(domlist.v2d5)))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ VIR_FREE(domlist.v2d6) : \ + VIR_FREE(domlist.v2d6) : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ VIR_FREE(domlist.v2d5) : \ + VIR_FREE(domlist.v2d5) : \
@ -68,7 +68,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- memset(domlist.v2, 0, sizeof(*domlist.v2) * size) : \ - memset(domlist.v2, 0, sizeof(*domlist.v2) * size) : \
- memset(domlist.v2d5, 0, sizeof(*domlist.v2d5) * size))) - memset(domlist.v2d5, 0, sizeof(*domlist.v2d5) * size)))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ memset(domlist.v2d6, 0, sizeof(*domlist.v2d6) * size) : \ + memset(domlist.v2d6, 0, sizeof(*domlist.v2d6) * size) : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ memset(domlist.v2d5, 0, sizeof(*domlist.v2d5) * size) : \ + memset(domlist.v2d5, 0, sizeof(*domlist.v2d5) * size) : \
@ -80,7 +80,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- domlist.v2[n].domain : \ - domlist.v2[n].domain : \
- domlist.v2d5[n].domain)) - domlist.v2d5[n].domain))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ domlist.v2d6[n].domain : \ + domlist.v2d6[n].domain : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ domlist.v2d5[n].domain : \ + domlist.v2d5[n].domain : \
@ -92,7 +92,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- domlist.v2[n].handle : \ - domlist.v2[n].handle : \
- domlist.v2d5[n].handle)) - domlist.v2d5[n].handle))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ domlist.v2d6[n].handle : \ + domlist.v2d6[n].handle : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ domlist.v2d5[n].handle : \ + domlist.v2d5[n].handle : \
@ -104,7 +104,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- (void*)(domlist->v2) : \ - (void*)(domlist->v2) : \
- (void*)(domlist->v2d5))) - (void*)(domlist->v2d5)))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ (void*)(domlist->v2d6) : \ + (void*)(domlist->v2d6) : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ (void*)(domlist->v2d5) : \ + (void*)(domlist->v2d5) : \
@ -116,7 +116,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- sizeof(xen_v2_getdomaininfo) : \ - sizeof(xen_v2_getdomaininfo) : \
- sizeof(xen_v2d5_getdomaininfo))) - sizeof(xen_v2d5_getdomaininfo)))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ sizeof(xen_v2d6_getdomaininfo) : \ + sizeof(xen_v2d6_getdomaininfo) : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ sizeof(xen_v2d5_getdomaininfo) : \ + sizeof(xen_v2d5_getdomaininfo) : \
@ -128,7 +128,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- memset(&(dominfo.v2), 0, sizeof(xen_v2_getdomaininfo)) : \ - memset(&(dominfo.v2), 0, sizeof(xen_v2_getdomaininfo)) : \
- memset(&(dominfo.v2d5), 0, sizeof(xen_v2d5_getdomaininfo)))) - memset(&(dominfo.v2d5), 0, sizeof(xen_v2d5_getdomaininfo))))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ memset(&(dominfo.v2d6), 0, sizeof(xen_v2d6_getdomaininfo)) : \ + memset(&(dominfo.v2d6), 0, sizeof(xen_v2d6_getdomaininfo)) : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ memset(&(dominfo.v2d5), 0, sizeof(xen_v2d5_getdomaininfo)) : \ + memset(&(dominfo.v2d5), 0, sizeof(xen_v2d5_getdomaininfo)) : \
@ -140,7 +140,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- dominfo.v2.domain : \ - dominfo.v2.domain : \
- dominfo.v2d5.domain)) - dominfo.v2d5.domain))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ dominfo.v2d6.domain : \ + dominfo.v2d6.domain : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ dominfo.v2d5.domain : \ + dominfo.v2d5.domain : \
@ -152,7 +152,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- dominfo.v2.cpu_time : \ - dominfo.v2.cpu_time : \
- dominfo.v2d5.cpu_time)) - dominfo.v2d5.cpu_time))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ dominfo.v2d6.cpu_time : \ + dominfo.v2d6.cpu_time : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ dominfo.v2d5.cpu_time : \ + dominfo.v2d5.cpu_time : \
@ -165,7 +165,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- dominfo.v2.nr_online_vcpus : \ - dominfo.v2.nr_online_vcpus : \
- dominfo.v2d5.nr_online_vcpus)) - dominfo.v2d5.nr_online_vcpus))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ dominfo.v2d6.nr_online_vcpus : \ + dominfo.v2d6.nr_online_vcpus : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ dominfo.v2d5.nr_online_vcpus : \ + dominfo.v2d5.nr_online_vcpus : \
@ -177,7 +177,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- dominfo.v2.max_vcpu_id : \ - dominfo.v2.max_vcpu_id : \
- dominfo.v2d5.max_vcpu_id)) - dominfo.v2d5.max_vcpu_id))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ dominfo.v2d6.max_vcpu_id : \ + dominfo.v2d6.max_vcpu_id : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ dominfo.v2d5.max_vcpu_id : \ + dominfo.v2d5.max_vcpu_id : \
@ -189,7 +189,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- dominfo.v2.flags : \ - dominfo.v2.flags : \
- dominfo.v2d5.flags)) - dominfo.v2d5.flags))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ dominfo.v2d6.flags : \ + dominfo.v2d6.flags : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ dominfo.v2d5.flags : \ + dominfo.v2d5.flags : \
@ -201,7 +201,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- dominfo.v2.tot_pages : \ - dominfo.v2.tot_pages : \
- dominfo.v2d5.tot_pages)) - dominfo.v2d5.tot_pages))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ dominfo.v2d6.tot_pages : \ + dominfo.v2d6.tot_pages : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ dominfo.v2d5.tot_pages : \ + dominfo.v2d5.tot_pages : \
@ -213,7 +213,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- dominfo.v2.max_pages : \ - dominfo.v2.max_pages : \
- dominfo.v2d5.max_pages)) - dominfo.v2d5.max_pages))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ dominfo.v2d6.max_pages : \ + dominfo.v2d6.max_pages : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ dominfo.v2d5.max_pages : \ + dominfo.v2d5.max_pages : \
@ -225,7 +225,7 @@ Index: libvirt-0.7.4/src/xen/xen_hypervisor.c
- (dom_interface_version < 5 ? \ - (dom_interface_version < 5 ? \
- dominfo.v2.handle : \ - dominfo.v2.handle : \
- dominfo.v2d5.handle)) - dominfo.v2d5.handle))
+ (dom_interface_version == 6 ? \ + (dom_interface_version >= 6 ? \
+ dominfo.v2d6.handle : \ + dominfo.v2d6.handle : \
+ (dom_interface_version == 5 ? \ + (dom_interface_version == 5 ? \
+ dominfo.v2d5.handle : \ + dominfo.v2d5.handle : \