From 5011d5533b41aa516f60d9623338a18c3ea17af523bb72bb5b13f8d599c8f251 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Thu, 24 Mar 2011 16:24:14 +0000 Subject: [PATCH 01/12] Updating link to change in openSUSE:Factory/libvirt revision 75.0 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=1fcf7f9c7f3d4deca6a8cd28eeb67305 --- libvirt.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt.spec b/libvirt.spec index 5d38e3c..eab9db0 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -145,7 +145,7 @@ License: LGPLv2.1+ Group: Development/Libraries/C and C++ AutoReqProv: yes Version: 0.8.8 -Release: 2 +Release: 3 Summary: A C toolkit to interract with the virtualization capabilities of Linux # The client side, i.e. shared libs and virsh are in a subpackage Requires: %{name}-client = %{version}-%{release} From 1a8e4d63094001220322edb3f625020f09d9d6fda1f39b7043e5e6ed97c65047 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Thu, 31 Mar 2011 20:22:32 +0000 Subject: [PATCH 02/12] libvirt 0.9.0rc3 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=108 --- 71753cb7-CVE-2011-1146.patch | 93 ----------- clone.patch | 12 +- efc2594b-boot-param.patch | 27 --- libvirt-0.8.8.tar.bz2 | 3 - libvirt-0.9.0.tar.bz2 | 3 + libvirt.changes | 5 + libvirt.spec | 20 +-- libvirtd-defaults.patch | 16 +- use-libvirt-guests-on-suse.patch | 42 ++--- xen-domctl-ver7.patch | 272 ------------------------------- xen-name-for-devid.patch | 20 +-- xen-pv-cdrom.patch | 22 +-- xend-disk-order.patch | 11 +- 13 files changed, 77 insertions(+), 469 deletions(-) delete mode 100644 71753cb7-CVE-2011-1146.patch delete mode 100644 efc2594b-boot-param.patch delete mode 100644 libvirt-0.8.8.tar.bz2 create mode 100644 libvirt-0.9.0.tar.bz2 delete mode 100644 xen-domctl-ver7.patch diff --git a/71753cb7-CVE-2011-1146.patch b/71753cb7-CVE-2011-1146.patch deleted file mode 100644 index e3010c6..0000000 --- a/71753cb7-CVE-2011-1146.patch +++ /dev/null @@ -1,93 +0,0 @@ -commit 71753cb7f7a16ff800381c0b5ee4e99eea92fed3 -Author: Guido Günther -Date: Mon Mar 14 10:56:28 2011 +0800 - - Add missing checks for read only connections - - As pointed on CVE-2011-1146, some API forgot to check the read-only - status of the connection for entry point which modify the state - of the system or may lead to a remote execution using user data. - The entry points concerned are: - - virConnectDomainXMLToNative - - virNodeDeviceDettach - - virNodeDeviceReAttach - - virNodeDeviceReset - - virDomainRevertToSnapshot - - virDomainSnapshotDelete - - * src/libvirt.c: fix the above set of entry points to error on read-only - connections - -Index: libvirt-0.8.8/src/libvirt.c -=================================================================== ---- libvirt-0.8.8.orig/src/libvirt.c -+++ libvirt-0.8.8/src/libvirt.c -@@ -3152,6 +3152,10 @@ char *virConnectDomainXMLToNative(virCon - virDispatchError(NULL); - return NULL; - } -+ if (conn->flags & VIR_CONNECT_RO) { -+ virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__); -+ goto error; -+ } - - if (nativeFormat == NULL || domainXml == NULL) { - virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__); -@@ -9579,6 +9583,11 @@ virNodeDeviceDettach(virNodeDevicePtr de - return -1; - } - -+ if (dev->conn->flags & VIR_CONNECT_RO) { -+ virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__); -+ goto error; -+ } -+ - if (dev->conn->driver->nodeDeviceDettach) { - int ret; - ret = dev->conn->driver->nodeDeviceDettach (dev); -@@ -9622,6 +9631,11 @@ virNodeDeviceReAttach(virNodeDevicePtr d - return -1; - } - -+ if (dev->conn->flags & VIR_CONNECT_RO) { -+ virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__); -+ goto error; -+ } -+ - if (dev->conn->driver->nodeDeviceReAttach) { - int ret; - ret = dev->conn->driver->nodeDeviceReAttach (dev); -@@ -9667,6 +9681,11 @@ virNodeDeviceReset(virNodeDevicePtr dev) - return -1; - } - -+ if (dev->conn->flags & VIR_CONNECT_RO) { -+ virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__); -+ goto error; -+ } -+ - if (dev->conn->driver->nodeDeviceReset) { - int ret; - ret = dev->conn->driver->nodeDeviceReset (dev); -@@ -12962,6 +12981,10 @@ virDomainRevertToSnapshot(virDomainSnaps - } - - conn = snapshot->domain->conn; -+ if (conn->flags & VIR_CONNECT_RO) { -+ virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__); -+ goto error; -+ } - - if (conn->driver->domainRevertToSnapshot) { - int ret = conn->driver->domainRevertToSnapshot(snapshot, flags); -@@ -13008,6 +13031,10 @@ virDomainSnapshotDelete(virDomainSnapsho - } - - conn = snapshot->domain->conn; -+ if (conn->flags & VIR_CONNECT_RO) { -+ virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__); -+ goto error; -+ } - - if (conn->driver->domainSnapshotDelete) { - int ret = conn->driver->domainSnapshotDelete(snapshot, flags); diff --git a/clone.patch b/clone.patch index 71365c4..20c19d8 100644 --- a/clone.patch +++ b/clone.patch @@ -2,7 +2,7 @@ Index: src/lxc/lxc_container.c =================================================================== --- src/lxc/lxc_container.c.orig +++ src/lxc/lxc_container.c -@@ -845,6 +845,9 @@ int lxcContainerStart(virDomainDefPtr de +@@ -883,6 +883,9 @@ int lxcContainerStart(virDomainDefPtr de lxc_child_argv_t args = { def, nveths, veths, control, ttyPath }; /* allocate a stack for the container */ @@ -12,7 +12,7 @@ Index: src/lxc/lxc_container.c if (VIR_ALLOC_N(stack, stacksize) < 0) { virReportOOMError(); return -1; -@@ -863,7 +866,11 @@ int lxcContainerStart(virDomainDefPtr de +@@ -901,7 +904,11 @@ int lxcContainerStart(virDomainDefPtr de flags |= CLONE_NEWNET; } @@ -22,9 +22,9 @@ Index: src/lxc/lxc_container.c pid = clone(lxcContainerChild, stacktop, flags, &args); +#endif VIR_FREE(stack); - DEBUG("clone() completed, new container PID is %d", pid); + VIR_DEBUG("clone() completed, new container PID is %d", pid); -@@ -889,6 +896,7 @@ int lxcContainerAvailable(int features) +@@ -927,6 +934,7 @@ int lxcContainerAvailable(int features) char *childStack; char *stack; int childStatus; @@ -32,7 +32,7 @@ Index: src/lxc/lxc_container.c if (features & LXC_CONTAINER_FEATURE_USER) flags |= CLONE_NEWUSER; -@@ -896,14 +904,21 @@ int lxcContainerAvailable(int features) +@@ -934,14 +942,21 @@ int lxcContainerAvailable(int features) if (features & LXC_CONTAINER_FEATURE_NET) flags |= CLONE_NEWNET; @@ -41,7 +41,7 @@ Index: src/lxc/lxc_container.c + stacksize *= 2; +#endif + if (VIR_ALLOC_N(stack, stacksize) < 0) { - DEBUG0("Unable to allocate stack"); + VIR_DEBUG0("Unable to allocate stack"); return -1; } diff --git a/efc2594b-boot-param.patch b/efc2594b-boot-param.patch deleted file mode 100644 index 2644da0..0000000 --- a/efc2594b-boot-param.patch +++ /dev/null @@ -1,27 +0,0 @@ -commit efc2594b4e0cbcdd6947fafeeed41accd5b611e0 -Author: Jim Fehlig -Date: Thu Feb 17 14:22:55 2011 -0700 - - Do not add drive 'boot=on' param when a kernel is specified - - libvirt-tck was failing several domain tests [1] with qemu 0.14, which - is now less tolerable of specifying 2 bootroms with the same boot index [2]. - - Drop the 'boot=on' param if kernel has been specfied. - - [1] https://www.redhat.com/archives/libvir-list/2011-February/msg00559.html - [2] http://lists.nongnu.org/archive/html/qemu-devel/2011-02/msg01892.html - -Index: libvirt-0.8.8/src/qemu/qemu_command.c -=================================================================== ---- libvirt-0.8.8.orig/src/qemu/qemu_command.c -+++ libvirt-0.8.8/src/qemu/qemu_command.c -@@ -3116,7 +3116,7 @@ qemuBuildCommandLine(virConnectPtr conn, - int bootCD = 0, bootFloppy = 0, bootDisk = 0; - - /* If QEMU supports boot=on for -drive param... */ -- if (qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE_BOOT) { -+ if (qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE_BOOT && !def->os.kernel) { - for (i = 0 ; i < def->os.nBootDevs ; i++) { - switch (def->os.bootDevs[i]) { - case VIR_DOMAIN_BOOT_CDROM: diff --git a/libvirt-0.8.8.tar.bz2 b/libvirt-0.8.8.tar.bz2 deleted file mode 100644 index fe8d7d3..0000000 --- a/libvirt-0.8.8.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1b055afdea9df8d502b7572ea4c81a9aa5fa0f8688d3a58cf63abcef6e84b807 -size 9569079 diff --git a/libvirt-0.9.0.tar.bz2 b/libvirt-0.9.0.tar.bz2 new file mode 100644 index 0000000..c274532 --- /dev/null +++ b/libvirt-0.9.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88d34ed2763694154a6c8b6847730d899a7d348179a7844d0753d45751820e1b +size 9716336 diff --git a/libvirt.changes b/libvirt.changes index 18c2d4a..4cab092 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Mar 31 14:16:17 MST 2011 - jfehlig@novell.com + +- Update to libvirt 0.9.0 RC3 + ------------------------------------------------------------------- Thu Mar 24 10:23:30 UTC 2011 - coolo@novell.com diff --git a/libvirt.spec b/libvirt.spec index eab9db0..80646ea 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -144,8 +144,8 @@ Url: http://libvirt.org/ License: LGPLv2.1+ Group: Development/Libraries/C and C++ AutoReqProv: yes -Version: 0.8.8 -Release: 3 +Version: 0.9.0 +Release: 1 Summary: A C toolkit to interract with the virtualization capabilities of Linux # The client side, i.e. shared libs and virsh are in a subpackage Requires: %{name}-client = %{version}-%{release} @@ -169,14 +169,11 @@ Recommends: PolicyKit >= 0.6 Source0: %{name}-%{version}.tar.bz2 Source1: libvirtd.init # Upstream patches -Patch0: efc2594b-boot-param.patch -Patch1: 71753cb7-CVE-2011-1146.patch # Need to go upstream Patch100: xen-name-for-devid.patch -Patch102: clone.patch -Patch103: xen-pv-cdrom.patch -Patch104: xen-domctl-ver7.patch -Patch105: xend-disk-order.patch +Patch101: clone.patch +Patch102: xen-pv-cdrom.patch +Patch103: xend-disk-order.patch # Our patches Patch200: libvirtd-defaults.patch Patch201: use-libvirt-guests-on-suse.patch @@ -285,13 +282,10 @@ Authors: %prep %setup -q -%patch0 -p1 -%patch1 -p1 %patch100 -p1 -%patch102 +%patch101 +%patch102 -p1 %patch103 -p1 -%patch104 -p1 -%patch105 -p1 %patch200 -p1 %patch201 -p1 diff --git a/libvirtd-defaults.patch b/libvirtd-defaults.patch index ea40498..72e9fdf 100644 --- a/libvirtd-defaults.patch +++ b/libvirtd-defaults.patch @@ -1,7 +1,7 @@ -Index: libvirt-0.8.6/daemon/libvirtd.conf +Index: libvirt-0.9.0/daemon/libvirtd.conf =================================================================== ---- libvirt-0.8.6.orig/daemon/libvirtd.conf -+++ libvirt-0.8.6/daemon/libvirtd.conf +--- libvirt-0.9.0.orig/daemon/libvirtd.conf ++++ libvirt-0.9.0/daemon/libvirtd.conf @@ -18,8 +18,8 @@ # It is necessary to setup a CA and issue server certificates before # using this capability. @@ -28,11 +28,11 @@ Index: libvirt-0.8.6/daemon/libvirtd.conf # Override the default mDNS advertizement name. This must be # unique on the immediate broadcast network. -Index: libvirt-0.8.6/daemon/libvirtd.c +Index: libvirt-0.9.0/daemon/libvirtd.c =================================================================== ---- libvirt-0.8.6.orig/daemon/libvirtd.c -+++ libvirt-0.8.6/daemon/libvirtd.c -@@ -147,7 +147,7 @@ static int sigwrite = -1; /* Signa +--- libvirt-0.9.0.orig/daemon/libvirtd.c ++++ libvirt-0.9.0/daemon/libvirtd.c +@@ -148,7 +148,7 @@ static int sigwrite = -1; /* Signa static int ipsock = 0; /* -l Listen for TCP/IP */ /* Defaults for configuration file elements */ @@ -41,7 +41,7 @@ Index: libvirt-0.8.6/daemon/libvirtd.c static int listen_tcp = 0; static char *listen_addr = (char *) LIBVIRTD_LISTEN_ADDR; static char *tls_port = (char *) LIBVIRTD_TLS_PORT; -@@ -169,7 +169,7 @@ static int auth_tcp = REMOTE_AUTH_NONE; +@@ -170,7 +170,7 @@ static int auth_tcp = REMOTE_AUTH_NONE; #endif static int auth_tls = REMOTE_AUTH_NONE; diff --git a/use-libvirt-guests-on-suse.patch b/use-libvirt-guests-on-suse.patch index 245f985..eac70f6 100644 --- a/use-libvirt-guests-on-suse.patch +++ b/use-libvirt-guests-on-suse.patch @@ -1,7 +1,7 @@ -Index: libvirt-0.8.8/tools/Makefile.am +Index: libvirt-0.9.0/tools/Makefile.am =================================================================== ---- libvirt-0.8.8.orig/tools/Makefile.am -+++ libvirt-0.8.8/tools/Makefile.am +--- libvirt-0.9.0.orig/tools/Makefile.am ++++ libvirt-0.9.0/tools/Makefile.am @@ -129,18 +129,18 @@ install-data-local: install-init uninstall-local: uninstall-init @@ -39,11 +39,11 @@ Index: libvirt-0.8.8/tools/Makefile.am -endif # LIBVIRT_INIT_SCRIPT_RED_HAT - CLEANFILES = $(bin_SCRIPTS) $(man1_MANS) -Index: libvirt-0.8.8/tools/libvirt-guests.sysconf + CLEANFILES = $(bin_SCRIPTS) +Index: libvirt-0.9.0/tools/libvirt-guests.sysconf =================================================================== ---- libvirt-0.8.8.orig/tools/libvirt-guests.sysconf -+++ libvirt-0.8.8/tools/libvirt-guests.sysconf +--- libvirt-0.9.0.orig/tools/libvirt-guests.sysconf ++++ libvirt-0.9.0/tools/libvirt-guests.sysconf @@ -1,15 +1,23 @@ +## Path: System/Virtualization/libvirt + @@ -82,10 +82,10 @@ Index: libvirt-0.8.8/tools/libvirt-guests.sysconf # number of seconds we're willing to wait for a guest to shut down -#SHUTDOWN_TIMEOUT=0 +SHUTDOWN_TIMEOUT=120 -Index: libvirt-0.8.8/tools/libvirt-guests.init.sh +Index: libvirt-0.9.0/tools/libvirt-guests.init.sh =================================================================== ---- libvirt-0.8.8.orig/tools/libvirt-guests.init.sh -+++ libvirt-0.8.8/tools/libvirt-guests.init.sh +--- libvirt-0.9.0.orig/tools/libvirt-guests.init.sh ++++ libvirt-0.9.0/tools/libvirt-guests.init.sh @@ -4,10 +4,10 @@ # ### BEGIN INIT INFO @@ -133,7 +133,7 @@ Index: libvirt-0.8.8/tools/libvirt-guests.init.sh return 1 else return 0 -@@ -78,12 +75,31 @@ run_virsh_c() { +@@ -76,12 +73,31 @@ run_virsh_c() { ( export LC_ALL=C; run_virsh "$@" ) } @@ -159,32 +159,32 @@ Index: libvirt-0.8.8/tools/libvirt-guests.init.sh list_guests() { uri=$1 - list=$(run_virsh_c $uri list) + list=$(run_virsh_c "$uri" list) if [ $? -ne 0 ]; then - RETVAL=1 + rc_failed 1 return 1 fi -@@ -91,7 +107,7 @@ list_guests() { +@@ -89,7 +105,7 @@ list_guests() { for id in $(echo "$list" | awk 'NR > 2 {print $1}'); do - uuid=$(run_virsh_c $uri dominfo $id | awk '/^UUID:/{print $2}') + uuid=$(run_virsh_c "$uri" dominfo "$id" | awk '/^UUID:/{print $2}') if [ -z "$uuid" ]; then - RETVAL=1 + rc_failed 1 return 1 fi uuids="$uuids $uuid" -@@ -118,7 +134,7 @@ guest_is_on() { +@@ -116,7 +132,7 @@ guest_is_on() { guest_running=false - info=$(run_virsh_c $uri dominfo $uuid) + info=$(run_virsh_c "$uri" dominfo "$uuid") if [ $? -ne 0 ]; then - RETVAL=1 + rc_failed 1 return 1 fi -@@ -156,6 +172,12 @@ start() { +@@ -157,6 +173,12 @@ start() { continue fi @@ -196,8 +196,8 @@ Index: libvirt-0.8.8/tools/libvirt-guests.init.sh + eval_gettext "Resuming guests on \$uri URI..."; echo for guest in $list; do - name=$(guest_name $uri $guest) -@@ -237,7 +259,7 @@ stop() { + name=$(guest_name "$uri" "$guest") +@@ -238,7 +260,7 @@ stop() { if [ $SHUTDOWN_TIMEOUT -le 0 ]; then gettext "Shutdown action requested but SHUTDOWN_TIMEOUT was not set" echo @@ -206,7 +206,7 @@ Index: libvirt-0.8.8/tools/libvirt-guests.init.sh return fi fi -@@ -301,14 +323,13 @@ gueststatus() { +@@ -308,14 +330,13 @@ gueststatus() { rh_status() { if [ -f "$LISTFILE" ]; then gettext "stopped, with saved guests"; echo @@ -222,7 +222,7 @@ Index: libvirt-0.8.8/tools/libvirt-guests.init.sh fi } -@@ -352,4 +373,4 @@ case "$1" in +@@ -359,4 +380,4 @@ case "$1" in usage ;; esac diff --git a/xen-domctl-ver7.patch b/xen-domctl-ver7.patch deleted file mode 100644 index 149ba99..0000000 --- a/xen-domctl-ver7.patch +++ /dev/null @@ -1,272 +0,0 @@ -Index: libvirt-0.8.6/src/xen/xen_hypervisor.c -=================================================================== ---- libvirt-0.8.6.orig/src/xen/xen_hypervisor.c -+++ libvirt-0.8.6/src/xen/xen_hypervisor.c -@@ -223,11 +223,28 @@ struct xen_v2d6_getdomaininfo { - }; - typedef struct xen_v2d6_getdomaininfo xen_v2d6_getdomaininfo; - -+struct xen_v2d7_getdomaininfo { -+ domid_t domain; /* the domain number */ -+ uint32_t flags; /* flags, see before */ -+ uint64_t tot_pages ALIGN_64; /* total number of pages used */ -+ uint64_t max_pages ALIGN_64; /* maximum number of pages allowed */ -+ uint64_t shr_pages ALIGN_64; /* number of shared pages */ -+ uint64_t shared_info_frame ALIGN_64; /* MFN of shared_info struct */ -+ uint64_t cpu_time ALIGN_64; /* CPU time used */ -+ uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */ -+ uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */ -+ uint32_t ssidref; -+ xen_domain_handle_t handle; -+ uint32_t cpupool; -+}; -+typedef struct xen_v2d7_getdomaininfo xen_v2d7_getdomaininfo; -+ - union xen_getdomaininfo { - struct xen_v0_getdomaininfo v0; - struct xen_v2_getdomaininfo v2; - struct xen_v2d5_getdomaininfo v2d5; - struct xen_v2d6_getdomaininfo v2d6; -+ struct xen_v2d7_getdomaininfo v2d7; - }; - typedef union xen_getdomaininfo xen_getdomaininfo; - -@@ -236,6 +253,7 @@ union xen_getdomaininfolist { - struct xen_v2_getdomaininfo *v2; - struct xen_v2d5_getdomaininfo *v2d5; - struct xen_v2d6_getdomaininfo *v2d6; -+ struct xen_v2d7_getdomaininfo *v2d7; - }; - typedef union xen_getdomaininfolist xen_getdomaininfolist; - -@@ -273,147 +291,179 @@ typedef struct xen_v2s5_availheap xen_v - #define XEN_GETDOMAININFOLIST_ALLOC(domlist, size) \ - (hypervisor_version < 2 ? \ - (VIR_ALLOC_N(domlist.v0, (size)) == 0) : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ (VIR_ALLOC_N(domlist.v2d7, (size)) == 0) : \ -+ (dom_interface_version == 6 ? \ - (VIR_ALLOC_N(domlist.v2d6, (size)) == 0) : \ - (dom_interface_version == 5 ? \ - (VIR_ALLOC_N(domlist.v2d5, (size)) == 0) : \ -- (VIR_ALLOC_N(domlist.v2, (size)) == 0)))) -+ (VIR_ALLOC_N(domlist.v2, (size)) == 0))))) - - #define XEN_GETDOMAININFOLIST_FREE(domlist) \ - (hypervisor_version < 2 ? \ - VIR_FREE(domlist.v0) : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ VIR_FREE(domlist.v2d7) : \ -+ (dom_interface_version == 6 ? \ - VIR_FREE(domlist.v2d6) : \ - (dom_interface_version == 5 ? \ - VIR_FREE(domlist.v2d5) : \ -- VIR_FREE(domlist.v2)))) -+ VIR_FREE(domlist.v2))))) - - #define XEN_GETDOMAININFOLIST_CLEAR(domlist, size) \ - (hypervisor_version < 2 ? \ - memset(domlist.v0, 0, sizeof(*domlist.v0) * size) : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ memset(domlist.v2d7, 0, sizeof(*domlist.v2d7) * size) : \ -+ (dom_interface_version == 6 ? \ - memset(domlist.v2d6, 0, sizeof(*domlist.v2d6) * size) : \ - (dom_interface_version == 5 ? \ - memset(domlist.v2d5, 0, sizeof(*domlist.v2d5) * size) : \ -- memset(domlist.v2, 0, sizeof(*domlist.v2) * size)))) -+ memset(domlist.v2, 0, sizeof(*domlist.v2) * size))))) - - #define XEN_GETDOMAININFOLIST_DOMAIN(domlist, n) \ - (hypervisor_version < 2 ? \ - domlist.v0[n].domain : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ domlist.v2d7[n].domain : \ -+ (dom_interface_version == 6 ? \ - domlist.v2d6[n].domain : \ - (dom_interface_version == 5 ? \ - domlist.v2d5[n].domain : \ -- domlist.v2[n].domain))) -+ domlist.v2[n].domain)))) - - #define XEN_GETDOMAININFOLIST_UUID(domlist, n) \ - (hypervisor_version < 2 ? \ - domlist.v0[n].handle : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ domlist.v2d7[n].handle : \ -+ (dom_interface_version == 6 ? \ - domlist.v2d6[n].handle : \ - (dom_interface_version == 5 ? \ - domlist.v2d5[n].handle : \ -- domlist.v2[n].handle))) -+ domlist.v2[n].handle)))) - - #define XEN_GETDOMAININFOLIST_DATA(domlist) \ - (hypervisor_version < 2 ? \ - (void*)(domlist->v0) : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ (void*)(domlist->v2d7) : \ -+ (dom_interface_version == 6 ? \ - (void*)(domlist->v2d6) : \ - (dom_interface_version == 5 ? \ - (void*)(domlist->v2d5) : \ -- (void*)(domlist->v2)))) -+ (void*)(domlist->v2))))) - - #define XEN_GETDOMAININFO_SIZE \ - (hypervisor_version < 2 ? \ - sizeof(xen_v0_getdomaininfo) : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ sizeof(xen_v2d7_getdomaininfo) : \ -+ (dom_interface_version == 6 ? \ - sizeof(xen_v2d6_getdomaininfo) : \ - (dom_interface_version == 5 ? \ - sizeof(xen_v2d5_getdomaininfo) : \ -- sizeof(xen_v2_getdomaininfo)))) -+ sizeof(xen_v2_getdomaininfo))))) - - #define XEN_GETDOMAININFO_CLEAR(dominfo) \ - (hypervisor_version < 2 ? \ - memset(&(dominfo.v0), 0, sizeof(xen_v0_getdomaininfo)) : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ memset(&(dominfo.v2d7), 0, sizeof(xen_v2d7_getdomaininfo)) : \ -+ (dom_interface_version == 6 ? \ - memset(&(dominfo.v2d6), 0, sizeof(xen_v2d6_getdomaininfo)) : \ - (dom_interface_version == 5 ? \ - memset(&(dominfo.v2d5), 0, sizeof(xen_v2d5_getdomaininfo)) : \ -- memset(&(dominfo.v2), 0, sizeof(xen_v2_getdomaininfo))))) -+ memset(&(dominfo.v2), 0, sizeof(xen_v2_getdomaininfo)))))) - - #define XEN_GETDOMAININFO_DOMAIN(dominfo) \ - (hypervisor_version < 2 ? \ - dominfo.v0.domain : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ dominfo.v2d7.domain : \ -+ (dom_interface_version == 6 ? \ - dominfo.v2d6.domain : \ - (dom_interface_version == 5 ? \ - dominfo.v2d5.domain : \ -- dominfo.v2.domain))) -+ dominfo.v2.domain)))) - - #define XEN_GETDOMAININFO_CPUTIME(dominfo) \ - (hypervisor_version < 2 ? \ - dominfo.v0.cpu_time : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ dominfo.v2d7.cpu_time : \ -+ (dom_interface_version == 6 ? \ - dominfo.v2d6.cpu_time : \ - (dom_interface_version == 5 ? \ - dominfo.v2d5.cpu_time : \ -- dominfo.v2.cpu_time))) -+ dominfo.v2.cpu_time)))) - - - #define XEN_GETDOMAININFO_CPUCOUNT(dominfo) \ - (hypervisor_version < 2 ? \ - dominfo.v0.nr_online_vcpus : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ dominfo.v2d7.nr_online_vcpus : \ -+ (dom_interface_version == 6 ? \ - dominfo.v2d6.nr_online_vcpus : \ - (dom_interface_version == 5 ? \ - dominfo.v2d5.nr_online_vcpus : \ -- dominfo.v2.nr_online_vcpus))) -+ dominfo.v2.nr_online_vcpus)))) - - #define XEN_GETDOMAININFO_MAXCPUID(dominfo) \ - (hypervisor_version < 2 ? \ - dominfo.v0.max_vcpu_id : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ dominfo.v2d7.max_vcpu_id : \ -+ (dom_interface_version == 6 ? \ - dominfo.v2d6.max_vcpu_id : \ - (dom_interface_version == 5 ? \ - dominfo.v2d5.max_vcpu_id : \ -- dominfo.v2.max_vcpu_id))) -+ dominfo.v2.max_vcpu_id)))) - - #define XEN_GETDOMAININFO_FLAGS(dominfo) \ - (hypervisor_version < 2 ? \ - dominfo.v0.flags : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ dominfo.v2d7.flags : \ -+ (dom_interface_version == 6 ? \ - dominfo.v2d6.flags : \ - (dom_interface_version == 5 ? \ - dominfo.v2d5.flags : \ -- dominfo.v2.flags))) -+ dominfo.v2.flags)))) - - #define XEN_GETDOMAININFO_TOT_PAGES(dominfo) \ - (hypervisor_version < 2 ? \ - dominfo.v0.tot_pages : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ dominfo.v2d7.tot_pages : \ -+ (dom_interface_version == 6 ? \ - dominfo.v2d6.tot_pages : \ - (dom_interface_version == 5 ? \ - dominfo.v2d5.tot_pages : \ -- dominfo.v2.tot_pages))) -+ dominfo.v2.tot_pages)))) - - #define XEN_GETDOMAININFO_MAX_PAGES(dominfo) \ - (hypervisor_version < 2 ? \ - dominfo.v0.max_pages : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ dominfo.v2d7.max_pages : \ -+ (dom_interface_version == 6 ? \ - dominfo.v2d6.max_pages : \ - (dom_interface_version == 5 ? \ - dominfo.v2d5.max_pages : \ -- dominfo.v2.max_pages))) -+ dominfo.v2.max_pages)))) - - #define XEN_GETDOMAININFO_UUID(dominfo) \ - (hypervisor_version < 2 ? \ - dominfo.v0.handle : \ -- (dom_interface_version >= 6 ? \ -+ (dom_interface_version >= 7 ? \ -+ dominfo.v2d7.handle : \ -+ (dom_interface_version == 6 ? \ - dominfo.v2d6.handle : \ - (dom_interface_version == 5 ? \ - dominfo.v2d5.handle : \ -- dominfo.v2.handle))) -+ dominfo.v2.handle)))) - - - static int -@@ -2087,8 +2137,16 @@ xenHypervisorInit(void) - sys_interface_version = 7; /* XEN_SYSCTL_INTERFACE_VERSION */ - if (virXen_getdomaininfo(fd, 0, &info) == 1) { - dom_interface_version = 6; /* XEN_DOMCTL_INTERFACE_VERSION */ -- DEBUG0("Using hypervisor call v2, sys ver7 dom ver6"); -- goto done; -+ if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ -+ DEBUG0("Using hypervisor call v2, sys ver6 dom ver6\n"); -+ goto done; -+ } -+ /* CPU Pools addition to domctl interface */ -+ dom_interface_version = 7; /* XEN_DOMCTL_INTERFACE_VERSION */ -+ if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ -+ DEBUG0("Using hypervisor call v2, sys ver6 dom ver7\n"); -+ goto done; -+ } - } - - hypervisor_version = 1; diff --git a/xen-name-for-devid.patch b/xen-name-for-devid.patch index bc3f80c..a9755b2 100644 --- a/xen-name-for-devid.patch +++ b/xen-name-for-devid.patch @@ -13,11 +13,11 @@ Date: Wed Jan 27 16:11:41 2010 -0700 This approach allows removing a disk when domain is inactive. We obviously can't search xenstore when the domain is inactive. -Index: libvirt-0.8.8/src/xen/xend_internal.c +Index: libvirt-0.9.0/src/xen/xend_internal.c =================================================================== ---- libvirt-0.8.8.orig/src/xen/xend_internal.c -+++ libvirt-0.8.8/src/xen/xend_internal.c -@@ -89,6 +89,7 @@ xenDaemonFormatSxprOnePCI(virDomainHostd +--- libvirt-0.9.0.orig/src/xen/xend_internal.c ++++ libvirt-0.9.0/src/xen/xend_internal.c +@@ -62,6 +62,7 @@ static int virDomainXMLDevID(virDomainPtr domain, @@ -25,7 +25,7 @@ Index: libvirt-0.8.8/src/xen/xend_internal.c virDomainDeviceDefPtr dev, char *class, char *ref, -@@ -4088,7 +4089,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr +@@ -2725,7 +2726,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr sexpr = virBufferContentAndReset(&buf); @@ -34,7 +34,7 @@ Index: libvirt-0.8.8/src/xen/xend_internal.c /* device doesn't exist, define it */ ret = xend_op(domain->conn, domain->name, "op", "device_create", "config", sexpr, NULL); -@@ -4211,7 +4212,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr +@@ -2848,7 +2849,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr sexpr = virBufferContentAndReset(&buf); @@ -43,7 +43,7 @@ Index: libvirt-0.8.8/src/xen/xend_internal.c virXendError(VIR_ERR_OPERATION_INVALID, "%s", _("requested device does not exist")); goto cleanup; -@@ -4304,7 +4305,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr +@@ -2941,7 +2942,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr def, xml, VIR_DOMAIN_XML_INACTIVE))) goto cleanup; @@ -52,7 +52,7 @@ Index: libvirt-0.8.8/src/xen/xend_internal.c goto cleanup; if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) { -@@ -6085,6 +6086,7 @@ error: +@@ -3883,6 +3884,7 @@ struct xenUnifiedDriver xenDaemonDriver */ static int virDomainXMLDevID(virDomainPtr domain, @@ -60,7 +60,7 @@ Index: libvirt-0.8.8/src/xen/xend_internal.c virDomainDeviceDefPtr dev, char *class, char *ref, -@@ -6093,8 +6095,12 @@ virDomainXMLDevID(virDomainPtr domain, +@@ -3891,8 +3893,12 @@ virDomainXMLDevID(virDomainPtr domain, xenUnifiedPrivatePtr priv = domain->conn->privateData; char *xref; char *tmp; @@ -73,7 +73,7 @@ Index: libvirt-0.8.8/src/xen/xend_internal.c if (dev->data.disk->driverName && STREQ(dev->data.disk->driverName, "tap")) strcpy(class, "tap"); -@@ -6104,19 +6110,21 @@ virDomainXMLDevID(virDomainPtr domain, +@@ -3902,19 +3908,21 @@ virDomainXMLDevID(virDomainPtr domain, else strcpy(class, "vbd"); diff --git a/xen-pv-cdrom.patch b/xen-pv-cdrom.patch index 2fb9cac..9824422 100644 --- a/xen-pv-cdrom.patch +++ b/xen-pv-cdrom.patch @@ -1,21 +1,21 @@ -Index: libvirt-0.8.8/src/xen/xend_internal.c +Index: libvirt-0.9.0/src/xenxs/xen_sxpr.c =================================================================== ---- libvirt-0.8.8.orig/src/xen/xend_internal.c -+++ libvirt-0.8.8/src/xen/xend_internal.c -@@ -1365,7 +1365,7 @@ error: +--- libvirt-0.9.0.orig/src/xenxs/xen_sxpr.c ++++ libvirt-0.9.0/src/xenxs/xen_sxpr.c +@@ -326,7 +326,7 @@ error: static int - xenDaemonParseSxprDisks(virDomainDefPtr def, - const struct sexpr *root, -- int hvm, -+ int hvm ATTRIBUTE_UNUSED, - int xendConfigVersion) + xenParseSxprDisks(virDomainDefPtr def, + const struct sexpr *root, +- int hvm, ++ int hvm ATTRIBUTE_UNUSED, + int xendConfigVersion) { const struct sexpr *cur, *node; -@@ -1412,7 +1412,6 @@ xenDaemonParseSxprDisks(virDomainDefPtr +@@ -373,7 +373,6 @@ xenParseSxprDisks(virDomainDefPtr def, /* There is a case without the uname to the CD-ROM device */ offset = strchr(dst, ':'); if (!offset || - !hvm || STRNEQ(offset, ":cdrom")) { - virXendError(VIR_ERR_INTERNAL_ERROR, + XENXS_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("domain information incomplete, vbd has no src")); diff --git a/xend-disk-order.patch b/xend-disk-order.patch index 3535631..454c284 100644 --- a/xend-disk-order.patch +++ b/xend-disk-order.patch @@ -1,8 +1,8 @@ -Index: libvirt-0.8.8/src/xen/xend_internal.c +Index: libvirt-0.9.0/src/xenxs/xen_sxpr.c =================================================================== ---- libvirt-0.8.8.orig/src/xen/xend_internal.c -+++ libvirt-0.8.8/src/xen/xend_internal.c -@@ -1383,20 +1383,24 @@ xenDaemonParseSxprDisks(virDomainDefPtr +--- libvirt-0.9.0.orig/src/xenxs/xen_sxpr.c ++++ libvirt-0.9.0/src/xenxs/xen_sxpr.c +@@ -344,20 +344,24 @@ xenParseSxprDisks(virDomainDefPtr def, const char *src = NULL; const char *dst = NULL; const char *mode = NULL; @@ -27,7 +27,7 @@ Index: libvirt-0.8.8/src/xen/xend_internal.c } if (VIR_ALLOC(disk) < 0) -@@ -1521,7 +1525,12 @@ xenDaemonParseSxprDisks(virDomainDefPtr +@@ -482,7 +486,13 @@ xenParseSxprDisks(virDomainDefPtr def, if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0) goto no_memory; @@ -38,6 +38,7 @@ Index: libvirt-0.8.8/src/xen/xend_internal.c + def->ndisks++; + } else + def->disks[def->ndisks++] = disk; ++ disk = NULL; } } From 9098b104503d444dfaadd36ccc74e502ecd5c25939b8bb5944aa4d919e311067 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Thu, 31 Mar 2011 21:12:46 +0000 Subject: [PATCH 03/12] fix build OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=109 --- libvirt.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libvirt.spec b/libvirt.spec index 80646ea..ac45dfb 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -497,8 +497,9 @@ rm -rf $RPM_BUILD_ROOT %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ %endif %if 0%{with_storage_disk} -%{_libdir}/%{name}/libvirt_parthelper +%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper %endif +%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper %doc %{_mandir}/man8/libvirtd.8* %files client -f %{name}.lang From f4957cc7a6c0b86f04501d06b965e5874639a319fa39921f8805be6fbd7062fa Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Thu, 31 Mar 2011 21:34:14 +0000 Subject: [PATCH 04/12] another shot at fixing build OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=110 --- libvirt.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt.spec b/libvirt.spec index ac45dfb..660a6b0 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -497,9 +497,9 @@ rm -rf $RPM_BUILD_ROOT %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ %endif %if 0%{with_storage_disk} -%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper +%{_libdir}/%{name}/libvirt_parthelper %endif -%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper +%{_libdir}/%{name}/libvirt_iohelper %doc %{_mandir}/man8/libvirtd.8* %files client -f %{name}.lang From a475094f61346ad3fd10fd1d5d178451eaff868139f7a626b30ba3bd5700ffc8 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Fri, 1 Apr 2011 00:28:05 +0000 Subject: [PATCH 05/12] logrotate file for libvirtd OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=111 --- libvirt.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/libvirt.spec b/libvirt.spec index 660a6b0..e73a647 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -464,6 +464,7 @@ rm -rf $RPM_BUILD_ROOT %config /etc/init.d/libvirtd %{_sbindir}/rclibvirtd %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf +%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd %config %{_sysconfdir}/libvirt/qemu/networks/default.xml %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/ %dir %{_localstatedir}/lib/libvirt/ From 331f9906acb73c8feb698c2795edb5705aeb276f539f2005497a97b0e4a536ef Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Mon, 4 Apr 2011 22:08:05 +0000 Subject: [PATCH 06/12] - Update to libvirt 0.9.0 final - Support cpu usage tuning - Add public APIs for storage volume upload/download - Add public API for setting migration speed on the fly - Add libxenlight driver - qemu: support migration to fd - add virDomain{Get,Set}BlkioParameters - introduce a new libvirt API (virDomainSetMemoryFlags) - Expose event loop implementation as a public API - Dump the debug buffer to libvirtd.log on fatal signal - Audit support - Numerous enhancements and bug fixes OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=112 --- libvirt-0.9.0.tar.bz2 | 4 +- libvirt.changes | 16 ++ libvirt.spec | 425 ++++++++++++++++++++++++++++++++---------- 3 files changed, 343 insertions(+), 102 deletions(-) diff --git a/libvirt-0.9.0.tar.bz2 b/libvirt-0.9.0.tar.bz2 index c274532..7bb9325 100644 --- a/libvirt-0.9.0.tar.bz2 +++ b/libvirt-0.9.0.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:88d34ed2763694154a6c8b6847730d899a7d348179a7844d0753d45751820e1b -size 9716336 +oid sha256:c888aceb88f0ef194bfbb8292d7e08772be5e4373b1e000d1ab28b7c4d5831db +size 9848222 diff --git a/libvirt.changes b/libvirt.changes index 4cab092..4f18814 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Mon Apr 4 16:02:23 MDT 2011 - jfehlig@novell.com + +- Update to libvirt 0.9.0 final + - Support cpu usage tuning + - Add public APIs for storage volume upload/download + - Add public API for setting migration speed on the fly + - Add libxenlight driver + - qemu: support migration to fd + - add virDomain{Get,Set}BlkioParameters + - introduce a new libvirt API (virDomainSetMemoryFlags) + - Expose event loop implementation as a public API + - Dump the debug buffer to libvirtd.log on fatal signal + - Audit support + - Numerous enhancements and bug fixes + ------------------------------------------------------------------- Thu Mar 31 14:16:17 MST 2011 - jfehlig@novell.com diff --git a/libvirt.spec b/libvirt.spec index e73a647..5616f42 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -17,80 +17,166 @@ # norootforbuild -# hypervisor drivers that run on local host -%define with_xen 1 -%define with_qemu 1 -%define with_lxc 1 -%define with_vbox 1 -%define with_openvz 0 -%define with_uml 0 -%define with_one 0 -# hypervisor drivers that use a native remote protocol -%define with_phyp 0 -%define with_esx 1 -# host drivers -%define with_network 1 -%define with_storage_fs 1 -%define with_storage_lvm 1 -%define with_storage_iscsi 1 -%define with_storage_disk 1 -%define with_storage_mpath 1 -%define with_numactl 1 -%define with_selinux 1 -%define with_apparmor 0 -# options -%if 0%{?suse_version} >= 1140 -%define with_yajl 1 -%define with_netcf 1 -%define with_macvtap 1 -%define with_virtualport 1 +# In the future, we may want a client only build, which will create a +# libvirt.so only containing the generic RPC driver and the test driver, +# but no libvirtd +# For now, default to a full server + client build +%define client_only 0 + +# Disable all server side drivers if client only build requested +%if %{client_only} +%define server_drivers 0 %else -%define with_yajl 0 -%define with_netcf 0 -%define with_macvtap 0 -%define with_virtualport 0 -%endif -%if 0%{?suse_version} >= 1130 -%define with_capng 1 -%else -%define with_capng 0 -%endif -%if 0%{?suse_version} > 1110 -%define with_udev 1 -%define with_hal 0 -%else -%define with_udev 0 -%define with_hal 1 +%define server_drivers 1 %endif +# Now set the defaults for all the important features, independent +# of any particular OS + +# First the daemon itself +%define with_libvirtd 0%{!?_without_libvirtd:%{server_drivers}} +%define with_avahi 0%{!?_without_avahi:%{server_drivers}} + +# Then the hypervisor drivers that run on local host +%define with_xen 0%{!?_without_xen:%{server_drivers}} +%define with_qemu 0%{!?_without_qemu:%{server_drivers}} +%define with_openvz 0%{!?_without_openvz:%{server_drivers}} +%define with_lxc 0%{!?_without_lxc:%{server_drivers}} +%define with_vbox 0%{!?_without_vbox:%{server_drivers}} +%define with_uml 0%{!?_without_uml:%{server_drivers}} +%define with_xenapi 0%{!?_without_xenapi:%{server_drivers}} +%define with_libxl 0%{!?_without_libxl:%{server_drivers}} + +# Then the hypervisor drivers that talk a native remote protocol +%define with_phyp 0%{!?_without_phyp:0} +%define with_esx 0%{!?_without_esx:1} +%define with_vmware 0%{!?_without_vmware:1} + +# Then the secondary host drivers +%define with_network 0%{!?_without_network:%{server_drivers}} +%define with_storage_fs 0%{!?_without_storage_fs:%{server_drivers}} +%define with_storage_lvm 0%{!?_without_storage_lvm:%{server_drivers}} +%define with_storage_iscsi 0%{!?_without_storage_iscsi:%{server_drivers}} +%define with_storage_disk 0%{!?_without_storage_disk:%{server_drivers}} +%define with_storage_mpath 0%{!?_without_storage_mpath:%{server_drivers}} +%define with_numactl 0%{!?_without_numactl:%{server_drivers}} +%define with_selinux 0%{!?_without_selinux:%{server_drivers}} +%define with_apparmor 0%{!?_without_apparmor:0} + +# A few optional bits off by default, we enable later +%define with_polkit 0%{!?_without_polkit:0} +%define with_capng 0%{!?_without_capng:0} +%define with_netcf 0%{!?_without_netcf:0} +%define with_udev 0%{!?_without_udev:0} +%define with_hal 0%{!?_without_hal:0} +%define with_yajl 0%{!?_without_yajl:0} +%define with_nwfilter 0%{!?_without_nwfilter:0} +%define with_libpcap 0%{!?_without_libpcap:0} +%define with_macvtap 0%{!?_without_macvtap:0} +%define with_libnl 0%{!?_without_libnl:0} +%define with_audit 0%{!?_without_audit:0} +%define with_dtrace 0%{!?_without_dtrace:0} +%define with_cgconfig 0%{!?_without_cgconfig:0} + +# Non-server/HV driver defaults which are always enabled +%define with_python 0%{!?_without_python:1} +%define with_sasl 0%{!?_without_sasl:1} + +# Set the OS / architecture specific special cases + # Xen is available only on i386 x86_64 %ifnarch %ix86 x86_64 -%define with_xen 0 -%endif -# LXC and selinux are not available on anything < openSUSE 11.1 -%if 0%{?suse_version} < 1110 -%define with_lxc 0 -%define with_selinux 0 -%endif -# Enable phyp driver for IBM Power systems -%ifarch ppc64 -%define with_phyp 1 -%endif -# numactl only on x86_64 and ia64 -%ifnarch x86_64 ia64 -%define with_numactl 0 -%endif -# SLES doesn't contain OpenVZ, VBox, UML, OpenNebula, or ESX -%if 0%{?sles_version} -%define with_openvz 0 -%define with_vbox 0 -%define with_uml 0 -%define with_one 0 -%define with_esx 0 +%define with_xen 0 +%define with_libxl 0 %endif -Name: libvirt -BuildRequires: bridge-utils cyrus-sasl-devel device-mapper-devel fdupes gettext gnutls-devel iptables-devel libxml2-devel lvm2 ncurses-devel parted-devel pkg-config python-devel python-xml readline-devel util-linux xhtml-dtd +# numactl only on x86_64 and ia64 +%ifnarch x86_64 ia64 +%define with_numactl 0 +%endif + +# SLES doesn't contain OpenVZ, VBox, UML, ESX, VMWare, or Citrix XenAPI +%if 0%{?sles_version} +%define with_openvz 0 +%define with_vbox 0 +%define with_uml 0 +%define with_esx 0 +%define with_vmware 0 +%define with_xenapi 0 +%endif + +# Enable phyp driver for IBM Power systems +%ifarch ppc64 +%define with_phyp 1 +%endif + +# LXC and selinux are not available on anything < openSUSE 11.1 +%if 0%{?suse_version} < 1110 +%define with_lxc 0 +%define with_selinux 0 +%endif + +# udev is used to manage host devices in 11.1 or newer +%if 0%{?suse_version} > 1110 +%define with_udev 0%{!?_without_udev:%{server_drivers}} +%else +%define with_hal 0%{!?_without_hal:%{server_drivers}} +%endif + +# libcapng is used to manage capabilities in 11.3 or newer +%if 0%{?suse_version} >= 1130 +%define with_capng 0%{!?_without_capng:1} +%endif + +# netcf is used to manage network interfaces in 11.4 or newer +%if 0%{?suse_version} >= 1140 +%define with_netcf 0%{!?_without_netcf:%{server_drivers}} +%endif + +# Enable yajl library for JSON mode with QEMU in 11.4 or newer +%if 0%{?suse_version} >= 1140 +%define with_yajl 0%{!?_without_yajl:%{server_drivers}} +%endif + +# Enable libpcap library +%if %{with_qemu} +%if 0%{?suse_version} >= 1140 +%define with_nwfilter 0%{!?_without_nwfilter:%{server_drivers}} +%define with_libpcap 0%{!?_without_libpcap:%{server_drivers}} +%define with_macvtap 0%{!?_without_macvtap:%{server_drivers}} +%endif +%endif + +%if %{with_macvtap} +%define with_libnl 1 +%endif + +# there's no use compiling the network driver without +# the libvirt daemon +%if ! %{with_libvirtd} +%define with_network 0 +%endif + +BuildRequires: python-devel +BuildRequires: libxml2-devel +BuildRequires: xhtml-dtd +BuildRequires: libxslt +BuildRequires: readline-devel +BuildRequires: ncurses-devel +BuildRequires: gettext +BuildRequires: gnutls-devel +BuildRequires: bridge-utils +BuildRequires: fdupes +BuildRequires: pkg-config +BuildRequires: python-xml +# Only for directory ownership: +BuildRequires: gtk-doc +%if %{with_xen} || %{with_libxl} +BuildRequires: xen-devel +%endif +%if %{with_sasl} +BuildRequires: cyrus-sasl-devel +%endif %if %{with_hal} BuildRequires: hal-devel %endif @@ -98,14 +184,13 @@ BuildRequires: hal-devel BuildRequires: libudev-devel >= 145 BuildRequires: libpciaccess0-devel >= 0.10.9 %endif -%if %{with_xen} -BuildRequires: xen-devel -%endif +%if %{with_avahi} %if 0%{?suse_version} > 1030 BuildRequires: libavahi-devel %else BuildRequires: avahi-devel %endif +%endif %if %{with_selinux} BuildRequires: libselinux-devel %endif @@ -115,11 +200,13 @@ BuildRequires: libapparmor-devel %if %{with_numactl} BuildRequires: libnuma-devel %endif +%if %{with_polkit} %if 0%{?suse_version} > 1110 BuildRequires: polkit >= 0.9 %else BuildRequires: PolicyKit-devel >= 0.6 %endif +%endif %if %{with_phyp} BuildRequires: libssh2-devel %endif @@ -133,13 +220,47 @@ BuildRequires: libnl-devel BuildRequires: libcurl-devel %endif %if %{with_capng} -BuildRequires: libcap-ng-devel +BuildRequires: libcap-ng-devel >= 0.5.0 %endif %if %{with_netcf} -BuildRequires: netcf-devel +BuildRequires: netcf-devel >= 0.1.4 %endif -# Only for directory ownership: -BuildRequires: gtk-doc +%if %{with_network} +BuildRequires: dnsmasq >= 2.41 +BuildRequires: iptables-devel +BuildRequires: radvd +%endif +%if %{with_nwfilter} +BuildRequires: ebtables +%endif +%if %{with_libpcap} +BuildRequires: libpcap-devel +%endif +%if %{with_libnl} +BuildRequires: libnl-devel +%endif +%if %{with_storage_fs} +# For mount/umount in FS driver +BuildRequires: util-linux +%endif +%if %{with_storage_lvm} +# For LVM drivers +BuildRequires: lvm2 +%endif +%if %{with_storage_iscsi} +# For ISCSI driver +BuildRequires: open-iscsi +%endif +%if %{with_storage_disk} +# For disk driver +BuildRequires: parted-devel +%endif +%if %{with_storage_mpath} +# For Multipath support +BuildRequires: device-mapper-devel +%endif + +Name: libvirt Url: http://libvirt.org/ License: LGPLv2.1+ Group: Development/Libraries/C and C++ @@ -147,25 +268,65 @@ AutoReqProv: yes Version: 0.9.0 Release: 1 Summary: A C toolkit to interract with the virtualization capabilities of Linux + # The client side, i.e. shared libs and virsh are in a subpackage Requires: %{name}-client = %{version}-%{release} -Requires: parted Requires: virt-utils +# Used by many of the drivers, so turn it on whenever the +# daemon is present +%if %{with_libvirtd} Recommends: bridge-utils +# for modprobe of pci devices +Requires: module-init-tools +# for /sbin/ip +Requires: iproute +%endif +%if %{with_network} +Recommends: dnsmasq >= 2.41 +Recommends: radvd +%endif +%if %{with_network} || %{with_nwfilter} Recommends: iptables -Recommends: lvm2 +%endif +%if %{with_nwfilter} +Recommends: ebtables +%endif Recommends: logrotate -Recommends: dnsmasq -Recommends: open-iscsi Recommends: nfs-client %if %{with_hal} Requires: hal %endif +%if %{with_udev} +Requires: udev >= 145 +%endif +%if %{with_polkit} %if 0%{?suse_version} > 1110 Recommends: polkit >= 0.9 %else Recommends: PolicyKit >= 0.6 %endif +%endif +%if %{with_storage_fs} +Recommends: nfs-utils +%endif +%if %{with_storage_lvm} +# For LVM drivers +Recommends: lvm2 +%endif +%if %{with_storage_iscsi} +# For ISCSI driver +Recommends: open-iscsi +%endif +%if %{with_storage_disk} +# For disk driver +Recommends: parted +Recommends: device-mapper +%endif +%if %{with_storage_mpath} +# For multipath support +Recommends: device-mapper +%endif + Source0: %{name}-%{version}.tar.bz2 Source1: libvirtd.init # Upstream patches @@ -202,11 +363,11 @@ Requires: readline Requires: ncurses # Needed by libvirt-guests init script. Requires: gettext +Requires: cyrus-sasl +Recommends: cyrus-sasl-digestmd5 # So remote clients can access libvirt over SSH tunnel # (client invokes 'nc' against the UNIX socket on the server) Recommends: netcat-openbsd -Requires: cyrus-sasl -Recommends: cyrus-sasl-digestmd5 %description client Libvirt is a C toolkit to interract with the virtualization @@ -226,10 +387,10 @@ License: LGPLv2.1+ Summary: A C toolkit to interract with the virtualization capabilities of Linux Group: Development/Libraries/C and C++ Requires: %{name}-client = %{version}-%{release} libxml2-devel -%if %{with_xen} +Requires: pkg-config +%if %{with_xen} || %{with_libxl} Requires: xen-devel %endif -Requires: pkg-config %description devel Libvirt is a C toolkit to interract with the virtualization @@ -261,6 +422,7 @@ Authors: Daniel Veillard Karel Zak +%if %{with_python} %package python License: LGPLv2.1+ Summary: A C toolkit to interract with the virtualization capabilities of Linux @@ -279,6 +441,7 @@ Authors: -------- Daniel Veillard Karel Zak +%endif %prep %setup -q @@ -308,15 +471,15 @@ Authors: %if ! %{with_uml} %define _without_uml --without-uml %endif -%if ! %{with_one} -%define _without_one --without-one -%endif %if ! %{with_phyp} %define _without_phyp --without-phyp %endif %if ! %{with_esx} %define _without_esx --without-esx %endif +%if ! %{with_libxl} +%define _without_libxl --without-libxl +%endif %if ! %{with_numactl} %define _without_numactl --without-numactl %endif @@ -344,8 +507,20 @@ Authors: %if ! %{with_macvtap} %define _without_macvtap --without-macvtap %endif -%if ! %{with_virtualport} -%define _without_virtualport --without-virtualport +%if ! %{with_polkit} +%define _without_polkit --without-polkit +%endif +%if ! %{with_network} +%define _without_network --without-network +%endif +%if ! %{with_sasl} +%define _without_sasl --without-sasl +%endif +%if ! %{with_python} +%define _without_python --without-python +%endif +%if ! %{with_libpcap} +%define _without_libpcap --without-libpcap %endif autoreconf -f -i @@ -357,26 +532,26 @@ export CFLAGS="$RPM_OPT_FLAGS" %{?_without_openvz} \ %{?_without_vbox} \ %{?_without_uml} \ - %{?_without_one} \ %{?_without_phyp} \ %{?_without_esx} \ + %{?_without_libxl} \ %{?_without_numactl} \ - %{?_with_selinux} \ - %{?_without_capng} \ - %{?_without_netcf} \ %{?_without_selinux} \ %{?_without_apparmor} \ + %{?_without_capng} \ + %{?_without_netcf} \ + %{?_without_network} \ %{?_without_hal} \ %{?_without_udev} \ %{?_without_yajl} \ %{?_without_macvtap} \ - %{?_without_virtualport} \ - --without-xen-proxy \ + %{?_without_polkit} \ + %{?_without_network} \ + %{?_without_sasl} \ + %{?_without_python} \ + %{?_without_libpcap} \ --libexecdir=%{_libdir}/%{name} \ - --with-init-script=none \ --with-remote-pid-file=%{_localstatedir}/run/libvirtd.pid \ - ac_cv_path_DNSMASQ=/usr/sbin/dnsmasq \ - ac_cv_path_ISCSIADM=/sbin/iscsiadm \ ac_cv_path_MODPROBE=/sbin/modprobe \ ac_cv_path_UDEVADM=/sbin/udevadm \ ac_cv_path_SHOWMOUNT=/usr/sbin/showmount @@ -388,10 +563,22 @@ cp -a AUTHORS ChangeLog COPYING NEWS README TODO $RPM_BUILD_ROOT%{_docdir}/%{nam cd docs ; cp -a *.html $RPM_BUILD_ROOT%{_docdir}/%{name} ; cp -a *.png $RPM_BUILD_ROOT%{_docdir}/%{name} ; cd .. # remove currently unsupported locale(s) rm -rf $RPM_BUILD_ROOT/usr/share/locale/sr@latin -# don't autostart the default network -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/libvirt rm $RPM_BUILD_ROOT%{_libdir}/*.*a $RPM_BUILD_ROOT%{py_sitedir}/*.*a +%find_lang %{name} +%if %{with_network} +install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/ +install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/ +cp $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml \ + $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml +# Strip auto-generated UUID - we need it generated per-install +sed -i -e "//d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml +%else +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml +%endif %if ! %{with_lxc} rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug @@ -405,7 +592,17 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu %if ! %{with_uml} rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml %endif -%find_lang %{name} +%if ! %{with_python} +rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-python-%{version} +%endif +%if %{client_only} +rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} +%endif +%if ! %{with_libvirtd} +rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter +mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version}/html \ + $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-devel-%{version}/ +%endif ln_dupes() { @@ -434,49 +631,68 @@ rm -rf $RPM_BUILD_ROOT %post /sbin/ldconfig +%if %{with_libvirtd} %if 0%{?sles_version} %{fillup_and_insserv -f -y libvirtd} %endif +if test $? != 0 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml +then + UUID=`/usr/bin/uuidgen` + sed -e "s,,\n $UUID," \ + < %{_datadir}/libvirt/networks/default.xml \ + > %{_sysconfdir}/libvirt/qemu/networks/default.xml +fi +%endif %{fillup_only -n libvirt-guests} %preun +%if %{with_libvirtd} %stop_on_removal libvirtd +%endif %postun /sbin/ldconfig +%if %{with_libvirtd} %restart_on_update libvirtd +%endif %insserv_cleanup %post client -p /sbin/ldconfig %postun client -p /sbin/ldconfig +%if %{with_libvirtd} %files %defattr(-, root, root) %{_sbindir}/libvirtd %dir %{_libdir}/%{name} %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/ +%if %{with_network} %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart +%dir %{_datadir}/libvirt/networks/ +%{_datadir}/libvirt/networks/default.xml +%endif %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ %{_sysconfdir}/libvirt/nwfilter/*.xml %config /etc/init.d/libvirtd %{_sbindir}/rclibvirtd %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd -%config %{_sysconfdir}/libvirt/qemu/networks/default.xml %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/ %dir %{_localstatedir}/lib/libvirt/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/images/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/boot/ %dir %attr(0700, root, root) %{_localstatedir}/cache/libvirt/ %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/ +%if %{with_polkit} %if 0%{?suse_version} > 1110 %{_datadir}/polkit-1/actions/org.libvirt.unix.policy %else %{_datadir}/PolicyKit/policy/org.libvirt.unix.policy %endif +%endif %{_datadir}/augeas %if %{with_qemu} %config(noreplace) %{_sysconfdir}/libvirt/qemu.conf @@ -497,11 +713,16 @@ rm -rf $RPM_BUILD_ROOT %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/ %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ %endif +%if %{with_libxl} +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ +#%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ +%endif %if 0%{with_storage_disk} %{_libdir}/%{name}/libvirt_parthelper %endif %{_libdir}/%{name}/libvirt_iohelper %doc %{_mandir}/man8/libvirtd.8* +%endif %files client -f %{name}.lang %defattr(-, root, root) @@ -534,7 +755,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/libvirt/cpu_map.xml %{_datadir}/libvirt/schemas/nwfilter.rng %{_datadir}/libvirt/schemas/domainsnapshot.rng +%if %{with_sasl} %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf +%endif %files devel %defattr(-, root, root) @@ -551,10 +774,12 @@ rm -rf $RPM_BUILD_ROOT %doc %{_docdir}/%{name}/*.css %doc %{_docdir}/%{name}/html +%if %{with_python} %files python %defattr(-, root, root) %doc %{_docdir}/%{name}-python %{py_sitedir}/libvirt.py* %{py_sitedir}/libvirtmod* +%endif %changelog From 701f14656cf162887d23296a513881c6a35b0db78993e88db9df0b332a5f80c3 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Tue, 5 Apr 2011 22:31:12 +0000 Subject: [PATCH 07/12] spec file hackery OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=113 --- libvirt.spec | 83 ++++++++++++++----- ...suse.patch => use-init-script-redhat.patch | 48 ++++++----- 2 files changed, 89 insertions(+), 42 deletions(-) rename use-libvirt-guests-on-suse.patch => use-init-script-redhat.patch (83%) diff --git a/libvirt.spec b/libvirt.spec index 5616f42..c5ca547 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -337,7 +337,7 @@ Patch102: xen-pv-cdrom.patch Patch103: xend-disk-order.patch # Our patches Patch200: libvirtd-defaults.patch -Patch201: use-libvirt-guests-on-suse.patch +Patch201: use-init-script-redhat.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -459,15 +459,18 @@ Authors: %if ! %{with_qemu} %define _without_qemu --without-qemu %endif -%if ! %{with_lxc} -%define _without_lxc --without-lxc -%endif %if ! %{with_openvz} %define _without_openvz --without-openvz %endif +%if ! %{with_lxc} +%define _without_lxc --without-lxc +%endif %if ! %{with_vbox} %define _without_vbox --without-vbox %endif +%if ! %{with_xenapi} +%define _without_xenapi --without-xenapi +%endif %if ! %{with_uml} %define _without_uml --without-uml %endif @@ -477,9 +480,30 @@ Authors: %if ! %{with_esx} %define _without_esx --without-esx %endif +%if ! %{with_vmware} +%define _without_vmware --without-vmware +%endif %if ! %{with_libxl} %define _without_libxl --without-libxl %endif +%if ! %{with_libvirtd} +%define _without_libvirtd --without-libvirtd +%endif +%if ! %{with_storage_fs} +%define _without_storage_fs --without-storage-fs +%endif +%if ! %{with_storage_lvm} +%define _without_storage_lvm --without-storage-lvm +%endif +%if ! %{with_storage_iscsi} +%define _without_storage_iscsi --without-storage-iscsi +%endif +%if ! %{with_storage_disk} +%define _without_storage_disk --without-storage-disk +%endif +%if ! %{with_storage_mpath} +%define _without_storage_mpath --without-storage-mpath +%endif %if ! %{with_numactl} %define _without_numactl --without-numactl %endif @@ -528,19 +552,26 @@ export CFLAGS="$RPM_OPT_FLAGS" %configure --disable-static --with-pic \ %{?_without_xen} \ %{?_without_qemu} \ - %{?_without_lxc} \ %{?_without_openvz} \ + %{?_without_lxc} \ %{?_without_vbox} \ + %{?_without_xenapi} \ %{?_without_uml} \ %{?_without_phyp} \ %{?_without_esx} \ + %{?_without_vmware} \ %{?_without_libxl} \ + %{?_without_libvirtd} \ + %{?_without_storage_fs} \ + %{?_without_storage_lvm} \ + %{?_without_storage_iscsi} \ + %{?_without_storage_disk} \ + %{?_without_storage_mpath} \ %{?_without_numactl} \ %{?_without_selinux} \ %{?_without_apparmor} \ %{?_without_capng} \ %{?_without_netcf} \ - %{?_without_network} \ %{?_without_hal} \ %{?_without_udev} \ %{?_without_yajl} \ @@ -552,6 +583,7 @@ export CFLAGS="$RPM_OPT_FLAGS" %{?_without_libpcap} \ --libexecdir=%{_libdir}/%{name} \ --with-remote-pid-file=%{_localstatedir}/run/libvirtd.pid \ + --with-init-script=redhat \ ac_cv_path_MODPROBE=/sbin/modprobe \ ac_cv_path_UDEVADM=/sbin/udevadm \ ac_cv_path_SHOWMOUNT=/usr/sbin/showmount @@ -567,7 +599,7 @@ mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/libvirt rm $RPM_BUILD_ROOT%{_libdir}/*.*a $RPM_BUILD_ROOT%{py_sitedir}/*.*a %find_lang %{name} %if %{with_network} -install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/ +install -d -m 0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/libvirt/dnsmasq/ install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/ cp $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml \ $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml @@ -593,15 +625,10 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml %endif %if ! %{with_python} -rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-python-%{version} -%endif -%if %{client_only} -rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} +rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}-python %endif %if ! %{with_libvirtd} rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter -mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version}/html \ - $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-devel-%{version}/ %endif ln_dupes() @@ -622,9 +649,11 @@ ln_dupes() ) # init scripts mkdir -p $RPM_BUILD_ROOT/etc/init.d -install %SOURCE1 $RPM_BUILD_ROOT/etc/init.d/libvirtd -ln -s /etc/init.d/libvirtd $RPM_BUILD_ROOT/usr/sbin/rclibvirtd -ln -s /etc/init.d/libvirt-guests $RPM_BUILD_ROOT/usr/sbin/rclibvirt-guests +%if %{with_libvirtd} +install %SOURCE1 $RPM_BUILD_ROOT%{_sysconfdir}/init.d/libvirtd +ln -s /etc/init.d/libvirtd $RPM_BUILD_ROOT%{_sbindir}/rclibvirtd +%endif +ln -s /etc/init.d/libvirt-guests $RPM_BUILD_ROOT%{_sbindir}/rclibvirt-guests %clean rm -rf $RPM_BUILD_ROOT @@ -632,10 +661,9 @@ rm -rf $RPM_BUILD_ROOT %post /sbin/ldconfig %if %{with_libvirtd} -%if 0%{?sles_version} -%{fillup_and_insserv -f -y libvirtd} -%endif -if test $? != 0 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml +%if %{with_network} +# Install the default network if one doesn't exist +if test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml then UUID=`/usr/bin/uuidgen` sed -e "s,,\n $UUID," \ @@ -643,6 +671,12 @@ then > %{_sysconfdir}/libvirt/qemu/networks/default.xml fi %endif +%if 0%{?sles_version} +%{fillup_and_insserv -y libvirtd} +%else +%{fillup_only -n libvirtd} +%endif +%endif %{fillup_only -n libvirt-guests} %preun @@ -671,16 +705,18 @@ fi %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/ +%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/ %dir %{_datadir}/libvirt/networks/ %{_datadir}/libvirt/networks/default.xml %endif %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ %{_sysconfdir}/libvirt/nwfilter/*.xml +%{_localstatedir}/adm/fillup-templates/sysconfig.libvirtd %config /etc/init.d/libvirtd %{_sbindir}/rclibvirtd %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd -%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/ %dir %{_localstatedir}/lib/libvirt/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/images/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/boot/ @@ -717,10 +753,9 @@ fi %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ #%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ %endif -%if 0%{with_storage_disk} +%if %{with_storage_disk} %{_libdir}/%{name}/libvirt_parthelper %endif -%{_libdir}/%{name}/libvirt_iohelper %doc %{_mandir}/man8/libvirtd.8* %endif @@ -735,10 +770,12 @@ fi %{_bindir}/virsh %{_bindir}/virt-xml-validate %{_bindir}/virt-pki-validate +%dir %{_libdir}/%{name} %{_libdir}/lib*.so.* %{_localstatedir}/adm/fillup-templates/sysconfig.libvirt-guests %config /etc/init.d/libvirt-guests %{_sbindir}/rclibvirt-guests +%{_libdir}/%{name}/libvirt_iohelper %dir %{_datadir}/libvirt/ %dir %{_datadir}/libvirt/schemas/ diff --git a/use-libvirt-guests-on-suse.patch b/use-init-script-redhat.patch similarity index 83% rename from use-libvirt-guests-on-suse.patch rename to use-init-script-redhat.patch index eac70f6..d22afa6 100644 --- a/use-libvirt-guests-on-suse.patch +++ b/use-init-script-redhat.patch @@ -2,11 +2,9 @@ Index: libvirt-0.9.0/tools/Makefile.am =================================================================== --- libvirt-0.9.0.orig/tools/Makefile.am +++ libvirt-0.9.0/tools/Makefile.am -@@ -129,18 +129,18 @@ install-data-local: install-init +@@ -131,16 +131,17 @@ uninstall-local: uninstall-init - uninstall-local: uninstall-init - --if LIBVIRT_INIT_SCRIPT_RED_HAT + if LIBVIRT_INIT_SCRIPT_RED_HAT install-init: libvirt-guests.init - mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d + mkdir -p $(DESTDIR)$(sysconfdir)/init.d @@ -14,32 +12,20 @@ Index: libvirt-0.9.0/tools/Makefile.am - $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests - mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig + $(DESTDIR)$(sysconfdir)/init.d/libvirt-guests -+ mkdir -p $(DESTDIR)/var/adm/fillup-templates ++ mkdir -p $(DESTDIR)$(localstatedir)/adm/fillup-templates $(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \ - $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests -+ $(DESTDIR)/var/adm/fillup-templates/sysconfig.libvirt-guests ++ $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirt-guests uninstall-init: - rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests \ - $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests + rm -f $(DESTDIR)$(sysconfdir)/init.d/libvirt-guests \ + $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests \ -+ $(DESTDIR)/var/adm/fillup-templates/sysconfig.libvirt-guests ++ $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirt-guests BUILT_SOURCES += libvirt-guests.init -@@ -155,11 +155,6 @@ libvirt-guests.init: libvirt-guests.init - < $< > $@-t && \ - chmod a+x $@-t && \ - mv $@-t $@ --else --install-init: --uninstall-init: --libvirt-guests.init: --endif # LIBVIRT_INIT_SCRIPT_RED_HAT - - - CLEANFILES = $(bin_SCRIPTS) Index: libvirt-0.9.0/tools/libvirt-guests.sysconf =================================================================== --- libvirt-0.9.0.orig/tools/libvirt-guests.sysconf @@ -228,3 +214,27 @@ Index: libvirt-0.9.0/tools/libvirt-guests.init.sh esac -exit $RETVAL +rc_exit +Index: libvirt-0.9.0/daemon/Makefile.am +=================================================================== +--- libvirt-0.9.0.orig/daemon/Makefile.am ++++ libvirt-0.9.0/daemon/Makefile.am +@@ -280,16 +280,12 @@ install-logrotate: $(LOGROTATE_CONFS) + + if LIBVIRT_INIT_SCRIPT_RED_HAT + install-init: libvirtd.init +- mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d +- $(INSTALL_SCRIPT) libvirtd.init \ +- $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd +- mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig ++ mkdir -p $(DESTDIR)$(localstatedir)/adm/fillup-templates + $(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \ +- $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd ++ $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirtd + + uninstall-init: +- rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \ +- $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd ++ rm -f $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirtd + + BUILT_SOURCES += libvirtd.init + From 0f3580e2a8f039e5a991b61cac372f307ed3fd69eaf1c4fdb08d80a31b4500a0 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Mon, 11 Apr 2011 22:52:27 +0000 Subject: [PATCH 08/12] - Install log dir for libxl f7e9b448-libxl-build.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=114 --- f7e9b448-libxl-build.patch | 28 ++++++++++++++++++++++++++++ libvirt.changes | 6 ++++++ libvirt.spec | 4 +++- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 f7e9b448-libxl-build.patch diff --git a/f7e9b448-libxl-build.patch b/f7e9b448-libxl-build.patch new file mode 100644 index 0000000..7ccb401 --- /dev/null +++ b/f7e9b448-libxl-build.patch @@ -0,0 +1,28 @@ +commit f7e9b44812b3d3d8b16952d344eda187cb174c82 +Author: Jim Fehlig +Date: Thu Apr 7 16:01:58 2011 -0600 + + build: Install libxenlight log dir + + Add $localstatedir/log/libvirt/libxl when building libxenlight driver + +diff --git a/src/Makefile.am b/src/Makefile.am +index 9b54679..3649106 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -1275,6 +1275,7 @@ endif + if WITH_LIBXL + $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" + $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ++ $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" + endif + if WITH_UML + $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" +@@ -1316,6 +1317,7 @@ endif + if WITH_LIBXL + rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||: + rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||: ++ rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||: + endif + if WITH_UML + rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||: diff --git a/libvirt.changes b/libvirt.changes index 4f18814..3a81a6f 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 11 16:48:48 MDT 2011 - jfehlig@suse.de + +- Install log dir for libxl + f7e9b448-libxl-build.patch + ------------------------------------------------------------------- Mon Apr 4 16:02:23 MDT 2011 - jfehlig@novell.com diff --git a/libvirt.spec b/libvirt.spec index c5ca547..a642098 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -330,6 +330,7 @@ Recommends: device-mapper Source0: %{name}-%{version}.tar.bz2 Source1: libvirtd.init # Upstream patches +Patch0: f7e9b448-libxl-build.patch # Need to go upstream Patch100: xen-name-for-devid.patch Patch101: clone.patch @@ -445,6 +446,7 @@ Authors: %prep %setup -q +%patch0 -p1 %patch100 -p1 %patch101 %patch102 -p1 @@ -751,7 +753,7 @@ fi %endif %if %{with_libxl} %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ -#%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ %endif %if %{with_storage_disk} %{_libdir}/%{name}/libvirt_parthelper From 6eeb6b8fed62dafa279bdda473b4b01e9d0f88e125785578aaf0a4ea3b8dab0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Tue, 12 Apr 2011 13:07:43 +0000 Subject: [PATCH 09/12] Accepting request 66904 from home:coolo:branches:openSUSE:Factory OBS-URL: https://build.opensuse.org/request/show/66904 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=115 --- baselibs.conf | 2 ++ libvirt.changes | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/baselibs.conf b/baselibs.conf index df9efa9..630f65b 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1,2 +1,4 @@ libvirt-client + requires -libvirt- libvirt-devel + requires -libvirt- diff --git a/libvirt.changes b/libvirt.changes index 3a81a6f..7f6a5fd 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 12 05:11:22 UTC 2011 - coolo@opensuse.org + +- fix baselibs.conf not to requires source 32bit + ------------------------------------------------------------------- Mon Apr 11 16:48:48 MDT 2011 - jfehlig@suse.de From 914265551a5b6b048626844243282a3db866ae1809e214ab4e07b23aac5d5418 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Tue, 12 Apr 2011 21:28:26 +0000 Subject: [PATCH 10/12] - Move libvirt-iohelper from client to base package OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=116 --- 2999bb06-iohelper-libvirtd.patch | 33 ++++++++++++++++++++++++++++++++ libvirt.changes | 5 +++++ libvirt.spec | 4 +++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 2999bb06-iohelper-libvirtd.patch diff --git a/2999bb06-iohelper-libvirtd.patch b/2999bb06-iohelper-libvirtd.patch new file mode 100644 index 0000000..f7ef3cf --- /dev/null +++ b/2999bb06-iohelper-libvirtd.patch @@ -0,0 +1,33 @@ +commit 2999bb06f3fd448c65eba59a2f20128c9e46bf01 +Author: Wen Congyang +Date: Fri Apr 8 11:26:47 2011 +0800 + + do not build libvirt_iohelper when building without libvirtd + + The libexec program libvirt_iohelper is only for libvirtd. If we build rpm + without libvirtd, we will receive the following messages: + + Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/wency/rpmbuild/BUILDROOT/libvirt-0.9.0-1.el6.x86_64 + error: Installed (but unpackaged) file(s) found: + /usr/libexec/libvirt_iohelper + +diff --git a/src/Makefile.am b/src/Makefile.am +index 3649106..dce866e 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -1183,6 +1183,7 @@ EXTRA_DIST += $(LIBVIRT_QEMU_SYMBOL_FILE) + + libexec_PROGRAMS = + ++if WITH_LIBVIRTD + libexec_PROGRAMS += libvirt_iohelper + libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES) + libvirt_iohelper_LDFLAGS = $(WARN_LDFLAGS) $(AM_LDFLAGS) +@@ -1191,6 +1192,7 @@ libvirt_iohelper_LDADD = \ + ../gnulib/lib/libgnu.la + + libvirt_iohelper_CFLAGS = $(AM_CFLAGS) ++endif + + if WITH_STORAGE_DISK + if WITH_LIBVIRTD diff --git a/libvirt.changes b/libvirt.changes index 7f6a5fd..5ab8a4a 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 12 15:26:02 MDT 2011 - jfehlig@suse.de + +- Move libvirt-iohelper from client to base package + ------------------------------------------------------------------- Tue Apr 12 05:11:22 UTC 2011 - coolo@opensuse.org diff --git a/libvirt.spec b/libvirt.spec index a642098..c02e0a8 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -331,6 +331,7 @@ Source0: %{name}-%{version}.tar.bz2 Source1: libvirtd.init # Upstream patches Patch0: f7e9b448-libxl-build.patch +Patch1: 2999bb06-iohelper-libvirtd.patch # Need to go upstream Patch100: xen-name-for-devid.patch Patch101: clone.patch @@ -447,6 +448,7 @@ Authors: %prep %setup -q %patch0 -p1 +%patch1 -p1 %patch100 -p1 %patch101 %patch102 -p1 @@ -758,6 +760,7 @@ fi %if %{with_storage_disk} %{_libdir}/%{name}/libvirt_parthelper %endif +%{_libdir}/%{name}/libvirt_iohelper %doc %{_mandir}/man8/libvirtd.8* %endif @@ -777,7 +780,6 @@ fi %{_localstatedir}/adm/fillup-templates/sysconfig.libvirt-guests %config /etc/init.d/libvirt-guests %{_sbindir}/rclibvirt-guests -%{_libdir}/%{name}/libvirt_iohelper %dir %{_datadir}/libvirt/ %dir %{_datadir}/libvirt/schemas/ From 8603b1dd01b758075749fca5bcd227835a202290864127c8728481c1483d4f2c Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Wed, 4 May 2011 21:55:21 +0000 Subject: [PATCH 11/12] - Update to libvirt 0.9.1 RC2 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=117 --- 2999bb06-iohelper-libvirtd.patch | 33 -------------------- clone.patch | 4 +-- f7e9b448-libxl-build.patch | 28 ----------------- libvirt-0.9.0.tar.bz2 | 3 -- libvirt-0.9.1.tar.bz2 | 3 ++ libvirt.changes | 5 +++ libvirt.spec | 6 +--- use-init-script-redhat.patch | 52 ++++++++++++++++++-------------- xen-name-for-devid.patch | 18 +++++------ xen-pv-cdrom.patch | 10 +++--- xend-disk-order.patch | 10 +++--- 11 files changed, 59 insertions(+), 113 deletions(-) delete mode 100644 2999bb06-iohelper-libvirtd.patch delete mode 100644 f7e9b448-libxl-build.patch delete mode 100644 libvirt-0.9.0.tar.bz2 create mode 100644 libvirt-0.9.1.tar.bz2 diff --git a/2999bb06-iohelper-libvirtd.patch b/2999bb06-iohelper-libvirtd.patch deleted file mode 100644 index f7ef3cf..0000000 --- a/2999bb06-iohelper-libvirtd.patch +++ /dev/null @@ -1,33 +0,0 @@ -commit 2999bb06f3fd448c65eba59a2f20128c9e46bf01 -Author: Wen Congyang -Date: Fri Apr 8 11:26:47 2011 +0800 - - do not build libvirt_iohelper when building without libvirtd - - The libexec program libvirt_iohelper is only for libvirtd. If we build rpm - without libvirtd, we will receive the following messages: - - Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/wency/rpmbuild/BUILDROOT/libvirt-0.9.0-1.el6.x86_64 - error: Installed (but unpackaged) file(s) found: - /usr/libexec/libvirt_iohelper - -diff --git a/src/Makefile.am b/src/Makefile.am -index 3649106..dce866e 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -1183,6 +1183,7 @@ EXTRA_DIST += $(LIBVIRT_QEMU_SYMBOL_FILE) - - libexec_PROGRAMS = - -+if WITH_LIBVIRTD - libexec_PROGRAMS += libvirt_iohelper - libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES) - libvirt_iohelper_LDFLAGS = $(WARN_LDFLAGS) $(AM_LDFLAGS) -@@ -1191,6 +1192,7 @@ libvirt_iohelper_LDADD = \ - ../gnulib/lib/libgnu.la - - libvirt_iohelper_CFLAGS = $(AM_CFLAGS) -+endif - - if WITH_STORAGE_DISK - if WITH_LIBVIRTD diff --git a/clone.patch b/clone.patch index 20c19d8..23f40d0 100644 --- a/clone.patch +++ b/clone.patch @@ -24,7 +24,7 @@ Index: src/lxc/lxc_container.c VIR_FREE(stack); VIR_DEBUG("clone() completed, new container PID is %d", pid); -@@ -927,6 +934,7 @@ int lxcContainerAvailable(int features) +@@ -928,6 +935,7 @@ int lxcContainerAvailable(int features) char *childStack; char *stack; int childStatus; @@ -32,7 +32,7 @@ Index: src/lxc/lxc_container.c if (features & LXC_CONTAINER_FEATURE_USER) flags |= CLONE_NEWUSER; -@@ -934,14 +942,21 @@ int lxcContainerAvailable(int features) +@@ -935,14 +943,21 @@ int lxcContainerAvailable(int features) if (features & LXC_CONTAINER_FEATURE_NET) flags |= CLONE_NEWNET; diff --git a/f7e9b448-libxl-build.patch b/f7e9b448-libxl-build.patch deleted file mode 100644 index 7ccb401..0000000 --- a/f7e9b448-libxl-build.patch +++ /dev/null @@ -1,28 +0,0 @@ -commit f7e9b44812b3d3d8b16952d344eda187cb174c82 -Author: Jim Fehlig -Date: Thu Apr 7 16:01:58 2011 -0600 - - build: Install libxenlight log dir - - Add $localstatedir/log/libvirt/libxl when building libxenlight driver - -diff --git a/src/Makefile.am b/src/Makefile.am -index 9b54679..3649106 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -1275,6 +1275,7 @@ endif - if WITH_LIBXL - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" -+ $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" - endif - if WITH_UML - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" -@@ -1316,6 +1317,7 @@ endif - if WITH_LIBXL - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||: - rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||: -+ rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||: - endif - if WITH_UML - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||: diff --git a/libvirt-0.9.0.tar.bz2 b/libvirt-0.9.0.tar.bz2 deleted file mode 100644 index 7bb9325..0000000 --- a/libvirt-0.9.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c888aceb88f0ef194bfbb8292d7e08772be5e4373b1e000d1ab28b7c4d5831db -size 9848222 diff --git a/libvirt-0.9.1.tar.bz2 b/libvirt-0.9.1.tar.bz2 new file mode 100644 index 0000000..e397120 --- /dev/null +++ b/libvirt-0.9.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4c05557d3db282b24624024f427d0c494d38c996ba72a33e5c90936ea7f4285 +size 10043402 diff --git a/libvirt.changes b/libvirt.changes index 5ab8a4a..ff90bfc 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 4 15:49:12 MDT 2011 - jfehlig@novell.com + +- Update to libvirt 0.9.1 RC2 + ------------------------------------------------------------------- Tue Apr 12 15:26:02 MDT 2011 - jfehlig@suse.de diff --git a/libvirt.spec b/libvirt.spec index c02e0a8..66ded83 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -265,7 +265,7 @@ Url: http://libvirt.org/ License: LGPLv2.1+ Group: Development/Libraries/C and C++ AutoReqProv: yes -Version: 0.9.0 +Version: 0.9.1 Release: 1 Summary: A C toolkit to interract with the virtualization capabilities of Linux @@ -330,8 +330,6 @@ Recommends: device-mapper Source0: %{name}-%{version}.tar.bz2 Source1: libvirtd.init # Upstream patches -Patch0: f7e9b448-libxl-build.patch -Patch1: 2999bb06-iohelper-libvirtd.patch # Need to go upstream Patch100: xen-name-for-devid.patch Patch101: clone.patch @@ -447,8 +445,6 @@ Authors: %prep %setup -q -%patch0 -p1 -%patch1 -p1 %patch100 -p1 %patch101 %patch102 -p1 diff --git a/use-init-script-redhat.patch b/use-init-script-redhat.patch index d22afa6..deef77d 100644 --- a/use-init-script-redhat.patch +++ b/use-init-script-redhat.patch @@ -1,7 +1,7 @@ -Index: libvirt-0.9.0/tools/Makefile.am +Index: libvirt-0.9.1/tools/Makefile.am =================================================================== ---- libvirt-0.9.0.orig/tools/Makefile.am -+++ libvirt-0.9.0/tools/Makefile.am +--- libvirt-0.9.1.orig/tools/Makefile.am ++++ libvirt-0.9.1/tools/Makefile.am @@ -131,16 +131,17 @@ uninstall-local: uninstall-init if LIBVIRT_INIT_SCRIPT_RED_HAT @@ -26,11 +26,11 @@ Index: libvirt-0.9.0/tools/Makefile.am BUILT_SOURCES += libvirt-guests.init -Index: libvirt-0.9.0/tools/libvirt-guests.sysconf +Index: libvirt-0.9.1/tools/libvirt-guests.sysconf =================================================================== ---- libvirt-0.9.0.orig/tools/libvirt-guests.sysconf -+++ libvirt-0.9.0/tools/libvirt-guests.sysconf -@@ -1,15 +1,23 @@ +--- libvirt-0.9.1.orig/tools/libvirt-guests.sysconf ++++ libvirt-0.9.1/tools/libvirt-guests.sysconf +@@ -1,18 +1,28 @@ +## Path: System/Virtualization/libvirt + +## Type: string @@ -51,12 +51,18 @@ Index: libvirt-0.9.0/tools/libvirt-guests.sysconf -#ON_BOOT=start +ON_BOOT=start ++## Type: integer ++## Default: 0 + # number of seconds to wait between each guest start +-#START_DELAY=0 ++START_DELAY=0 + +## Type: string +## Default: suspend # action taken on host shutdown # - suspend all running guests are suspended using virsh managedsave # - shutdown all running guests are asked to shutdown. Please be careful with -@@ -18,7 +26,9 @@ +@@ -21,7 +31,9 @@ # which just needs a long time to shutdown. When setting # ON_SHUTDOWN=shutdown, you must also set SHUTDOWN_TIMEOUT to a # value suitable for your guests. @@ -68,10 +74,10 @@ Index: libvirt-0.9.0/tools/libvirt-guests.sysconf # number of seconds we're willing to wait for a guest to shut down -#SHUTDOWN_TIMEOUT=0 +SHUTDOWN_TIMEOUT=120 -Index: libvirt-0.9.0/tools/libvirt-guests.init.sh +Index: libvirt-0.9.1/tools/libvirt-guests.init.sh =================================================================== ---- libvirt-0.9.0.orig/tools/libvirt-guests.init.sh -+++ libvirt-0.9.0/tools/libvirt-guests.init.sh +--- libvirt-0.9.1.orig/tools/libvirt-guests.init.sh ++++ libvirt-0.9.1/tools/libvirt-guests.init.sh @@ -4,10 +4,10 @@ # ### BEGIN INIT INFO @@ -105,7 +111,7 @@ Index: libvirt-0.9.0/tools/libvirt-guests.init.sh # Source gettext library. # Make sure this file is recognized as having translations: _("dummy") . "@bindir@"/gettext.sh -@@ -49,12 +48,10 @@ test -f "$sysconfdir"/sysconfig/libvirt- +@@ -50,12 +49,10 @@ test -f "$sysconfdir"/sysconfig/libvirt- LISTFILE="$localstatedir"/lib/libvirt/libvirt-guests VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests @@ -119,7 +125,7 @@ Index: libvirt-0.9.0/tools/libvirt-guests.init.sh return 1 else return 0 -@@ -76,12 +73,31 @@ run_virsh_c() { +@@ -77,12 +74,31 @@ run_virsh_c() { ( export LC_ALL=C; run_virsh "$@" ) } @@ -152,7 +158,7 @@ Index: libvirt-0.9.0/tools/libvirt-guests.init.sh return 1 fi -@@ -89,7 +105,7 @@ list_guests() { +@@ -90,7 +106,7 @@ list_guests() { for id in $(echo "$list" | awk 'NR > 2 {print $1}'); do uuid=$(run_virsh_c "$uri" dominfo "$id" | awk '/^UUID:/{print $2}') if [ -z "$uuid" ]; then @@ -161,7 +167,7 @@ Index: libvirt-0.9.0/tools/libvirt-guests.init.sh return 1 fi uuids="$uuids $uuid" -@@ -116,7 +132,7 @@ guest_is_on() { +@@ -117,7 +133,7 @@ guest_is_on() { guest_running=false info=$(run_virsh_c "$uri" dominfo "$uuid") if [ $? -ne 0 ]; then @@ -170,7 +176,7 @@ Index: libvirt-0.9.0/tools/libvirt-guests.init.sh return 1 fi -@@ -157,6 +173,12 @@ start() { +@@ -159,6 +175,12 @@ start() { continue fi @@ -183,7 +189,7 @@ Index: libvirt-0.9.0/tools/libvirt-guests.init.sh eval_gettext "Resuming guests on \$uri URI..."; echo for guest in $list; do name=$(guest_name "$uri" "$guest") -@@ -238,7 +260,7 @@ stop() { +@@ -245,7 +267,7 @@ stop() { if [ $SHUTDOWN_TIMEOUT -le 0 ]; then gettext "Shutdown action requested but SHUTDOWN_TIMEOUT was not set" echo @@ -192,7 +198,7 @@ Index: libvirt-0.9.0/tools/libvirt-guests.init.sh return fi fi -@@ -308,14 +330,13 @@ gueststatus() { +@@ -315,14 +337,13 @@ gueststatus() { rh_status() { if [ -f "$LISTFILE" ]; then gettext "stopped, with saved guests"; echo @@ -208,17 +214,17 @@ Index: libvirt-0.9.0/tools/libvirt-guests.init.sh fi } -@@ -359,4 +380,4 @@ case "$1" in +@@ -366,4 +387,4 @@ case "$1" in usage ;; esac -exit $RETVAL +rc_exit -Index: libvirt-0.9.0/daemon/Makefile.am +Index: libvirt-0.9.1/daemon/Makefile.am =================================================================== ---- libvirt-0.9.0.orig/daemon/Makefile.am -+++ libvirt-0.9.0/daemon/Makefile.am -@@ -280,16 +280,12 @@ install-logrotate: $(LOGROTATE_CONFS) +--- libvirt-0.9.1.orig/daemon/Makefile.am ++++ libvirt-0.9.1/daemon/Makefile.am +@@ -281,16 +281,12 @@ install-logrotate: $(LOGROTATE_CONFS) if LIBVIRT_INIT_SCRIPT_RED_HAT install-init: libvirtd.init diff --git a/xen-name-for-devid.patch b/xen-name-for-devid.patch index a9755b2..cd96daa 100644 --- a/xen-name-for-devid.patch +++ b/xen-name-for-devid.patch @@ -13,10 +13,10 @@ Date: Wed Jan 27 16:11:41 2010 -0700 This approach allows removing a disk when domain is inactive. We obviously can't search xenstore when the domain is inactive. -Index: libvirt-0.9.0/src/xen/xend_internal.c +Index: libvirt-0.9.1/src/xen/xend_internal.c =================================================================== ---- libvirt-0.9.0.orig/src/xen/xend_internal.c -+++ libvirt-0.9.0/src/xen/xend_internal.c +--- libvirt-0.9.1.orig/src/xen/xend_internal.c ++++ libvirt-0.9.1/src/xen/xend_internal.c @@ -62,6 +62,7 @@ static int @@ -25,7 +25,7 @@ Index: libvirt-0.9.0/src/xen/xend_internal.c virDomainDeviceDefPtr dev, char *class, char *ref, -@@ -2725,7 +2726,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr +@@ -2731,7 +2732,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr sexpr = virBufferContentAndReset(&buf); @@ -34,7 +34,7 @@ Index: libvirt-0.9.0/src/xen/xend_internal.c /* device doesn't exist, define it */ ret = xend_op(domain->conn, domain->name, "op", "device_create", "config", sexpr, NULL); -@@ -2848,7 +2849,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr +@@ -2854,7 +2855,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr sexpr = virBufferContentAndReset(&buf); @@ -43,7 +43,7 @@ Index: libvirt-0.9.0/src/xen/xend_internal.c virXendError(VIR_ERR_OPERATION_INVALID, "%s", _("requested device does not exist")); goto cleanup; -@@ -2941,7 +2942,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr +@@ -2947,7 +2948,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr def, xml, VIR_DOMAIN_XML_INACTIVE))) goto cleanup; @@ -52,7 +52,7 @@ Index: libvirt-0.9.0/src/xen/xend_internal.c goto cleanup; if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) { -@@ -3883,6 +3884,7 @@ struct xenUnifiedDriver xenDaemonDriver +@@ -3900,6 +3901,7 @@ struct xenUnifiedDriver xenDaemonDriver */ static int virDomainXMLDevID(virDomainPtr domain, @@ -60,7 +60,7 @@ Index: libvirt-0.9.0/src/xen/xend_internal.c virDomainDeviceDefPtr dev, char *class, char *ref, -@@ -3891,8 +3893,12 @@ virDomainXMLDevID(virDomainPtr domain, +@@ -3908,8 +3910,12 @@ virDomainXMLDevID(virDomainPtr domain, xenUnifiedPrivatePtr priv = domain->conn->privateData; char *xref; char *tmp; @@ -73,7 +73,7 @@ Index: libvirt-0.9.0/src/xen/xend_internal.c if (dev->data.disk->driverName && STREQ(dev->data.disk->driverName, "tap")) strcpy(class, "tap"); -@@ -3902,19 +3908,21 @@ virDomainXMLDevID(virDomainPtr domain, +@@ -3919,19 +3925,21 @@ virDomainXMLDevID(virDomainPtr domain, else strcpy(class, "vbd"); diff --git a/xen-pv-cdrom.patch b/xen-pv-cdrom.patch index 9824422..14cd7cb 100644 --- a/xen-pv-cdrom.patch +++ b/xen-pv-cdrom.patch @@ -1,8 +1,8 @@ -Index: libvirt-0.9.0/src/xenxs/xen_sxpr.c +Index: libvirt-0.9.1/src/xenxs/xen_sxpr.c =================================================================== ---- libvirt-0.9.0.orig/src/xenxs/xen_sxpr.c -+++ libvirt-0.9.0/src/xenxs/xen_sxpr.c -@@ -326,7 +326,7 @@ error: +--- libvirt-0.9.1.orig/src/xenxs/xen_sxpr.c ++++ libvirt-0.9.1/src/xenxs/xen_sxpr.c +@@ -324,7 +324,7 @@ error: static int xenParseSxprDisks(virDomainDefPtr def, const struct sexpr *root, @@ -11,7 +11,7 @@ Index: libvirt-0.9.0/src/xenxs/xen_sxpr.c int xendConfigVersion) { const struct sexpr *cur, *node; -@@ -373,7 +373,6 @@ xenParseSxprDisks(virDomainDefPtr def, +@@ -371,7 +371,6 @@ xenParseSxprDisks(virDomainDefPtr def, /* There is a case without the uname to the CD-ROM device */ offset = strchr(dst, ':'); if (!offset || diff --git a/xend-disk-order.patch b/xend-disk-order.patch index 454c284..9e59697 100644 --- a/xend-disk-order.patch +++ b/xend-disk-order.patch @@ -1,8 +1,8 @@ -Index: libvirt-0.9.0/src/xenxs/xen_sxpr.c +Index: libvirt-0.9.1/src/xenxs/xen_sxpr.c =================================================================== ---- libvirt-0.9.0.orig/src/xenxs/xen_sxpr.c -+++ libvirt-0.9.0/src/xenxs/xen_sxpr.c -@@ -344,20 +344,24 @@ xenParseSxprDisks(virDomainDefPtr def, +--- libvirt-0.9.1.orig/src/xenxs/xen_sxpr.c ++++ libvirt-0.9.1/src/xenxs/xen_sxpr.c +@@ -342,20 +342,24 @@ xenParseSxprDisks(virDomainDefPtr def, const char *src = NULL; const char *dst = NULL; const char *mode = NULL; @@ -27,7 +27,7 @@ Index: libvirt-0.9.0/src/xenxs/xen_sxpr.c } if (VIR_ALLOC(disk) < 0) -@@ -482,7 +486,13 @@ xenParseSxprDisks(virDomainDefPtr def, +@@ -480,7 +484,13 @@ xenParseSxprDisks(virDomainDefPtr def, if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0) goto no_memory; From 492e1ecde298b4198df69c628b60fca6e2487d81071706a3022c4dfada8d8c6c Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Fri, 6 May 2011 14:29:19 +0000 Subject: [PATCH 12/12] Update to libvirt 0.9.1 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=118 --- libvirt-0.9.1.tar.bz2 | 4 ++-- libvirt.changes | 9 +++++++-- libvirt.spec | 6 ++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/libvirt-0.9.1.tar.bz2 b/libvirt-0.9.1.tar.bz2 index e397120..c13857a 100644 --- a/libvirt-0.9.1.tar.bz2 +++ b/libvirt-0.9.1.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c4c05557d3db282b24624024f427d0c494d38c996ba72a33e5c90936ea7f4285 -size 10043402 +oid sha256:2a2ff6a4e1855ca0d696c1c0d07674546ba893f8d74e3850e2d368e1f5dfba0d +size 10346535 diff --git a/libvirt.changes b/libvirt.changes index ff90bfc..11418d2 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,7 +1,12 @@ ------------------------------------------------------------------- -Wed May 4 15:49:12 MDT 2011 - jfehlig@novell.com +Thu May 5 19:01:54 MDT 2011 - jfehlig@suse.de -- Update to libvirt 0.9.1 RC2 +- Update to libvirt 0.9.1 + - support various persistent domain updates + - improvements on memory APIs + - Add virDomainEventRebootNew + - various improvements to libxl drive + - Spice: support audio, images and stream compression ------------------------------------------------------------------- Tue Apr 12 15:26:02 MDT 2011 - jfehlig@suse.de diff --git a/libvirt.spec b/libvirt.spec index 66ded83..8e1faea 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -90,6 +90,12 @@ %define with_libxl 0 %endif +# libxenlight driver requires Xen >= 4.1, which is only +# available in openSUSE >= 12.1 or SLE >= 11sp2 +%if 0%{?suse_version} < 1210 +%define with_libxl 0 +%endif + # numactl only on x86_64 and ia64 %ifnarch x86_64 ia64 %define with_numactl 0