From e214671409746e4d7f57c97d34db071b77a3390b4b7cd5c5925cc87252338003 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Mon, 9 Jan 2012 22:51:36 +0000 Subject: [PATCH] - Update to libvirt 0.9.9 - Add new API virDomain{S,G}etInterfaceParameters - Add new API virDomain{G,S}etNumaParameters - Add support for ppc64 qemu - Support Xen domctl v8 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=188 --- 10404671-systemd-build-fix.patch | 210 ---------------------- 478a4d07-systemd-build-fix.patch | 81 --------- 9ae4ac7a-PolicyKit.patch | 79 +++++++++ AF_PACKET.patch | 12 +- ae1232b2-CVE-2011-4600.patch | 55 ------ install-apparmor-profiles.patch | 28 +-- libvirt-0.9.8.tar.bz2 | 3 - libvirt-0.9.9.tar.bz2 | 3 + libvirt-suse-netcontrol.patch | 48 ++--- libvirt.changes | 9 + libvirt.spec | 13 +- libvirtd-defaults.patch | 16 +- relax-qemu-usergroup-check.patch | 6 +- suse-qemu-conf.patch | 6 +- use-init-script-redhat.patch | 30 ++-- xen-domctl-ver8.patch | 294 ------------------------------- xen-name-for-devid.patch | 18 +- xen-pv-cdrom.patch | 6 +- 18 files changed, 180 insertions(+), 737 deletions(-) delete mode 100644 10404671-systemd-build-fix.patch delete mode 100644 478a4d07-systemd-build-fix.patch create mode 100644 9ae4ac7a-PolicyKit.patch delete mode 100644 ae1232b2-CVE-2011-4600.patch delete mode 100644 libvirt-0.9.8.tar.bz2 create mode 100644 libvirt-0.9.9.tar.bz2 delete mode 100644 xen-domctl-ver8.patch diff --git a/10404671-systemd-build-fix.patch b/10404671-systemd-build-fix.patch deleted file mode 100644 index bfc8073..0000000 --- a/10404671-systemd-build-fix.patch +++ /dev/null @@ -1,210 +0,0 @@ -commit 104046712f10106574f08661a395891dc5c5ca3d -Author: Eric Blake -Date: Fri Dec 9 11:06:19 2011 -0700 - - build: follow directory install conventions - - Commit 4d9e51f6 fixed a 'make uninstall' failure, but failed - to follow other conventions already present in src/Makefile.am. - In particular, we prefer MKDIR_P over mkdir -p, and should - have a matching rmdir during uninstall for every directory - created during install (the idea being that uninstall in a - DESTDIR should be clean, while installation in the final - system should not fail with non-empty directories left behind). - - * tools/Makefile.am (install-sysconfig, install-initscript) - (install-systemd): Use MKDIR_P. - (uninstall-sysconfig, uninstall-initscript, uninstall-systemd): - Also remove directories. - * daemon/Makefile.am (install-data-local, install-data-polkit) - (install-logrotate, install-sysconfig, install-sysctl) - (install-init-redhat, install-init-upstart, install-init-systemd) - (install-data-sasl): Use MKDIR_P. - (uninstall-data-polkit, uninstall-sysconfig, uninstall-sysctl) - (uninstall-init-redhat, uninstall-init-upstart) - (uninstall-init-systemd): Also remove directory. - (uninstall-logrotate): New rule. - (uninstall-local): Add uninstall-logrotate. - -Index: libvirt-0.9.8/daemon/Makefile.am -=================================================================== ---- libvirt-0.9.8.orig/daemon/Makefile.am -+++ libvirt-0.9.8/daemon/Makefile.am -@@ -173,23 +173,24 @@ endif - install-data-local: install-init-redhat install-init-systemd install-init-upstart \ - install-data-sasl install-data-polkit \ - install-logrotate install-sysctl -- mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt -- mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt -- mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt -+ $(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt \ -+ $(DESTDIR)$(localstatedir)/run/libvirt \ -+ $(DESTDIR)$(localstatedir)/lib/libvirt - - uninstall-local:: uninstall-init-redhat uninstall-init-systemd uninstall-init-upstart \ - uninstall-data-sasl uninstall-data-polkit \ -- uninstall-sysctl -+ uninstall-logrotate uninstall-sysctl - rmdir $(DESTDIR)$(localstatedir)/log/libvirt || : - rmdir $(DESTDIR)$(localstatedir)/run/libvirt || : - rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || : - - if HAVE_POLKIT - install-data-polkit:: -- mkdir -p $(DESTDIR)$(policydir) -+ $(MKDIR_P) $(DESTDIR)$(policydir) - $(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy - uninstall-data-polkit:: - rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy -+ rmdir $(DESTDIR)$(policydir) || : - else - install-data-polkit:: - uninstall-data-polkit:: -@@ -228,41 +229,54 @@ libvirtd.uml.logrotate: libvirtd.uml.log - mv $@-t $@ - - install-logrotate: $(LOGROTATE_CONFS) -- mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/ -- mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/ -- mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/ -- mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/ -+ $(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt/qemu/ \ -+ $(DESTDIR)$(localstatedir)/log/libvirt/lxc/ \ -+ $(DESTDIR)$(localstatedir)/log/libvirt/uml/ \ -+ $(DESTDIR)$(sysconfdir)/logrotate.d/ - $(INSTALL_DATA) libvirtd.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd - $(INSTALL_DATA) libvirtd.qemu.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu - $(INSTALL_DATA) libvirtd.lxc.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc - $(INSTALL_DATA) libvirtd.uml.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml - -+uninstall-logrotate: -+ rm -f $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd \ -+ $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu \ -+ $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc \ -+ $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml -+ rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || : -+ rmdir $(DESTDIR)$(localstatedir)/log/libvirt/lxc || : -+ rmdir $(DESTDIR)$(localstatedir)/log/libvirt/uml || : -+ rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || : -+ - install-sysconfig: -- mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig -+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig - $(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \ - $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd - uninstall-sysconfig: - rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd -+ rmdir $(DESTDIR)$(sysconfdir)/sysconfig || : - - install-sysctl: -- mkdir -p $(DESTDIR)$(sysconfdir)/sysctl.d -+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d - $(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \ - $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd - - uninstall-sysctl: - rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd -+ rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || : - - if LIBVIRT_INIT_SCRIPT_RED_HAT - - BUILT_SOURCES += libvirtd.init - - install-init-redhat: install-sysconfig libvirtd.init -- mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d -+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d - $(INSTALL_SCRIPT) libvirtd.init \ - $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd - - uninstall-init-redhat: uninstall-sysconfig - rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd -+ rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || : - else - install-init-redhat: - uninstall-init-redhat: -@@ -272,12 +286,13 @@ endif # LIBVIRT_INIT_SCRIPT_RED_HAT - if LIBVIRT_INIT_SCRIPT_UPSTART - - install-init-upstart: install-sysconfig -- mkdir -p $(DESTDIR)$(sysconfdir)/event.d -+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d - $(INSTALL_SCRIPT) libvirtd.upstart \ - $(DESTDIR)$(sysconfdir)/event.d/libvirtd - - uninstall-init-upstart: uninstall-sysconfig - rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd -+ rmdir $(DESTDIR)$(sysconfdir)/event.d || : - else - install-init-upstart: - uninstall-init-upstart: -@@ -291,12 +306,13 @@ SYSTEMD_UNIT_DIR = /lib/systemd/system - BUILT_SOURCES += libvirtd.service - - install-init-systemd: install-sysconfig libvirtd.service -- mkdir -p $(DESTDIR)$(SYSTEMD_UNIT_DIR) -+ $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) - $(INSTALL_SCRIPT) libvirtd.service \ - $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service - - uninstall-init-systemd: uninstall-sysconfig - rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service -+ rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || : - else - install-init-systemd: - uninstall-init-systemd: -@@ -346,7 +362,7 @@ $(srcdir)/libvirtd.8.in: libvirtd.pod.in - # the WITH_LIBVIRTD conditional - if HAVE_SASL - install-data-sasl: -- mkdir -p $(DESTDIR)$(sysconfdir)/sasl2/ -+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/ - $(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf - - uninstall-data-sasl: -Index: libvirt-0.9.8/tools/Makefile.am -=================================================================== ---- libvirt-0.9.8.orig/tools/Makefile.am -+++ libvirt-0.9.8/tools/Makefile.am -@@ -153,23 +153,24 @@ install-data-local: install-init install - uninstall-local: uninstall-init uninstall-systemd - - install-sysconfig: -- mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig -+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig - $(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \ - $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests - - uninstall-sysconfig: - rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests -+ rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||: - - EXTRA_DIST += libvirt-guests.init.sh - - install-initscript: libvirt-guests.init -- mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d -+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d - $(INSTALL_SCRIPT) libvirt-guests.init \ - $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests - - uninstall-initscript: - rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests -- -+ rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d ||: - - - if LIBVIRT_INIT_SCRIPT_RED_HAT -@@ -201,12 +202,13 @@ SYSTEMD_UNIT_DIR = /lib/systemd/system - - if LIBVIRT_INIT_SCRIPT_SYSTEMD - install-systemd: libvirt-guests.service install-initscript install-sysconfig -- mkdir -p $(DESTDIR)$(SYSTEMD_UNIT_DIR) -+ $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) - $(INSTALL_SCRIPT) libvirt-guests.service \ - $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service - - uninstall-systemd: uninstall-initscript uninstall-sysconfig - rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service -+ rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||: - - BUILT_SOURCES += libvirt-guests.service - diff --git a/478a4d07-systemd-build-fix.patch b/478a4d07-systemd-build-fix.patch deleted file mode 100644 index 2a14444..0000000 --- a/478a4d07-systemd-build-fix.patch +++ /dev/null @@ -1,81 +0,0 @@ -commit 478a4d07ac489e9a52defe65290f1aeedc92393a -Author: Daniel P. Berrange -Date: Thu Dec 8 13:30:24 2011 +0000 - - Fix installation of libvirt-guests.service - - The installation rules for the libvirt-guests.service were - totally broken - - - Installing in the wrong location - - The location was not overridable - - The install-systemd rule was not invoked anywhere - - The install-systemd rule was not invoking install-initscript - which it depends on - - The installed service file lacked a .service extension - - * tools/Makefile.am: Fix install of libvirt-guests.service - -Index: libvirt-0.9.8/tools/Makefile.am -=================================================================== ---- libvirt-0.9.8.orig/tools/Makefile.am -+++ libvirt-0.9.8/tools/Makefile.am -@@ -148,9 +148,9 @@ endif - virsh.1: virsh.pod - $(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@ - --install-data-local: install-init -+install-data-local: install-init install-systemd - --uninstall-local: uninstall-init -+uninstall-local: uninstall-init uninstall-systemd - - install-sysconfig: - mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig -@@ -162,17 +162,20 @@ uninstall-sysconfig: - - EXTRA_DIST += libvirt-guests.init.sh - --if LIBVIRT_INIT_SCRIPT_RED_HAT --install-init: libvirt-guests.init install-sysconfig -+install-initscript: libvirt-guests.init - mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d - $(INSTALL_SCRIPT) libvirt-guests.init \ - $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests - --uninstall-init: install-sysconfig -+uninstall-initscript: - rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests - --BUILT_SOURCES += libvirt-guests.init - -+ -+if LIBVIRT_INIT_SCRIPT_RED_HAT -+BUILT_SOURCES += libvirt-guests.init -+install-init: install-sysconfig install-initscript -+uninstall-init: uninstall-sysconfig uninstall-initscript - else - install-init: - uninstall-init: -@@ -194,14 +197,16 @@ libvirt-guests.init: libvirt-guests.init - - EXTRA_DIST += libvirt-guests.service.in - -+SYSTEMD_UNIT_DIR = /lib/systemd/system -+ - if LIBVIRT_INIT_SCRIPT_SYSTEMD --install-systemd: libvirt-guests.service install-sysconfig -- mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/systemd.d -+install-systemd: libvirt-guests.service install-initscript install-sysconfig -+ mkdir -p $(DESTDIR)$(SYSTEMD_UNIT_DIR) - $(INSTALL_SCRIPT) libvirt-guests.service \ -- $(DESTDIR)$(sysconfdir)/rc.d/systemd.d/libvirt-guests -+ $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service - --uninstall-systemd: install-sysconfig -- rm -f $(DESTDIR)$(sysconfdir)/rc.d/systemd.d/libvirt-guests -+uninstall-systemd: uninstall-initscript uninstall-sysconfig -+ rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service - - BUILT_SOURCES += libvirt-guests.service - diff --git a/9ae4ac7a-PolicyKit.patch b/9ae4ac7a-PolicyKit.patch new file mode 100644 index 0000000..b01b09a --- /dev/null +++ b/9ae4ac7a-PolicyKit.patch @@ -0,0 +1,79 @@ +commit 9ae4ac7ac07d872cd32d0a3a1b1b44730b04bda7 +Author: Jim Fehlig +Date: Tue Jan 3 11:35:06 2012 -0700 + + PolicyKit: Check auth before asking client to obtain it + + I previously mentioned [1] a PolicyKit issue where libvirt would + proceed with authentication even though polkit-auth failed: + + testusr xen134:~> virsh list --all + Attempting to obtain authorization for org.libvirt.unix.manage. + polkit-grant-helper: given auth type (8 -> yes) is bogus + Failed to obtain authorization for org.libvirt.unix.manage. + Id Name State + ---------------------------------- + 0 Domain-0 running + - sles11sp1-pv shut off + + AFAICT, libvirt attempts to obtain a privilege it already has, + causing polkit-auth to fail with above message. Instead of calling + obtain and then checking auth, IMO the workflow should be for the + server to check auth first, and if that fails ask the client to + obtain it and check again. This workflow also allows for checking + only successful exit of polkit-auth in virConnectAuthGainPolkit(). + + [1] https://www.redhat.com/archives/libvir-list/2011-December/msg00837.html + +Index: libvirt-0.9.9/src/libvirt.c +=================================================================== +--- libvirt-0.9.9.orig/src/libvirt.c ++++ libvirt-0.9.9/src/libvirt.c +@@ -119,7 +119,7 @@ static int virConnectAuthGainPolkit(cons + + cmd = virCommandNewArgList(POLKIT_AUTH, "--obtain", privilege, NULL); + if (virCommandRun(cmd, &status) < 0 || +- status > 1) ++ status > 0) + goto cleanup; + + ret = 0; +Index: libvirt-0.9.9/src/remote/remote_driver.c +=================================================================== +--- libvirt-0.9.9.orig/src/remote/remote_driver.c ++++ libvirt-0.9.9/src/remote/remote_driver.c +@@ -3121,6 +3121,14 @@ remoteAuthPolkit (virConnectPtr conn, st + }; + VIR_DEBUG("Client initialize PolicyKit-0 authentication"); + ++ /* Check auth first and if it succeeds we are done. */ ++ memset (&ret, 0, sizeof ret); ++ if (call (conn, priv, 0, REMOTE_PROC_AUTH_POLKIT, ++ (xdrproc_t) xdr_void, (char *)NULL, ++ (xdrproc_t) xdr_remote_auth_polkit_ret, (char *) &ret) == 0) ++ goto out; ++ ++ /* Auth failed. Ask client to obtain it and check again. */ + if (auth && auth->cb) { + /* Check if the necessary credential type for PolicyKit is supported */ + for (i = 0 ; i < auth->ncredtype ; i++) { +@@ -3138,9 +3146,11 @@ remoteAuthPolkit (virConnectPtr conn, st + } + } else { + VIR_DEBUG("Client auth callback does not support PolicyKit"); ++ return -1; + } + } else { + VIR_DEBUG("No auth callback provided"); ++ return -1; + } + + memset (&ret, 0, sizeof ret); +@@ -3150,6 +3160,7 @@ remoteAuthPolkit (virConnectPtr conn, st + return -1; /* virError already set by call */ + } + ++out: + VIR_DEBUG("PolicyKit-0 authentication complete"); + return 0; + } diff --git a/AF_PACKET.patch b/AF_PACKET.patch index c654459..ec87945 100644 --- a/AF_PACKET.patch +++ b/AF_PACKET.patch @@ -1,7 +1,7 @@ -Index: libvirt-0.9.8/src/util/virnetdev.c +Index: libvirt-0.9.9/src/util/virnetdev.c =================================================================== ---- libvirt-0.9.8.orig/src/util/virnetdev.c -+++ libvirt-0.9.8/src/util/virnetdev.c +--- libvirt-0.9.9.orig/src/util/virnetdev.c ++++ libvirt-0.9.9/src/util/virnetdev.c @@ -84,7 +84,7 @@ static int virNetDevSetupControlFull(con static int virNetDevSetupControl(const char *ifname, struct ifreq *ifr) @@ -11,10 +11,10 @@ Index: libvirt-0.9.8/src/util/virnetdev.c } #endif -Index: libvirt-0.9.8/src/util/virnetdevbridge.c +Index: libvirt-0.9.9/src/util/virnetdevbridge.c =================================================================== ---- libvirt-0.9.8.orig/src/util/virnetdevbridge.c -+++ libvirt-0.9.8/src/util/virnetdevbridge.c +--- libvirt-0.9.9.orig/src/util/virnetdevbridge.c ++++ libvirt-0.9.9/src/util/virnetdevbridge.c @@ -84,7 +84,7 @@ static int virNetDevSetupControlFull(con static int virNetDevSetupControl(const char *ifname, struct ifreq *ifr) diff --git a/ae1232b2-CVE-2011-4600.patch b/ae1232b2-CVE-2011-4600.patch deleted file mode 100644 index 1559b88..0000000 --- a/ae1232b2-CVE-2011-4600.patch +++ /dev/null @@ -1,55 +0,0 @@ -commit ae1232b298323dd7bef909426e2ebafa6bca9157 -Author: Laine Stump -Date: Tue Dec 6 15:13:50 2011 -0500 - - network: don't add iptables rules for externally managed networks - - This patch addresses https://bugzilla.redhat.com/show_bug.cgi?id=760442 - - When a network has any forward type other than route, nat or none, the - network configuration should be done completely external to libvirt - - libvirt only uses these types to allow configuring guests in a manner - that isn't tied to a specific host (all the host-specific information, - in particular interface names, port profile data, and bandwidth - configuration is in the network definition, and the guest - configuration only references it). - - Due to a bug in the bridge network driver, libvirt was adding iptables - rules for networks with forward type='bridge' etc. any time libvirtd - was restarted while one of these networks was active. - - This patch eliminates that error by only "reloading" iptables rules if - forward type is route, nat, or none. - -Index: libvirt-0.9.8/src/network/bridge_driver.c -=================================================================== ---- libvirt-0.9.8.orig/src/network/bridge_driver.c -+++ libvirt-0.9.8/src/network/bridge_driver.c -@@ -1470,14 +1470,22 @@ networkReloadIptablesRules(struct networ - VIR_INFO("Reloading iptables rules"); - - for (i = 0 ; i < driver->networks.count ; i++) { -- virNetworkObjLock(driver->networks.objs[i]); -- if (virNetworkObjIsActive(driver->networks.objs[i])) { -- networkRemoveIptablesRules(driver, driver->networks.objs[i]); -- if (networkAddIptablesRules(driver, driver->networks.objs[i]) < 0) { -+ virNetworkObjPtr network = driver->networks.objs[i]; -+ -+ virNetworkObjLock(network); -+ if (virNetworkObjIsActive(network) && -+ ((network->def->forwardType == VIR_NETWORK_FORWARD_NONE) || -+ (network->def->forwardType == VIR_NETWORK_FORWARD_NAT) || -+ (network->def->forwardType == VIR_NETWORK_FORWARD_ROUTE))) { -+ /* Only the three L3 network types that are configured by libvirt -+ * need to have iptables rules reloaded. -+ */ -+ networkRemoveIptablesRules(driver, network); -+ if (networkAddIptablesRules(driver, network) < 0) { - /* failed to add but already logged */ - } - } -- virNetworkObjUnlock(driver->networks.objs[i]); -+ virNetworkObjUnlock(network); - } - } - diff --git a/install-apparmor-profiles.patch b/install-apparmor-profiles.patch index 4e39d86..0591162 100644 --- a/install-apparmor-profiles.patch +++ b/install-apparmor-profiles.patch @@ -1,7 +1,7 @@ -Index: libvirt-0.9.8/examples/apparmor/Makefile.am +Index: libvirt-0.9.9/examples/apparmor/Makefile.am =================================================================== ---- libvirt-0.9.8.orig/examples/apparmor/Makefile.am -+++ libvirt-0.9.8/examples/apparmor/Makefile.am +--- libvirt-0.9.9.orig/examples/apparmor/Makefile.am ++++ libvirt-0.9.9/examples/apparmor/Makefile.am @@ -1,8 +1,39 @@ ## Copyright (C) 2005-2011 Red Hat, Inc. ## See COPYING.LIB for the License of this software @@ -47,10 +47,10 @@ Index: libvirt-0.9.8/examples/apparmor/Makefile.am + rm -f $(DESTDIR)$(sysconfdir)/apparmor.d/libvirt/TEMPLATE + +endif -Index: libvirt-0.9.8/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in +Index: libvirt-0.9.9/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in =================================================================== --- /dev/null -+++ libvirt-0.9.8/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in ++++ libvirt-0.9.9/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in @@ -0,0 +1,40 @@ +# Last Modified: Fri Aug 19 11:21:48 2011 +#include @@ -92,9 +92,9 @@ Index: libvirt-0.9.8/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in + /var/lib/kvm/images/ r, + /var/lib/kvm/images/** r, +} -Index: libvirt-0.9.8/examples/apparmor/usr.lib.libvirt.virt-aa-helper +Index: libvirt-0.9.9/examples/apparmor/usr.lib.libvirt.virt-aa-helper =================================================================== ---- libvirt-0.9.8.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper +--- libvirt-0.9.9.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper +++ /dev/null @@ -1,38 +0,0 @@ -# Last Modified: Mon Apr 5 15:10:27 2010 @@ -135,9 +135,9 @@ Index: libvirt-0.9.8/examples/apparmor/usr.lib.libvirt.virt-aa-helper - /var/lib/libvirt/images/ r, - /var/lib/libvirt/images/** r, -} -Index: libvirt-0.9.8/examples/apparmor/usr.sbin.libvirtd +Index: libvirt-0.9.9/examples/apparmor/usr.sbin.libvirtd =================================================================== ---- libvirt-0.9.8.orig/examples/apparmor/usr.sbin.libvirtd +--- libvirt-0.9.9.orig/examples/apparmor/usr.sbin.libvirtd +++ /dev/null @@ -1,52 +0,0 @@ -# Last Modified: Mon Apr 5 15:03:58 2010 @@ -192,10 +192,10 @@ Index: libvirt-0.9.8/examples/apparmor/usr.sbin.libvirtd - change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*, - -} -Index: libvirt-0.9.8/examples/apparmor/usr.sbin.libvirtd.in +Index: libvirt-0.9.9/examples/apparmor/usr.sbin.libvirtd.in =================================================================== --- /dev/null -+++ libvirt-0.9.8/examples/apparmor/usr.sbin.libvirtd.in ++++ libvirt-0.9.9/examples/apparmor/usr.sbin.libvirtd.in @@ -0,0 +1,54 @@ +# Last Modified: Fri Aug 19 11:20:36 2011 +#include @@ -251,10 +251,10 @@ Index: libvirt-0.9.8/examples/apparmor/usr.sbin.libvirtd.in + change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*, + +} -Index: libvirt-0.9.8/examples/apparmor/libvirt-qemu +Index: libvirt-0.9.9/examples/apparmor/libvirt-qemu =================================================================== ---- libvirt-0.9.8.orig/examples/apparmor/libvirt-qemu -+++ libvirt-0.9.8/examples/apparmor/libvirt-qemu +--- libvirt-0.9.9.orig/examples/apparmor/libvirt-qemu ++++ libvirt-0.9.9/examples/apparmor/libvirt-qemu @@ -52,6 +52,7 @@ # access to firmware's etc /usr/share/kvm/** r, diff --git a/libvirt-0.9.8.tar.bz2 b/libvirt-0.9.8.tar.bz2 deleted file mode 100644 index 63524d4..0000000 --- a/libvirt-0.9.8.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4b1fdbfb9bf8831ca5b4c0a065a051243ecdab1ea8778de2c185f35e77b93629 -size 12881970 diff --git a/libvirt-0.9.9.tar.bz2 b/libvirt-0.9.9.tar.bz2 new file mode 100644 index 0000000..5b509b8 --- /dev/null +++ b/libvirt-0.9.9.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7de73cb8961b3cdecde265102abb55d8f9f1f81aceb6100cb10692721fba090f +size 13000699 diff --git a/libvirt-suse-netcontrol.patch b/libvirt-suse-netcontrol.patch index 5452d2d..77d26fc 100644 --- a/libvirt-suse-netcontrol.patch +++ b/libvirt-suse-netcontrol.patch @@ -1,7 +1,7 @@ -Index: libvirt-0.9.8/configure.ac +Index: libvirt-0.9.9/configure.ac =================================================================== ---- libvirt-0.9.8.orig/configure.ac -+++ libvirt-0.9.8/configure.ac +--- libvirt-0.9.9.orig/configure.ac ++++ libvirt-0.9.9/configure.ac @@ -63,6 +63,7 @@ AVAHI_REQUIRED="0.6.0" POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" @@ -10,7 +10,7 @@ Index: libvirt-0.9.8/configure.ac UDEV_REQUIRED=145 PCIACCESS_REQUIRED=0.10.0 XMLRPC_REQUIRED=1.14.0 -@@ -1639,6 +1640,38 @@ AM_CONDITIONAL([WITH_NETCF], [test "$wit +@@ -1637,6 +1638,38 @@ AM_CONDITIONAL([WITH_NETCF], [test "$wit AC_SUBST([NETCF_CFLAGS]) AC_SUBST([NETCF_LIBS]) @@ -49,7 +49,7 @@ Index: libvirt-0.9.8/configure.ac AC_ARG_WITH([secrets], AC_HELP_STRING([--with-secrets], [with local secrets management driver @<:@default=yes@:>@]),[],[with_secrets=yes]) -@@ -2567,6 +2600,7 @@ AC_MSG_NOTICE([ Remote: $with_remote]) +@@ -2565,6 +2598,7 @@ AC_MSG_NOTICE([ Remote: $with_remote]) AC_MSG_NOTICE([ Network: $with_network]) AC_MSG_NOTICE([Libvirtd: $with_libvirtd]) AC_MSG_NOTICE([ netcf: $with_netcf]) @@ -57,7 +57,7 @@ Index: libvirt-0.9.8/configure.ac AC_MSG_NOTICE([ macvtap: $with_macvtap]) AC_MSG_NOTICE([virtport: $with_virtualport]) AC_MSG_NOTICE([]) -@@ -2698,6 +2732,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $ +@@ -2696,6 +2730,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $ else AC_MSG_NOTICE([ netcf: no]) fi @@ -69,10 +69,10 @@ Index: libvirt-0.9.8/configure.ac if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS]) else -Index: libvirt-0.9.8/daemon/Makefile.am +Index: libvirt-0.9.9/daemon/Makefile.am =================================================================== ---- libvirt-0.9.8.orig/daemon/Makefile.am -+++ libvirt-0.9.8/daemon/Makefile.am +--- libvirt-0.9.9.orig/daemon/Makefile.am ++++ libvirt-0.9.9/daemon/Makefile.am @@ -143,6 +143,10 @@ endif if WITH_NETCF @@ -84,10 +84,10 @@ Index: libvirt-0.9.8/daemon/Makefile.am endif if WITH_NODE_DEVICES -Index: libvirt-0.9.8/daemon/libvirtd.c +Index: libvirt-0.9.9/daemon/libvirtd.c =================================================================== ---- libvirt-0.9.8.orig/daemon/libvirtd.c -+++ libvirt-0.9.8/daemon/libvirtd.c +--- libvirt-0.9.9.orig/daemon/libvirtd.c ++++ libvirt-0.9.9/daemon/libvirtd.c @@ -75,6 +75,10 @@ # endif # ifdef WITH_NETCF @@ -99,7 +99,7 @@ Index: libvirt-0.9.8/daemon/libvirtd.c # endif # ifdef WITH_STORAGE_DIR # include "storage/storage_driver.h" -@@ -393,6 +397,10 @@ static void daemonInitialize(void) +@@ -414,6 +418,10 @@ static void daemonInitialize(void) # endif # ifdef WITH_NETCF interfaceRegister(); @@ -110,11 +110,11 @@ Index: libvirt-0.9.8/daemon/libvirtd.c # endif # ifdef WITH_STORAGE_DIR storageRegister(); -Index: libvirt-0.9.8/src/Makefile.am +Index: libvirt-0.9.9/src/Makefile.am =================================================================== ---- libvirt-0.9.8.orig/src/Makefile.am -+++ libvirt-0.9.8/src/Makefile.am -@@ -950,6 +950,24 @@ libvirt_driver_interface_la_LIBADD += .. +--- libvirt-0.9.9.orig/src/Makefile.am ++++ libvirt-0.9.9/src/Makefile.am +@@ -955,6 +955,24 @@ libvirt_driver_interface_la_LIBADD += .. libvirt_driver_interface_la_LDFLAGS += -module -avoid-version endif libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES) @@ -139,10 +139,10 @@ Index: libvirt-0.9.8/src/Makefile.am endif if WITH_SECRETS -Index: libvirt-0.9.8/src/interface/netcf_driver.c +Index: libvirt-0.9.9/src/interface/netcf_driver.c =================================================================== ---- libvirt-0.9.8.orig/src/interface/netcf_driver.c -+++ libvirt-0.9.8/src/interface/netcf_driver.c +--- libvirt-0.9.9.orig/src/interface/netcf_driver.c ++++ libvirt-0.9.9/src/interface/netcf_driver.c @@ -23,7 +23,13 @@ #include @@ -208,11 +208,11 @@ Index: libvirt-0.9.8/src/interface/netcf_driver.c /* open netcf */ if (ncf_init(&driverState->netcf, NULL) != 0) { -Index: libvirt-0.9.8/tools/virsh.c +Index: libvirt-0.9.9/tools/virsh.c =================================================================== ---- libvirt-0.9.8.orig/tools/virsh.c -+++ libvirt-0.9.8/tools/virsh.c -@@ -17646,6 +17646,10 @@ vshShowVersion(vshControl *ctl ATTRIBUTE +--- libvirt-0.9.9.orig/tools/virsh.c ++++ libvirt-0.9.9/tools/virsh.c +@@ -18328,6 +18328,10 @@ vshShowVersion(vshControl *ctl ATTRIBUTE #endif #ifdef WITH_NETCF vshPrint(ctl, " Netcf"); diff --git a/libvirt.changes b/libvirt.changes index 53c69ce..06efe30 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Jan 9 15:45:33 MST 2012 - jfehlig@suse.com + +- Update to libvirt 0.9.9 + - Add new API virDomain{S,G}etInterfaceParameters + - Add new API virDomain{G,S}etNumaParameters + - Add support for ppc64 qemu + - Support Xen domctl v8 + ------------------------------------------------------------------- Wed Jan 4 16:41:32 MST 2012 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index 8b0624a..c72e138 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -263,6 +263,7 @@ BuildRequires: libcap-ng-devel >= 0.5.0 %if %{with_netcf} BuildRequires: netcf-devel >= 0.1.4 %endif +%define with_netcontrol 1 %if %{with_netcontrol} BuildRequires: libnetcontrol-devel >= 0.2.0 %endif @@ -323,7 +324,7 @@ Url: http://libvirt.org/ License: LGPL-2.1+ Group: Development/Libraries/C and C++ AutoReqProv: yes -Version: 0.9.8 +Version: 0.9.9 Release: 1 Summary: A C toolkit to interact with the virtualization capabilities of Linux Conflicts: kvm < 0.14.1 @@ -397,15 +398,12 @@ Source1: libvirtd.init Source2: libvirtd-relocation-server.fw Source99: baselibs.conf # Upstream patches -Patch0: ae1232b2-CVE-2011-4600.patch -Patch1: 478a4d07-systemd-build-fix.patch -Patch2: 10404671-systemd-build-fix.patch +Patch0: 9ae4ac7a-PolicyKit.patch # Need to go upstream Patch100: xen-name-for-devid.patch Patch101: clone.patch Patch102: xen-pv-cdrom.patch -Patch103: xen-domctl-ver8.patch -Patch104: AF_PACKET.patch +Patch103: AF_PACKET.patch # Our patches Patch200: libvirtd-defaults.patch Patch201: use-init-script-redhat.patch @@ -541,13 +539,10 @@ Authors: %prep %setup -q %patch0 -p1 -%patch1 -p1 -%patch2 -p1 %patch100 -p1 %patch101 %patch102 -p1 %patch103 -p1 -%patch104 -p1 %patch200 -p1 %patch201 -p1 %patch202 -p1 diff --git a/libvirtd-defaults.patch b/libvirtd-defaults.patch index 9775190..bd60cef 100644 --- a/libvirtd-defaults.patch +++ b/libvirtd-defaults.patch @@ -1,7 +1,7 @@ -Index: libvirt-0.9.8/daemon/libvirtd.conf +Index: libvirt-0.9.9/daemon/libvirtd.conf =================================================================== ---- libvirt-0.9.8.orig/daemon/libvirtd.conf -+++ libvirt-0.9.8/daemon/libvirtd.conf +--- libvirt-0.9.9.orig/daemon/libvirtd.conf ++++ libvirt-0.9.9/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.9.8/daemon/libvirtd.conf # Override the default mDNS advertizement name. This must be # unique on the immediate broadcast network. -Index: libvirt-0.9.8/daemon/libvirtd.c +Index: libvirt-0.9.9/daemon/libvirtd.c =================================================================== ---- libvirt-0.9.8.orig/daemon/libvirtd.c -+++ libvirt-0.9.8/daemon/libvirtd.c -@@ -850,7 +850,7 @@ daemonConfigNew(bool privileged ATTRIBUT +--- libvirt-0.9.9.orig/daemon/libvirtd.c ++++ libvirt-0.9.9/daemon/libvirtd.c +@@ -871,7 +871,7 @@ daemonConfigNew(bool privileged ATTRIBUT return NULL; } @@ -41,7 +41,7 @@ Index: libvirt-0.9.8/daemon/libvirtd.c data->listen_tcp = 0; if (!(data->tls_port = strdup(LIBVIRTD_TLS_PORT))) -@@ -887,7 +887,7 @@ daemonConfigNew(bool privileged ATTRIBUT +@@ -908,7 +908,7 @@ daemonConfigNew(bool privileged ATTRIBUT #endif data->auth_tls = REMOTE_AUTH_NONE; diff --git a/relax-qemu-usergroup-check.patch b/relax-qemu-usergroup-check.patch index 46272ae..69611c6 100644 --- a/relax-qemu-usergroup-check.patch +++ b/relax-qemu-usergroup-check.patch @@ -7,10 +7,10 @@ drivers as loadable modules instead of built-in to the daemon. Then the qemu driver would only be loaded when needed, which would never be the case on a xen-only configuration. -Index: libvirt-0.9.8/src/qemu/qemu_conf.c +Index: libvirt-0.9.9/src/qemu/qemu_conf.c =================================================================== ---- libvirt-0.9.8.orig/src/qemu/qemu_conf.c -+++ libvirt-0.9.8/src/qemu/qemu_conf.c +--- libvirt-0.9.9.orig/src/qemu/qemu_conf.c ++++ libvirt-0.9.9/src/qemu/qemu_conf.c @@ -255,9 +255,7 @@ int qemudLoadDriverConfig(struct qemud_d return -1; } diff --git a/suse-qemu-conf.patch b/suse-qemu-conf.patch index 6e74be9..5866e29 100644 --- a/suse-qemu-conf.patch +++ b/suse-qemu-conf.patch @@ -1,7 +1,7 @@ -Index: libvirt-0.9.8/src/qemu/qemu.conf +Index: libvirt-0.9.9/src/qemu/qemu.conf =================================================================== ---- libvirt-0.9.8.orig/src/qemu/qemu.conf -+++ libvirt-0.9.8/src/qemu/qemu.conf +--- libvirt-0.9.9.orig/src/qemu/qemu.conf ++++ libvirt-0.9.9/src/qemu/qemu.conf @@ -136,7 +136,16 @@ # leaving SELinux enabled for the host in general, then set this # to 'none' instead. diff --git a/use-init-script-redhat.patch b/use-init-script-redhat.patch index 03dbee4..389eced 100644 --- a/use-init-script-redhat.patch +++ b/use-init-script-redhat.patch @@ -1,7 +1,7 @@ -Index: libvirt-0.9.8/tools/Makefile.am +Index: libvirt-0.9.9/tools/Makefile.am =================================================================== ---- libvirt-0.9.8.orig/tools/Makefile.am -+++ libvirt-0.9.8/tools/Makefile.am +--- libvirt-0.9.9.orig/tools/Makefile.am ++++ libvirt-0.9.9/tools/Makefile.am @@ -153,24 +153,22 @@ install-data-local: install-init install uninstall-local: uninstall-init uninstall-systemd @@ -33,10 +33,10 @@ Index: libvirt-0.9.8/tools/Makefile.am if LIBVIRT_INIT_SCRIPT_RED_HAT -Index: libvirt-0.9.8/tools/libvirt-guests.sysconf +Index: libvirt-0.9.9/tools/libvirt-guests.sysconf =================================================================== ---- libvirt-0.9.8.orig/tools/libvirt-guests.sysconf -+++ libvirt-0.9.8/tools/libvirt-guests.sysconf +--- libvirt-0.9.9.orig/tools/libvirt-guests.sysconf ++++ libvirt-0.9.9/tools/libvirt-guests.sysconf @@ -1,18 +1,28 @@ +## Path: System/Virtualization/libvirt + @@ -87,10 +87,10 @@ Index: libvirt-0.9.8/tools/libvirt-guests.sysconf # If non-zero, try to bypass the file system cache when saving and # restoring guests, even though this may give slower operation for # some file systems. -Index: libvirt-0.9.8/tools/libvirt-guests.init.sh +Index: libvirt-0.9.9/tools/libvirt-guests.init.sh =================================================================== ---- libvirt-0.9.8.orig/tools/libvirt-guests.init.sh -+++ libvirt-0.9.8/tools/libvirt-guests.init.sh +--- libvirt-0.9.9.orig/tools/libvirt-guests.init.sh ++++ libvirt-0.9.9/tools/libvirt-guests.init.sh @@ -4,10 +4,10 @@ # ### BEGIN INIT INFO @@ -233,10 +233,10 @@ Index: libvirt-0.9.8/tools/libvirt-guests.init.sh esac -exit $RETVAL +rc_exit -Index: libvirt-0.9.8/daemon/Makefile.am +Index: libvirt-0.9.9/daemon/Makefile.am =================================================================== ---- libvirt-0.9.8.orig/daemon/Makefile.am -+++ libvirt-0.9.8/daemon/Makefile.am +--- libvirt-0.9.9.orig/daemon/Makefile.am ++++ libvirt-0.9.9/daemon/Makefile.am @@ -249,34 +249,23 @@ uninstall-logrotate: rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || : @@ -275,10 +275,10 @@ Index: libvirt-0.9.8/daemon/Makefile.am else install-init-redhat: uninstall-init-redhat: -Index: libvirt-0.9.8/daemon/libvirtd.sysconf +Index: libvirt-0.9.9/daemon/libvirtd.sysconf =================================================================== ---- libvirt-0.9.8.orig/daemon/libvirtd.sysconf -+++ libvirt-0.9.8/daemon/libvirtd.sysconf +--- libvirt-0.9.9.orig/daemon/libvirtd.sysconf ++++ libvirt-0.9.9/daemon/libvirtd.sysconf @@ -1,16 +1,25 @@ +## Path: System/Virtualization/libvirt + diff --git a/xen-domctl-ver8.patch b/xen-domctl-ver8.patch deleted file mode 100644 index c40f4d7..0000000 --- a/xen-domctl-ver8.patch +++ /dev/null @@ -1,294 +0,0 @@ -Index: libvirt-0.9.8/src/xen/xen_hypervisor.c -=================================================================== ---- libvirt-0.9.8.orig/src/xen/xen_hypervisor.c -+++ libvirt-0.9.8/src/xen/xen_hypervisor.c -@@ -243,12 +243,30 @@ struct xen_v2d7_getdomaininfo { - }; - typedef struct xen_v2d7_getdomaininfo xen_v2d7_getdomaininfo; - -+struct xen_v2d8_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 paged_pages ALIGN_64; /* number of paged 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_v2d8_getdomaininfo xen_v2d8_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; -+ struct xen_v2d8_getdomaininfo v2d8; - }; - typedef union xen_getdomaininfo xen_getdomaininfo; - -@@ -258,6 +276,7 @@ union xen_getdomaininfolist { - struct xen_v2d5_getdomaininfo *v2d5; - struct xen_v2d6_getdomaininfo *v2d6; - struct xen_v2d7_getdomaininfo *v2d7; -+ struct xen_v2d8_getdomaininfo *v2d8; - }; - typedef union xen_getdomaininfolist xen_getdomaininfolist; - -@@ -295,179 +314,211 @@ typedef struct xen_v2s5_availheap xen_v - #define XEN_GETDOMAININFOLIST_ALLOC(domlist, size) \ - (hv_versions.hypervisor < 2 ? \ - (VIR_ALLOC_N(domlist.v0, (size)) == 0) : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ (VIR_ALLOC_N(domlist.v2d8, (size)) == 0) : \ - (hv_versions.dom_interface >= 7 ? \ - (VIR_ALLOC_N(domlist.v2d7, (size)) == 0) : \ - (hv_versions.dom_interface == 6 ? \ - (VIR_ALLOC_N(domlist.v2d6, (size)) == 0) : \ - (hv_versions.dom_interface == 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) \ - (hv_versions.hypervisor < 2 ? \ - VIR_FREE(domlist.v0) : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ VIR_FREE(domlist.v2d8) : \ - (hv_versions.dom_interface >= 7 ? \ - VIR_FREE(domlist.v2d7) : \ - (hv_versions.dom_interface == 6 ? \ - VIR_FREE(domlist.v2d6) : \ - (hv_versions.dom_interface == 5 ? \ - VIR_FREE(domlist.v2d5) : \ -- VIR_FREE(domlist.v2))))) -+ VIR_FREE(domlist.v2)))))) - - #define XEN_GETDOMAININFOLIST_CLEAR(domlist, size) \ - (hv_versions.hypervisor < 2 ? \ - memset(domlist.v0, 0, sizeof(*domlist.v0) * size) : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ memset(domlist.v2d8, 0, sizeof(*domlist.v2d8) * size) : \ - (hv_versions.dom_interface >= 7 ? \ - memset(domlist.v2d7, 0, sizeof(*domlist.v2d7) * size) : \ - (hv_versions.dom_interface == 6 ? \ - memset(domlist.v2d6, 0, sizeof(*domlist.v2d6) * size) : \ - (hv_versions.dom_interface == 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) \ - (hv_versions.hypervisor < 2 ? \ - domlist.v0[n].domain : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ domlist.v2d8[n].domain : \ - (hv_versions.dom_interface >= 7 ? \ - domlist.v2d7[n].domain : \ - (hv_versions.dom_interface == 6 ? \ - domlist.v2d6[n].domain : \ - (hv_versions.dom_interface == 5 ? \ - domlist.v2d5[n].domain : \ -- domlist.v2[n].domain)))) -+ domlist.v2[n].domain))))) - - #define XEN_GETDOMAININFOLIST_UUID(domlist, n) \ - (hv_versions.hypervisor < 2 ? \ - domlist.v0[n].handle : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ domlist.v2d8[n].handle : \ - (hv_versions.dom_interface >= 7 ? \ - domlist.v2d7[n].handle : \ - (hv_versions.dom_interface == 6 ? \ - domlist.v2d6[n].handle : \ - (hv_versions.dom_interface == 5 ? \ - domlist.v2d5[n].handle : \ -- domlist.v2[n].handle)))) -+ domlist.v2[n].handle))))) - - #define XEN_GETDOMAININFOLIST_DATA(domlist) \ - (hv_versions.hypervisor < 2 ? \ - (void*)(domlist->v0) : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ (void*)(domlist->v2d8) : \ - (hv_versions.dom_interface >= 7 ? \ - (void*)(domlist->v2d7) : \ - (hv_versions.dom_interface == 6 ? \ - (void*)(domlist->v2d6) : \ - (hv_versions.dom_interface == 5 ? \ - (void*)(domlist->v2d5) : \ -- (void*)(domlist->v2))))) -+ (void*)(domlist->v2)))))) - - #define XEN_GETDOMAININFO_SIZE \ - (hv_versions.hypervisor < 2 ? \ - sizeof(xen_v0_getdomaininfo) : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ sizeof(xen_v2d8_getdomaininfo) : \ - (hv_versions.dom_interface >= 7 ? \ - sizeof(xen_v2d7_getdomaininfo) : \ - (hv_versions.dom_interface == 6 ? \ - sizeof(xen_v2d6_getdomaininfo) : \ - (hv_versions.dom_interface == 5 ? \ - sizeof(xen_v2d5_getdomaininfo) : \ -- sizeof(xen_v2_getdomaininfo))))) -+ sizeof(xen_v2_getdomaininfo)))))) - - #define XEN_GETDOMAININFO_CLEAR(dominfo) \ - (hv_versions.hypervisor < 2 ? \ - memset(&(dominfo.v0), 0, sizeof(xen_v0_getdomaininfo)) : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ memset(&(dominfo.v2d8), 0, sizeof(xen_v2d8_getdomaininfo)) : \ - (hv_versions.dom_interface >= 7 ? \ - memset(&(dominfo.v2d7), 0, sizeof(xen_v2d7_getdomaininfo)) : \ - (hv_versions.dom_interface == 6 ? \ - memset(&(dominfo.v2d6), 0, sizeof(xen_v2d6_getdomaininfo)) : \ - (hv_versions.dom_interface == 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) \ - (hv_versions.hypervisor < 2 ? \ - dominfo.v0.domain : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ dominfo.v2d8.domain : \ - (hv_versions.dom_interface >= 7 ? \ - dominfo.v2d7.domain : \ - (hv_versions.dom_interface == 6 ? \ - dominfo.v2d6.domain : \ - (hv_versions.dom_interface == 5 ? \ - dominfo.v2d5.domain : \ -- dominfo.v2.domain)))) -+ dominfo.v2.domain))))) - - #define XEN_GETDOMAININFO_CPUTIME(dominfo) \ - (hv_versions.hypervisor < 2 ? \ - dominfo.v0.cpu_time : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ dominfo.v2d8.cpu_time : \ - (hv_versions.dom_interface >= 7 ? \ - dominfo.v2d7.cpu_time : \ - (hv_versions.dom_interface == 6 ? \ - dominfo.v2d6.cpu_time : \ - (hv_versions.dom_interface == 5 ? \ - dominfo.v2d5.cpu_time : \ -- dominfo.v2.cpu_time)))) -+ dominfo.v2.cpu_time))))) - - - #define XEN_GETDOMAININFO_CPUCOUNT(dominfo) \ - (hv_versions.hypervisor < 2 ? \ - dominfo.v0.nr_online_vcpus : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ dominfo.v2d8.nr_online_vcpus : \ - (hv_versions.dom_interface >= 7 ? \ - dominfo.v2d7.nr_online_vcpus : \ - (hv_versions.dom_interface == 6 ? \ - dominfo.v2d6.nr_online_vcpus : \ - (hv_versions.dom_interface == 5 ? \ - dominfo.v2d5.nr_online_vcpus : \ -- dominfo.v2.nr_online_vcpus)))) -+ dominfo.v2.nr_online_vcpus))))) - - #define XEN_GETDOMAININFO_MAXCPUID(dominfo) \ - (hv_versions.hypervisor < 2 ? \ - dominfo.v0.max_vcpu_id : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ dominfo.v2d8.max_vcpu_id : \ - (hv_versions.dom_interface >= 7 ? \ - dominfo.v2d7.max_vcpu_id : \ - (hv_versions.dom_interface == 6 ? \ - dominfo.v2d6.max_vcpu_id : \ - (hv_versions.dom_interface == 5 ? \ - dominfo.v2d5.max_vcpu_id : \ -- dominfo.v2.max_vcpu_id)))) -+ dominfo.v2.max_vcpu_id))))) - - #define XEN_GETDOMAININFO_FLAGS(dominfo) \ - (hv_versions.hypervisor < 2 ? \ - dominfo.v0.flags : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ dominfo.v2d8.flags : \ - (hv_versions.dom_interface >= 7 ? \ - dominfo.v2d7.flags : \ - (hv_versions.dom_interface == 6 ? \ - dominfo.v2d6.flags : \ - (hv_versions.dom_interface == 5 ? \ - dominfo.v2d5.flags : \ -- dominfo.v2.flags)))) -+ dominfo.v2.flags))))) - - #define XEN_GETDOMAININFO_TOT_PAGES(dominfo) \ - (hv_versions.hypervisor < 2 ? \ - dominfo.v0.tot_pages : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ dominfo.v2d8.tot_pages : \ - (hv_versions.dom_interface >= 7 ? \ - dominfo.v2d7.tot_pages : \ - (hv_versions.dom_interface == 6 ? \ - dominfo.v2d6.tot_pages : \ - (hv_versions.dom_interface == 5 ? \ - dominfo.v2d5.tot_pages : \ -- dominfo.v2.tot_pages)))) -+ dominfo.v2.tot_pages))))) - - #define XEN_GETDOMAININFO_MAX_PAGES(dominfo) \ - (hv_versions.hypervisor < 2 ? \ - dominfo.v0.max_pages : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ dominfo.v2d8.max_pages : \ - (hv_versions.dom_interface >= 7 ? \ - dominfo.v2d7.max_pages : \ - (hv_versions.dom_interface == 6 ? \ - dominfo.v2d6.max_pages : \ - (hv_versions.dom_interface == 5 ? \ - dominfo.v2d5.max_pages : \ -- dominfo.v2.max_pages)))) -+ dominfo.v2.max_pages))))) - - #define XEN_GETDOMAININFO_UUID(dominfo) \ - (hv_versions.hypervisor < 2 ? \ - dominfo.v0.handle : \ -+ (hv_versions.dom_interface >= 8 ? \ -+ dominfo.v2d8.handle : \ - (hv_versions.dom_interface >= 7 ? \ - dominfo.v2d7.handle : \ - (hv_versions.dom_interface == 6 ? \ - dominfo.v2d6.handle : \ - (hv_versions.dom_interface == 5 ? \ - dominfo.v2d5.handle : \ -- dominfo.v2.handle)))) -+ dominfo.v2.handle))))) - - - static int -@@ -2142,12 +2193,20 @@ xenHypervisorInit(struct xenHypervisorVe - /* Xen 4.1 - * sysctl version 8 -> xen-unstable c/s 21118:28e5409e3fb3 - * domctl version 7 -> xen-unstable c/s 21212:de94884a669c -+ * domctl version 8 -> xen-unstable c/s 23874:651aed73b39c - */ - hv_versions.sys_interface = 8; /* XEN_SYSCTL_INTERFACE_VERSION */ - if (virXen_getdomaininfo(fd, 0, &info) == 1) { - hv_versions.dom_interface = 7; /* XEN_DOMCTL_INTERFACE_VERSION */ -- VIR_DEBUG("Using hypervisor call v2, sys ver8 dom ver7\n"); -- goto done; -+ if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ -+ VIR_DEBUG("Using hypervisor call v2, sys ver8 dom ver7"); -+ goto done; -+ } -+ hv_versions.dom_interface = 8; /* XEN_DOMCTL_INTERFACE_VERSION */ -+ if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ -+ VIR_DEBUG("Using hypervisor call v2, sys ver8 dom ver8"); -+ goto done; -+ } - } - - hv_versions.hypervisor = 1; diff --git a/xen-name-for-devid.patch b/xen-name-for-devid.patch index eb4eee5..9b94558 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.8/src/xen/xend_internal.c +Index: libvirt-0.9.9/src/xen/xend_internal.c =================================================================== ---- libvirt-0.9.8.orig/src/xen/xend_internal.c -+++ libvirt-0.9.8/src/xen/xend_internal.c +--- libvirt-0.9.9.orig/src/xen/xend_internal.c ++++ libvirt-0.9.9/src/xen/xend_internal.c @@ -60,6 +60,7 @@ static int @@ -25,7 +25,7 @@ Index: libvirt-0.9.8/src/xen/xend_internal.c virDomainDeviceDefPtr dev, char *class, char *ref, -@@ -2749,7 +2750,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr +@@ -2752,7 +2753,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr sexpr = virBufferContentAndReset(&buf); @@ -34,7 +34,7 @@ Index: libvirt-0.9.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); -@@ -2870,7 +2871,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr +@@ -2873,7 +2874,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr sexpr = virBufferContentAndReset(&buf); @@ -43,7 +43,7 @@ Index: libvirt-0.9.8/src/xen/xend_internal.c virXendError(VIR_ERR_OPERATION_INVALID, "%s", _("requested device does not exist")); goto cleanup; -@@ -2965,7 +2966,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr +@@ -2968,7 +2969,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr def, xml, VIR_DOMAIN_XML_INACTIVE))) goto cleanup; @@ -52,7 +52,7 @@ Index: libvirt-0.9.8/src/xen/xend_internal.c goto cleanup; if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) { -@@ -3913,6 +3914,7 @@ struct xenUnifiedDriver xenDaemonDriver +@@ -3916,6 +3917,7 @@ struct xenUnifiedDriver xenDaemonDriver */ static int virDomainXMLDevID(virDomainPtr domain, @@ -60,7 +60,7 @@ Index: libvirt-0.9.8/src/xen/xend_internal.c virDomainDeviceDefPtr dev, char *class, char *ref, -@@ -3921,8 +3923,12 @@ virDomainXMLDevID(virDomainPtr domain, +@@ -3924,8 +3926,12 @@ virDomainXMLDevID(virDomainPtr domain, xenUnifiedPrivatePtr priv = domain->conn->privateData; char *xref; char *tmp; @@ -73,7 +73,7 @@ Index: libvirt-0.9.8/src/xen/xend_internal.c if (dev->data.disk->driverName && STREQ(dev->data.disk->driverName, "tap")) strcpy(class, "tap"); -@@ -3932,19 +3938,21 @@ virDomainXMLDevID(virDomainPtr domain, +@@ -3935,19 +3941,21 @@ virDomainXMLDevID(virDomainPtr domain, else strcpy(class, "vbd"); diff --git a/xen-pv-cdrom.patch b/xen-pv-cdrom.patch index f920f2b..e4de592 100644 --- a/xen-pv-cdrom.patch +++ b/xen-pv-cdrom.patch @@ -1,7 +1,7 @@ -Index: libvirt-0.9.8/src/xenxs/xen_sxpr.c +Index: libvirt-0.9.9/src/xenxs/xen_sxpr.c =================================================================== ---- libvirt-0.9.8.orig/src/xenxs/xen_sxpr.c -+++ libvirt-0.9.8/src/xenxs/xen_sxpr.c +--- libvirt-0.9.9.orig/src/xenxs/xen_sxpr.c ++++ libvirt-0.9.9/src/xenxs/xen_sxpr.c @@ -329,7 +329,7 @@ error: static int xenParseSxprDisks(virDomainDefPtr def,