Hello community,
here is the log from the commit of package libvirt.1688 for openSUSE:12.3:Update checked in at 2013-06-04 14:01:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/libvirt.1688 (Old)
and /work/SRC/openSUSE:12.3:Update/.libvirt.1688.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libvirt.1688"
Changes:
--------
New Changes file:
--- /dev/null 2013-05-23 01:40:31.032032505 +0200
+++ /work/SRC/openSUSE:12.3:Update/.libvirt.1688.new/libvirt.changes 2013-06-04 14:01:05.000000000 +0200
@@ -0,0 +1,1778 @@
+-------------------------------------------------------------------
+Mon May 20 14:41:16 MDT 2013 - jfehlig@suse.com
+
+- Don't mount selinux fs in LXC if selinux is disabled
+ 95c6cc34-selinux.patch
+ bnc#814680
+
+-------------------------------------------------------------------
+Sat May 18 08:49:25 MDT 2013 - jfehlig@suse.com
+
+- fix leak after listing all volumes - CVE-2013-1962
+ ca697e90-CVE-2013-1962.patch
+ bnc#820397
+
+-------------------------------------------------------------------
+Thu Mar 21 18:09:21 MDT 2013 - jfehlig@suse.com
+
+- Fix parsing of bond interface XML
+ 5ba077dc-iface-bond.patch
+ bnc#810893
+
+-------------------------------------------------------------------
+Mon Feb 25 12:30:24 MST 2013 - jfehlig@suse.com
+
+- Fix detach of managed PCI devices from inactive domains.
+ Detected while running test cases for FATE #313570.
+ Modified xen-name-for-devid.patch
+
+-------------------------------------------------------------------
+Thu Feb 21 15:48:39 MST 2013 - jfehlig@suse.com
+
+- spec: Fix installation of default network
+
+-------------------------------------------------------------------
+Wed Feb 20 16:37:03 MST 2013 - jfehlig@suse.com
+
+- Fix default setting of backend field of libxl_device_disk
+ 567779e5-libxl-default-disk-backend.patch
+ rhb#912488
+
+-------------------------------------------------------------------
+Tue Feb 12 16:17:36 MST 2013 - jfehlig@suse.com
+
+- Fix build on IA64
+ Modified clone.patch
+
+-------------------------------------------------------------------
+Thu Feb 7 10:23:10 MST 2013 - jfehlig@suse.com
+
+- Fix error handling in python bindings
+ a6b8bae5-python-generator-fix1.patch
+ 25ea8e47-python-generator-fix2.patch
+ bnc#802619
+
+-------------------------------------------------------------------
+Sun Feb 3 14:42:19 UTC 2013 - crrodriguez@opensuse.org
+
+- Require modutils instead of module-init-tools.
+
+-------------------------------------------------------------------
+Wed Jan 30 11:28:32 MST 2013 - jfehlig@suse.com
+
+- Update to libvirt 1.0.2
+ - LXC improvements
+ - S390 architecture improvements
+ - Power architecture improvements
+ - large Coverity report cleanups and associated bug fixes
+ - virTypedParams* APIs to help with those data structures
+ - libxenlight driver improvements
+ - Fixes CVE-2013-0170, bnc#800976
+ - Drop upstream patches: 68e7bc45-libxl-link-fix.patch,
+ 462a6962-script-fixes1.patch, cb854b8f-script-fixes2.patch,
+ 5ec4b22b-script-fixes3.patch, a1fd56cb-script-fixes4.patch,
+ 66ff2ddc-virtlockd-systemd-file-perms.patch
+
+-------------------------------------------------------------------
+Mon Jan 21 20:59:16 MST 2013 - jfehlig@suse.com
+
+- Unconditionally build sanlock support
+ bnc#799262
+
+-------------------------------------------------------------------
+Mon Jan 21 20:54:39 MST 2013 - jfehlig@suse.com
+
+- Fix interface management functions that were broken when
+ rebasing libvirt-suse-netcontrol.patch
+ bnc#799444 (SLES bug that affect Factory too)
+
+-------------------------------------------------------------------
+Sat Jan 5 11:39:02 MST 2013 - jfehlig@suse.com
+
+- Update to libvirt 1.0.1
+ - Introduce virtlockd daemon
+ - parallels: add disk and network device support
+ - Add virDomainSendProcessSignal API
+ - Introduce virDomainFSTrim() public API
+ - add fuse support for libvirt lxc
+ - Add Gluster protocol as supported network disk backend
+ - various snapshot improvements
+- Add upstream patches to fix bugs in 1.0.1
+ 66ff2ddc-virtlockd-systemd-file-perms.patch,
+ 462a6962-script-fixes1.patch, cb854b8f-script-fixes2.patch,
+ 5ec4b22b-script-fixes3.patch, a1fd56cb-script-fixes4.patch,
+ 68e7bc45-libxl-link-fix.patch
+- Rework SUSE patches for the various init scripts
+ Dropped use-init-script-redhat.patch and added
+ libvirtd-init-script.patch, libvirt-guests-init-script.patch,
+ and virtlockd-init-script.patch
+
+-------------------------------------------------------------------
+Fri Nov 2 11:19:46 MDT 2012 - jfehlig@suse.com
+
+- Update to libvirt 1.0.0
+ - virNodeGetCPUMap: Define public API
+ - Add systemd journal support
+ - Add a qemu capabilities cache manager
+ - USB migration support
+ - various improvement and fixes when using QMP QEmu interface
+ - Support for Xen 4.2 in legacy xen driver
+ - Lot of localization enhancements
+ - Drop upstream patches: 371ddc98-xen-sysctl-9.patch,
+ 416eca18-xenstore-header-fix.patch,
+ f644361b-virCommand-env.patch, 2b32735a-virCommand-env.patch,
+ 9785f2b6-fix-xen-sysctl9.patch
+
+-------------------------------------------------------------------
+Tue Oct 23 14:33:40 MDT 2012 - jfehlig@suse.com
+
+- Fix Xen sysctl version 9 support
+ 9785f2b6-fix-xen-sysctl9.patch
+
+-------------------------------------------------------------------
+Thu Oct 11 08:34:36 MDT 2012 - jfehlig@suse.com
+
+- Add upstream patches to support latest libguestfs
+ f644361b-virCommand-env.patch
+ 2b32735a-virCommand-env.patch
+
+-------------------------------------------------------------------
+Thu Sep 27 10:35:25 MDT 2012 - jfehlig@suse.com
+
+- Fix build when using -werror
+ 416eca18-xenstore-header-fix.patch
+
+-------------------------------------------------------------------
+Wed Sep 26 14:24:42 MDT 2012 - jfehlig@suse.com
+
+- Support Xen sysctl version 9
+ 371ddc98-xen-sysctl-9.patch
+ bnc#781425
+
+-------------------------------------------------------------------
+Tue Sep 25 16:20:43 MDT 2012 - jfehlig@suse.com
+
+- Temporarily disable building libxl driver. The current
+ implementation does not support libxl in Xen 4.2.
+
+-------------------------------------------------------------------
+Tue Sep 25 16:17:29 MDT 2012 - jfehlig@suse.com
+
+- Update to libvirt 0.10.2
+ - network: define new API virNetworkUpdate
+ - add support for QEmu sandbox support
+ - blockjob: add virDomainBlockCommit
+ - node_memory: Define the APIs to get/set memory parameters
+ - list: Define new API virConnectListAllSecrets
+ - list: Define new API virConnectListAllNWFilter
+ - list: Define new API virConnectListAllNodeDevices
+ - list: Define new API virConnectListAllInterfaces
+ - list: Define new API virConnectListAllNetworks
+ - list: Define new API virStoragePoolListAllVolumes
+ - list: Define new API virStorageListAllStoragePools
+ - parallels: add support of containers to the driver
+ - Add PMSUSPENDED life cycle event
+ - Add per-guest S3/S4 state configuration
+ - qemu: Support for Block Device IO Limits
+
+-------------------------------------------------------------------
+Fri Sep 7 13:42:10 MDT 2012 - jfehlig@suse.com
+
+- Update to libvirt 0.10.1
+ - Bug fix release for critical bugs in 0.10.0
+ - Drop upstream patch f781e276-xen-driver-fix.patch
+
+-------------------------------------------------------------------
+Fri Aug 31 11:20:35 MDT 2012 - jfehlig@suse.com
+
+- Update to libvirt 0.10.0
+ - agent: add qemuAgentArbitraryCommand()
+ - Introduce virDomainPinEmulator and virDomainGetEmulatorPinInfo
+ - network: use firewalld instead of iptables, when available
+ - network: make network driver vlan-aware
+ - esx: Implement network driver
+ - driver for parallels hypervisor
+ - Various LXC improvements
+ - Add virDomainGetHostname
+ - Drop upstream patches
++++ 1581 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:12.3:Update/.libvirt.1688.new/libvirt.changes
New:
----
25ea8e47-python-generator-fix2.patch
567779e5-libxl-default-disk-backend.patch
5ba077dc-iface-bond.patch
95c6cc34-selinux.patch
AF_PACKET.patch
a6b8bae5-python-generator-fix1.patch
baselibs.conf
ca697e90-CVE-2013-1962.patch
clone.patch
install-apparmor-profiles.patch
libvirt-1.0.2.tar.bz2
libvirt-guests-init-script.patch
libvirt-suse-netcontrol.patch
libvirt.changes
libvirt.spec
libvirtd-defaults.patch
libvirtd-init-script.patch
libvirtd-relocation-server.fw
libvirtd.init
relax-qemu-usergroup-check.patch
suse-qemu-conf.patch
virtlockd-init-script.patch
xen-name-for-devid.patch
xen-pv-cdrom.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libvirt.spec ++++++
++++ 1134 lines (skipped)
++++++ 25ea8e47-python-generator-fix2.patch ++++++
commit 25ea8e47e74def560bf89cd94dd54b75ca5ff4d6
Author: Daniel P. Berrange
Date: Tue Feb 5 12:55:09 2013 +0000
Fix missing error constants in libvirt python module
The previous change to the generator, changed too much - only
the functions are in 'virerror.c', the constants remained in
'virerror.h' which could not be renamed for API compat reasons.
Add a test case to sanity check the generated python bindings
Signed-off-by: Daniel P. Berrange
Index: libvirt-1.0.2/python/Makefile.am
===================================================================
--- libvirt-1.0.2.orig/python/Makefile.am
+++ libvirt-1.0.2/python/Makefile.am
@@ -119,6 +119,11 @@ $(libvirtmod_la_OBJECTS): $(GENERATED)
$(libvirtmod_qemu_la_OBJECTS): $(QEMU_GENERATED)
$(libvirtmod_lxc_la_OBJECTS): $(LXC_GENERATED)
+EXTRA_DIST += sanitytest.py
+
+check-local:
+ $(AM_V_GEN)PYTHONPATH=$(abs_topbuilddir):$(abs_topbuilddir)/.libs $(PYTHON) $(srcdir)/sanitytest.py
+
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(pyexecdir)
$(INSTALL) -m 0644 libvirt.py $(DESTDIR)$(pyexecdir)
Index: libvirt-1.0.2/python/generator.py
===================================================================
--- libvirt-1.0.2.orig/python/generator.py
+++ libvirt-1.0.2/python/generator.py
@@ -122,8 +122,9 @@ class docParser(xml.sax.handler.ContentH
if attrs.has_key('field'):
self.function_return_field = attrs['field']
elif tag == 'enum':
+ # enums come from header files, hence virterror.h
if (attrs['file'] == "libvirt" or
- attrs['file'] == "virerror"):
+ attrs['file'] == "virterror"):
enum(attrs['type'],attrs['name'],attrs['value'])
elif attrs['file'] == "libvirt-lxc":
lxc_enum(attrs['type'],attrs['name'],attrs['value'])
@@ -134,6 +135,7 @@ class docParser(xml.sax.handler.ContentH
if debug:
print "end %s" % tag
if tag == 'function':
+ # fuctions come from source files, hence 'virerror.c'
if self.function != None:
if (self.function_module == "libvirt" or
self.function_module == "virevent" or
Index: libvirt-1.0.2/python/sanitytest.py
===================================================================
--- /dev/null
+++ libvirt-1.0.2/python/sanitytest.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+
+import libvirt
+
+globals = dir(libvirt)
+
+# Sanity test that the generator hasn't gone wrong
+
+# Look for core classes
+assert("virConnect" in globals)
+assert("virDomain" in globals)
+assert("virDomainSnapshot" in globals)
+assert("virInterface" in globals)
+assert("virNWFilter" in globals)
+assert("virNodeDevice" in globals)
+assert("virNetwork" in globals)
+assert("virSecret" in globals)
+assert("virStoragePool" in globals)
+assert("virStorageVol" in globals)
+assert("virStream" in globals)
+assert("VIR_CONNECT_RO" in globals)
+
+# Error related bits
+assert("libvirtError" in globals)
+assert("VIR_ERR_AUTH_FAILED" in globals)
+assert("virGetLastError" in globals)
+
+# Some misc methods
+assert("virInitialize" in globals)
+assert("virEventAddHandle" in globals)
+assert("virEventRegisterDefaultImpl" in globals)
++++++ 567779e5-libxl-default-disk-backend.patch ++++++
commit 567779e51a7727b021dee095c9d75cf0cde0bd43
Author: Jim Fehlig
Date: Wed Feb 20 13:02:28 2013 -0700
libxl: Fix setting of disk backend
The libxl driver was setting the backend field of libxl_device_disk
structure to LIBXL_DISK_BACKEND_TAP when the driver element of disk
configuration was not specified. This needlessly forces the use of
blktap driver, which may not be loaded in dom0
https://bugzilla.redhat.com/show_bug.cgi?id=912488
Ian Campbell suggested that LIBXL_DISK_BACKEND_UNKNOWN is a better
default in this case
https://www.redhat.com/archives/libvir-list/2013-February/msg01126.html
Index: libvirt-1.0.2/src/libxl/libxl_conf.c
===================================================================
--- libvirt-1.0.2.orig/src/libxl/libxl_conf.c
+++ libvirt-1.0.2/src/libxl/libxl_conf.c
@@ -525,9 +525,13 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk
return -1;
}
} else {
- /* No driverName - default to raw/tap?? */
+ /*
+ * If driverName is not specified, default to raw as per
+ * xl-disk-configuration.txt in the xen documentation and let
+ * libxl pick a suitable backend.
+ */
x_disk->format = LIBXL_DISK_FORMAT_RAW;
- x_disk->backend = LIBXL_DISK_BACKEND_TAP;
+ x_disk->backend = LIBXL_DISK_BACKEND_UNKNOWN;
}
/* XXX is this right? */
++++++ 5ba077dc-iface-bond.patch ++++++
commit 5ba077dcd0775d5fc5b8d3691c0a68b46e44ff9e
Author: Jim Fehlig
Date: Thu Mar 21 15:44:11 2013 -0600
Fix parsing of bond interface XML
Noticed that parsing bond interface XML containing the miimon element
fails
<interface type="bond" name="bond0">
...
<bond mode="active-backup">
<miimon freq="100" carrier="netif"/>
...
</bond>
</interface>
This configuration does not contain the optional updelay and downdelay
attributes, but parsing will fail due to returning the result of
virXPathULong (a -1 when the attribute doesn't exist) from
virInterfaceDefParseBond after examining the updelay attribute.
While fixing this bug, cleanup the function to use virXPathInt instead
of virXPathULong, and store the result directly instead of using a tmp
variable. Using virXPathInt actually fixes a potential silent
truncation bug noted by Eric Blake.
Also, there is no cleanup in the error label. Remove the label,
returning failure where failure occurs and success if the end of the
function is reached.
Index: libvirt-1.0.2/src/conf/interface_conf.c
===================================================================
--- libvirt-1.0.2.orig/src/conf/interface_conf.c
+++ libvirt-1.0.2/src/conf/interface_conf.c
@@ -572,81 +572,72 @@ error:
static int
virInterfaceDefParseBond(virInterfaceDefPtr def,
xmlXPathContextPtr ctxt) {
- int ret = -1;
- unsigned long tmp;
+ int res;
def->data.bond.mode = virInterfaceDefParseBondMode(ctxt);
if (def->data.bond.mode < 0)
- goto error;
+ return -1;
- ret = virInterfaceDefParseBondItfs(def, ctxt);
- if (ret != 0)
- goto error;
+ if (virInterfaceDefParseBondItfs(def, ctxt) != 0)
+ return -1;
if (virXPathNode("./miimon[1]", ctxt) != NULL) {
def->data.bond.monit = VIR_INTERFACE_BOND_MONIT_MII;
- ret = virXPathULong("string(./miimon/@freq)", ctxt, &tmp);
- if ((ret == -2) || (ret == -1)) {
+ res = virXPathInt("string(./miimon/@freq)", ctxt,
+ &def->data.bond.frequency);
+ if ((res == -2) || (res == -1)) {
virReportError(VIR_ERR_XML_ERROR,
"%s", _("bond interface miimon freq missing or invalid"));
- goto error;
+ return -1;
}
- def->data.bond.frequency = (int) tmp;
- ret = virXPathULong("string(./miimon/@downdelay)", ctxt, &tmp);
- if (ret == -2) {
+ res = virXPathInt("string(./miimon/@downdelay)", ctxt,
+ &def->data.bond.downdelay);
+ if (res == -2) {
virReportError(VIR_ERR_XML_ERROR,
"%s", _("bond interface miimon downdelay invalid"));
- goto error;
- } else if (ret == 0) {
- def->data.bond.downdelay = (int) tmp;
+ return -1;
}
- ret = virXPathULong("string(./miimon/@updelay)", ctxt, &tmp);
- if (ret == -2) {
+ res = virXPathInt("string(./miimon/@updelay)", ctxt,
+ &def->data.bond.updelay);
+ if (res == -2) {
virReportError(VIR_ERR_XML_ERROR,
"%s", _("bond interface miimon updelay invalid"));
- goto error;
- } else if (ret == 0) {
- def->data.bond.updelay = (int) tmp;
+ return -1;
}
def->data.bond.carrier = virInterfaceDefParseBondMiiCarrier(ctxt);
- if (def->data.bond.carrier < 0) {
- ret = -1;
- goto error;
- }
+ if (def->data.bond.carrier < 0)
+ return -1;
} else if (virXPathNode("./arpmon[1]", ctxt) != NULL) {
def->data.bond.monit = VIR_INTERFACE_BOND_MONIT_ARP;
- ret = virXPathULong("string(./arpmon/@interval)", ctxt, &tmp);
- if ((ret == -2) || (ret == -1)) {
+ res = virXPathInt("string(./arpmon/@interval)", ctxt,
+ &def->data.bond.interval);
+ if ((res == -2) || (res == -1)) {
virReportError(VIR_ERR_XML_ERROR,
"%s", _("bond interface arpmon interval missing or invalid"));
- goto error;
+ return -1;
}
- def->data.bond.interval = (int) tmp;
def->data.bond.target =
virXPathString("string(./arpmon/@target)", ctxt);
if (def->data.bond.target == NULL) {
virReportError(VIR_ERR_XML_ERROR,
"%s", _("bond interface arpmon target missing"));
- ret = -1;
- goto error;
+ return -1;
}
def->data.bond.validate = virInterfaceDefParseBondArpValid(ctxt);
- if (def->data.bond.validate < 0) {
- ret = -1;
- goto error;
- }
+ if (def->data.bond.validate < 0)
+ return -1;
}
-error:
- return ret;
+
+ return 0;
}
static int
++++++ 95c6cc34-selinux.patch ++++++
commit 95c6cc344bec8405636d2a59fc0c34e0581001ab
Author: Daniel P. Berrange
Date: Wed May 15 16:26:59 2013 +0100
Don't mount selinux fs in LXC if selinux is disabled
Before trying to mount the selinux filesystem in a container
use is_selinux_enabled() to check if the machine actually
has selinux support (eg not booted with selinux=0)
Signed-off-by: Daniel P. Berrange
Index: libvirt-1.0.2/src/lxc/lxc_container.c
===================================================================
--- libvirt-1.0.2.orig/src/lxc/lxc_container.c
+++ libvirt-1.0.2/src/lxc/lxc_container.c
@@ -547,6 +547,12 @@ static int lxcContainerMountBasicFS(bool
(access(srcpath, R_OK) < 0))
continue;
+#if WITH_SELINUX
+ if (STREQ(mnts[i].src, SELINUX_MOUNT) &&
+ !is_selinux_enabled())
+ continue;
+#endif
+
if (virFileMakePath(mnts[i].dst) < 0) {
virReportSystemError(errno,
_("Failed to mkdir %s"),
++++++ AF_PACKET.patch ++++++
Index: libvirt-1.0.2/src/util/virnetdev.c
===================================================================
--- libvirt-1.0.2.orig/src/util/virnetdev.c
+++ libvirt-1.0.2/src/util/virnetdev.c
@@ -81,7 +81,7 @@ static int virNetDevSetupControlFull(con
static int virNetDevSetupControl(const char *ifname,
struct ifreq *ifr)
{
- return virNetDevSetupControlFull(ifname, ifr, AF_PACKET, SOCK_DGRAM);
+ return virNetDevSetupControlFull(ifname, ifr, AF_INET, SOCK_STREAM);
}
#endif
Index: libvirt-1.0.2/src/util/virnetdevbridge.c
===================================================================
--- libvirt-1.0.2.orig/src/util/virnetdevbridge.c
+++ libvirt-1.0.2/src/util/virnetdevbridge.c
@@ -85,7 +85,7 @@ static int virNetDevSetupControlFull(con
static int virNetDevSetupControl(const char *ifname,
struct ifreq *ifr)
{
- return virNetDevSetupControlFull(ifname, ifr, AF_PACKET, SOCK_DGRAM);
+ return virNetDevSetupControlFull(ifname, ifr, AF_INET, SOCK_STREAM);
}
#endif
++++++ a6b8bae5-python-generator-fix1.patch ++++++
commit a6b8bae5a6a4752926eba409202ec061d81c6c8a
Author: Serge Hallyn
Date: Wed Jan 30 21:05:45 2013 -0600
complete virterror->virerror name change
Without these two string changes in generator.py, the
virGetLastError wrapper does not get created in
/usr/share/pyshared/libvirt.py. Noticed when running
tests with virt-install.
Signed-off-by: Serge Hallyn
Index: libvirt-1.0.2/python/generator.py
===================================================================
--- libvirt-1.0.2.orig/python/generator.py
+++ libvirt-1.0.2/python/generator.py
@@ -123,7 +123,7 @@ class docParser(xml.sax.handler.ContentH
self.function_return_field = attrs['field']
elif tag == 'enum':
if (attrs['file'] == "libvirt" or
- attrs['file'] == "virterror"):
+ attrs['file'] == "virerror"):
enum(attrs['type'],attrs['name'],attrs['value'])
elif attrs['file'] == "libvirt-lxc":
lxc_enum(attrs['type'],attrs['name'],attrs['value'])
@@ -137,7 +137,7 @@ class docParser(xml.sax.handler.ContentH
if self.function != None:
if (self.function_module == "libvirt" or
self.function_module == "virevent" or
- self.function_module == "virterror"):
+ self.function_module == "virerror"):
function(self.function, self.function_descr,
self.function_return, self.function_args,
self.function_file, self.function_module,
++++++ baselibs.conf ++++++
libvirt-client
requires -libvirt-<targettype>
libvirt-devel
requires -libvirt-<targettype>
++++++ ca697e90-CVE-2013-1962.patch ++++++
commit ca697e90d5bd6a6dfb94bfb6d4438bdf9a44b739
Author: Ján Tomko
Date: Fri Apr 12 17:30:56 2013 +0200
daemon: fix leak after listing all volumes
CVE-2013-1962
remoteDispatchStoragePoolListAllVolumes wasn't freeing the pool.
The pool also held a reference to the connection, preventing it from
getting freed and closing the netcf interface driver, which held two
sockets open.
Index: libvirt-1.0.2/daemon/remote.c
===================================================================
--- libvirt-1.0.2.orig/daemon/remote.c
+++ libvirt-1.0.2/daemon/remote.c
@@ -4233,6 +4233,8 @@ cleanup:
virStorageVolFree(vols[i]);
VIR_FREE(vols);
}
+ if (pool)
+ virStoragePoolFree(pool);
return rv;
}
++++++ clone.patch ++++++
Index: src/lxc/lxc_container.c
===================================================================
--- src/lxc/lxc_container.c.orig
+++ src/lxc/lxc_container.c
@@ -136,6 +136,7 @@ int lxcContainerHasReboot(void)
int cmd, v;
int status;
char *tmp;
+ int stacksize = getpagesize() * 4;
if (virFileReadAll("/proc/sys/kernel/ctrl-alt-del", 10, &buf) < 0)
return -1;
@@ -152,14 +153,21 @@ int lxcContainerHasReboot(void)
VIR_FREE(buf);
cmd = v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF;
- if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
+#ifdef __ia64__
+ stacksize *= 2;
+#endif
+ if (VIR_ALLOC_N(stack, stacksize) < 0) {
virReportOOMError();
return -1;
}
- childStack = stack + (getpagesize() * 4);
+ childStack = stack + stacksize;
+#ifdef __ia64__
+ cpid = __clone2(lxcContainerRebootChild, stack, stacksize, flags, &cmd);
+#else
cpid = clone(lxcContainerRebootChild, childStack, flags, &cmd);
+#endif
VIR_FREE(stack);
if (cpid < 0) {
virReportSystemError(errno, "%s",
@@ -2364,6 +2372,9 @@ int lxcContainerStart(virDomainDefPtr de
ttyPaths, nttyPaths, handshakefd};
/* allocate a stack for the container */
+#ifdef __ia64__
+ stacksize *= 2;
+#endif
if (VIR_ALLOC_N(stack, stacksize) < 0) {
virReportOOMError();
return -1;
@@ -2383,7 +2394,11 @@ int lxcContainerStart(virDomainDefPtr de
cflags |= CLONE_NEWNET;
}
+#ifdef __ia64__
+ pid = __clone2(lxcContainerChild, stack, stacksize, cflags, &args);
+#else
pid = clone(lxcContainerChild, stacktop, cflags, &args);
+#endif
VIR_FREE(stack);
VIR_DEBUG("clone() completed, new container PID is %d", pid);
@@ -2409,6 +2424,7 @@ int lxcContainerAvailable(int features)
int cpid;
char *childStack;
char *stack;
+ int stacksize = getpagesize() * 4;
if (features & LXC_CONTAINER_FEATURE_USER)
flags |= CLONE_NEWUSER;
@@ -2416,14 +2432,21 @@ int lxcContainerAvailable(int features)
if (features & LXC_CONTAINER_FEATURE_NET)
flags |= CLONE_NEWNET;
- if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
+#ifdef __ia64__
+ stacksize *= 2;
+#endif
+ if (VIR_ALLOC_N(stack, stacksize) < 0) {
VIR_DEBUG("Unable to allocate stack");
return -1;
}
- childStack = stack + (getpagesize() * 4);
+ childStack = stack + stacksize;
+#ifdef __ia64__
+ cpid = __clone2(lxcContainerDummyChild, stack, stacksize, flags, NULL);
+#else
cpid = clone(lxcContainerDummyChild, childStack, flags, NULL);
+#endif
VIR_FREE(stack);
if (cpid < 0) {
char ebuf[1024] ATTRIBUTE_UNUSED;
++++++ install-apparmor-profiles.patch ++++++
Index: libvirt-1.0.2/examples/apparmor/Makefile.am
===================================================================
--- libvirt-1.0.2.orig/examples/apparmor/Makefile.am
+++ libvirt-1.0.2/examples/apparmor/Makefile.am
@@ -1,8 +1,39 @@
## Copyright (C) 2005-2011 Red Hat, Inc.
## See COPYING.LIB for the License of this software
-EXTRA_DIST= \
- TEMPLATE \
- libvirt-qemu \
- usr.lib.libvirt.virt-aa-helper \
- usr.sbin.libvirtd
+EXTRA_DIST= \
+ TEMPLATE \
+ libvirt-qemu \
+ usr.lib.libvirt.virt-aa-helper.in \
+ usr.sbin.libvirtd.in
+
+if WITH_SECDRIVER_APPARMOR
+
+usr.lib.libvirt.virt-aa-helper: usr.lib.libvirt.virt-aa-helper.in
+ sed \
+ -e 's![@]libdir[@]!$(libdir)!g' \
+ < $< > $@-t
+ mv $@-t $@
+
+usr.sbin.libvirtd: usr.sbin.libvirtd.in
+ sed \
+ -e 's![@]libdir[@]!$(libdir)!g' \
+ < $< > $@-t
+ mv $@-t $@
+
+install-data-local: usr.sbin.libvirtd usr.lib.libvirt.virt-aa-helper
+ mkdir -p $(DESTDIR)$(sysconfdir)/apparmor.d/
+ $(INSTALL_DATA) usr.lib.libvirt.virt-aa-helper $(DESTDIR)$(sysconfdir)/apparmor.d/usr.lib.libvirt.virt-aa-helper
+ $(INSTALL_DATA) usr.sbin.libvirtd $(DESTDIR)$(sysconfdir)/apparmor.d/usr.sbin.libvirtd
+ mkdir -p $(DESTDIR)$(sysconfdir)/apparmor.d/libvirt
+ $(INSTALL_DATA) TEMPLATE $(DESTDIR)$(sysconfdir)/apparmor.d/libvirt/TEMPLATE
+ mkdir -p $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions
+ $(INSTALL_DATA) libvirt-qemu $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/libvirt-qemu
+
+uninstall-local::
+ rm -f $(DESTDIR)$(sysconfdir)/apparmor.d/usr.lib.libvirt.virt-aa-helper
+ rm -f $(DESTDIR)$(sysconfdir)/apparmor.d/usr.sbin.libvirtd
+ rm -f $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/libvirt-qemu
+ rm -f $(DESTDIR)$(sysconfdir)/apparmor.d/libvirt/TEMPLATE
+
+endif
Index: libvirt-1.0.2/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in
===================================================================
--- /dev/null
+++ libvirt-1.0.2/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in
@@ -0,0 +1,40 @@
+# Last Modified: Fri Aug 19 11:21:48 2011
+#include
+
+@libdir@/libvirt/virt-aa-helper {
+ #include
+
+ # needed for searching directories
+ capability dac_override,
+ capability dac_read_search,
+
+ # needed for when disk is on a network filesystem
+ network inet,
+
+ deny @{PROC}/[0-9]*/mounts r,
+ @{PROC}/filesystems r,
+
+ # for hostdev
+ /sys/devices/ r,
+ /sys/devices/** r,
+
+ @libdir@/libvirt/virt-aa-helper mr,
+ /sbin/apparmor_parser Ux,
+
+ /etc/apparmor.d/libvirt/* r,
+ /etc/apparmor.d/libvirt/libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]* rw,
+
+ # for backingstore -- allow access to non-hidden files in @{HOME} as well
+ # as storage pools
+ audit deny @{HOME}/.* mrwkl,
+ audit deny @{HOME}/.*/ rw,
+ audit deny @{HOME}/.*/** mrwkl,
+ audit deny @{HOME}/bin/ rw,
+ audit deny @{HOME}/bin/** mrwkl,
+ @{HOME}/ r,
+ @{HOME}/** r,
+ /var/lib/libvirt/images/ r,
+ /var/lib/libvirt/images/** r,
+ /var/lib/kvm/images/ r,
+ /var/lib/kvm/images/** r,
+}
Index: libvirt-1.0.2/examples/apparmor/usr.lib.libvirt.virt-aa-helper
===================================================================
--- libvirt-1.0.2.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper
+++ /dev/null
@@ -1,38 +0,0 @@
-# Last Modified: Mon Apr 5 15:10:27 2010
-#include
-
-/usr/lib/libvirt/virt-aa-helper {
- #include
-
- # needed for searching directories
- capability dac_override,
- capability dac_read_search,
-
- # needed for when disk is on a network filesystem
- network inet,
-
- deny @{PROC}/[0-9]*/mounts r,
- @{PROC}/filesystems r,
-
- # for hostdev
- /sys/devices/ r,
- /sys/devices/** r,
-
- /usr/lib/libvirt/virt-aa-helper mr,
- /sbin/apparmor_parser Ux,
-
- /etc/apparmor.d/libvirt/* r,
- /etc/apparmor.d/libvirt/libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]* rw,
-
- # for backingstore -- allow access to non-hidden files in @{HOME} as well
- # as storage pools
- audit deny @{HOME}/.* mrwkl,
- audit deny @{HOME}/.*/ rw,
- audit deny @{HOME}/.*/** mrwkl,
- audit deny @{HOME}/bin/ rw,
- audit deny @{HOME}/bin/** mrwkl,
- @{HOME}/ r,
- @{HOME}/** r,
- /var/lib/libvirt/images/ r,
- /var/lib/libvirt/images/** r,
-}
Index: libvirt-1.0.2/examples/apparmor/usr.sbin.libvirtd
===================================================================
--- libvirt-1.0.2.orig/examples/apparmor/usr.sbin.libvirtd
+++ /dev/null
@@ -1,52 +0,0 @@
-# Last Modified: Mon Apr 5 15:03:58 2010
-#include
-@{LIBVIRT}="libvirt"
-
-/usr/sbin/libvirtd {
- #include
-
- capability kill,
- capability net_admin,
- capability net_raw,
- capability setgid,
- capability sys_admin,
- capability sys_module,
- capability sys_ptrace,
- capability sys_nice,
- capability sys_chroot,
- capability setuid,
- capability dac_override,
- capability dac_read_search,
- capability fowner,
- capability chown,
- capability setpcap,
- capability mknod,
- capability fsetid,
-
- network inet stream,
- network inet dgram,
- network inet6 stream,
- network inet6 dgram,
-
- # Very lenient profile for libvirtd since we want to first focus on confining
- # the guests. Guests will have a very restricted profile.
- /** rwmkl,
-
- /bin/* Ux,
- /sbin/* Ux,
- /usr/bin/* Ux,
- /usr/sbin/* Ux,
-
- # force the use of virt-aa-helper
- audit deny /sbin/apparmor_parser rwxl,
- audit deny /etc/apparmor.d/libvirt/** wxl,
- audit deny /sys/kernel/security/apparmor/features rwxl,
- audit deny /sys/kernel/security/apparmor/matching rwxl,
- audit deny /sys/kernel/security/apparmor/.* rwxl,
- /sys/kernel/security/apparmor/profiles r,
- /usr/lib/libvirt/* PUxr,
-
- # allow changing to our UUID-based named profiles
- change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,
-
-}
Index: libvirt-1.0.2/examples/apparmor/usr.sbin.libvirtd.in
===================================================================
--- /dev/null
+++ libvirt-1.0.2/examples/apparmor/usr.sbin.libvirtd.in
@@ -0,0 +1,57 @@
+# Last Modified: Fri Aug 19 11:20:36 2011
+#include
+@{LIBVIRT}="libvirt"
+
+/usr/sbin/libvirtd {
+ #include
+
+ capability kill,
+ capability net_admin,
+ capability net_raw,
+ capability setgid,
+ capability sys_admin,
+ capability sys_module,
+ capability sys_ptrace,
+ capability sys_nice,
+ capability sys_chroot,
+ capability setuid,
+ capability dac_override,
+ capability dac_read_search,
+ capability fowner,
+ capability chown,
+ capability setpcap,
+ capability mknod,
+ capability fsetid,
+ capability ipc_lock,
+
+ network inet stream,
+ network inet dgram,
+ network inet6 stream,
+ network inet6 dgram,
+
+ # Very lenient profile for libvirtd since we want to first focus on confining
+ # the guests. Guests will have a very restricted profile.
+ /** rwmkl,
+
+ /bin/* Ux,
+ /sbin/* Ux,
+ /usr/bin/* Ux,
+ /usr/sbin/* Ux,
+ /usr/lib/xen/bin/qemu-dm Ux,
+ /usr/lib/PolicyKit/polkit-read-auth-helper Px,
+
+ # force the use of virt-aa-helper
+ audit deny /sbin/apparmor_parser rwxl,
+ audit deny /etc/apparmor.d/libvirt/** wxl,
+ audit deny /sys/kernel/security/apparmor/features rwxl,
+ audit deny /sys/kernel/security/apparmor/matching rwxl,
+ audit deny /sys/kernel/security/apparmor/.* rwxl,
+ /sys/kernel/security/apparmor/profiles r,
+ @libdir@/libvirt/* Pxr,
+ @libdir@/libvirt/libvirt_parthelper Ux,
+ @libdir@/libvirt/libvirt_iohelper Ux,
+
+ # allow changing to our UUID-based named profiles
+ change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,
+
+}
Index: libvirt-1.0.2/examples/apparmor/libvirt-qemu
===================================================================
--- libvirt-1.0.2.orig/examples/apparmor/libvirt-qemu
+++ libvirt-1.0.2/examples/apparmor/libvirt-qemu
@@ -52,6 +52,7 @@
# access to firmware's etc
/usr/share/kvm/** r,
/usr/share/qemu/** r,
+ /usr/share/qemu-kvm/** r,
/usr/share/bochs/** r,
/usr/share/openbios/** r,
/usr/share/openhackware/** r,
@@ -65,6 +66,7 @@
# the various binaries
/usr/bin/kvm rmix,
/usr/bin/qemu rmix,
+ /usr/bin/qemu-kvm rmix,
/usr/bin/qemu-system-arm rmix,
/usr/bin/qemu-system-cris rmix,
/usr/bin/qemu-system-i386 rmix,
++++++ libvirt-guests-init-script.patch ++++++
Adjust libvirt-guests init files to conform to SUSE standards
Index: libvirt-1.0.2/tools/libvirt-guests.init.in
===================================================================
--- libvirt-1.0.2.orig/tools/libvirt-guests.init.in
+++ libvirt-1.0.2/tools/libvirt-guests.init.in
@@ -3,15 +3,15 @@
# the following is the LSB init header
#
### BEGIN INIT INFO
-# Provides: libvirt-guests
-# Required-Start: libvirtd
-# Required-Stop: libvirtd
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
+# Provides: libvirt-guests
+# Required-Start: $network $remote_fs libvirtd
+# Required-Stop: $network $remote_fs libvirtd
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 4 6
# Short-Description: suspend/resume libvirt guests on shutdown/boot
-# Description: This is a script for suspending active libvirt guests
-# on shutdown and resuming them on next boot
-# See http://libvirt.org
+# Description: This is a script for suspending active libvirt guests
+# on shutdown and resuming them on next boot
+# See http://libvirt.org
### END INIT INFO
# the following is chkconfig init header
Index: libvirt-1.0.2/tools/libvirt-guests.sh.in
===================================================================
--- libvirt-1.0.2.orig/tools/libvirt-guests.sh.in
+++ libvirt-1.0.2/tools/libvirt-guests.sh.in
@@ -1,13 +1,12 @@
#!/bin/sh
+. /etc/rc.status
+rc_reset
+
sysconfdir="@sysconfdir@"
localstatedir="@localstatedir@"
libvirtd="@sbindir@"/libvirtd
-# Source function library.
-test ! -r "$sysconfdir"/rc.d/init.d/functions ||
- . "$sysconfdir"/rc.d/init.d/functions
-
# Source gettext library.
# Make sure this file is recognized as having translations: _("dummy")
. "@bindir@"/gettext.sh
@@ -26,9 +25,11 @@ test -f "$sysconfdir"/sysconfig/libvirt-
. "$sysconfdir"/sysconfig/libvirt-guests
LISTFILE="$localstatedir"/lib/libvirt/libvirt-guests
-VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests
-
-RETVAL=0
+if [ -d "$localstatedir"/lock/subsys ]; then
+ VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests
+else
+ VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/libvirt-guests
+fi
# retval COMMAND ARGUMENTS...
# run command with arguments and convert non-zero return value to 1 and set
@@ -36,7 +37,7 @@ RETVAL=0
retval() {
"$@"
if [ $? -ne 0 ]; then
- RETVAL=1
+ rc_failed 1
return 1
else
return 0
@@ -65,6 +66,25 @@ run_virsh_c() {
( export LC_ALL=C; run_virsh "$@" )
}
+await_daemon_up()
+{
+ uri=$1
+ i=1
+ rets=10
+ run_virsh $uri list > /dev/null 2>&1
+ while [ $? -ne 0 -a $i -lt $rets ]; do
+ sleep 1
+ echo -n .
+ i=$(($i + 1))
+ run_virsh $uri list > /dev/null 2>&1
+ done
+ if [ $i -eq $rets ]; then
+ echo $"libvirt-guests unable to connect to URI: $uri"
+ return 1
+ fi
+ return 0
+}
+
# test_connect URI
# check if URI is reachable
test_connect()
@@ -91,7 +111,7 @@ list_guests() {
list=$(run_virsh_c "$uri" list --uuid $persistent)
if [ $? -ne 0 ]; then
- RETVAL=1
+ rc_failed 1
return 1
fi
@@ -117,7 +137,7 @@ guest_is_on() {
guest_running=false
id=$(run_virsh "$uri" domid "$uuid")
if [ $? -ne 0 ]; then
- RETVAL=1
+ rc_failed 1
return 1
fi
@@ -165,6 +185,12 @@ start() {
test_connect "$uri" || continue
+ await_daemon_up $uri
+ if [ $? -ne 0 ]; then
+ echo $"Ignoring guests on $uri URI, can't connect"
+ continue
+ fi
+
eval_gettext "Resuming guests on \$uri URI..."; echo
for guest in $list; do
name=$(guest_name "$uri" "$guest")
@@ -377,7 +403,7 @@ shutdown_guests_parallel()
timeout=$(($timeout - 1))
if [ $timeout -le 0 ]; then
eval_gettext "Timeout expired while shutting down domains"; echo
- RETVAL=1
+ rc_failed 1
return
fi
else
@@ -405,7 +431,7 @@ stop() {
if [ $SHUTDOWN_TIMEOUT -lt 0 ]; then
gettext "SHUTDOWN_TIMEOUT must be equal or greater than 0"
echo
- RETVAL=6
+ rc_failed 6
return
fi
fi
@@ -453,14 +479,14 @@ stop() {
if [ $? -ne 0 ]; then
eval_gettext "Failed to list persistent guests on \$uri"
echo
- RETVAL=1
+ rc_failed 1
set +f
return
fi
else
gettext "Failed to list transient guests"
echo
- RETVAL=1
+ rc_failed 1
set +f
return
fi
@@ -519,14 +545,13 @@ gueststatus() {
rh_status() {
if [ -f "$LISTFILE" ]; then
gettext "stopped, with saved guests"; echo
- RETVAL=3
+ rc_failed 3
else
if [ -f "$VAR_SUBSYS_LIBVIRT_GUESTS" ]; then
gettext "started"; echo
else
gettext "stopped, with no saved guests"; echo
fi
- RETVAL=0
fi
}
@@ -570,4 +595,4 @@ case "$1" in
usage
;;
esac
-exit $RETVAL
+rc_exit
Index: libvirt-1.0.2/tools/libvirt-guests.sysconf
===================================================================
--- libvirt-1.0.2.orig/tools/libvirt-guests.sysconf
+++ libvirt-1.0.2/tools/libvirt-guests.sysconf
@@ -1,19 +1,29 @@
+## Path: System/Virtualization/libvirt-guests
+
+## Type: string
+## Default: default
# URIs to check for running guests
# example: URIS='default xen:/// vbox+tcp://host/system lxc:///'
-#URIS=default
+URIS=default
+## Type: string
+## Default: start
# action taken on host boot
# - start all guests which were running on shutdown are started on boot
# regardless on their autostart settings
# - ignore libvirt-guests init script won't start any guest on boot, however,
# guests marked as autostart will still be automatically started by
# libvirtd
-#ON_BOOT=start
+ON_BOOT=start
+## Type: integer
+## Default: 0
# Number of seconds to wait between each guest start. Set to 0 to allow
# parallel startup.
-#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
@@ -22,12 +32,16 @@
# 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.
-#ON_SHUTDOWN=suspend
+ON_SHUTDOWN=suspend
+## Type: integer
+## Default: 0
# If set to non-zero, shutdown will suspend guests concurrently. Number of
# guests on shutdown at any time will not exceed number set in this variable.
-#PARALLEL_SHUTDOWN=0
+PARALLEL_SHUTDOWN=0
+## Type: integer
+## Default: 300
# Number of seconds we're willing to wait for a guest to shut down. If parallel
# shutdown is enabled, this timeout applies as a timeout for shutting down all
# guests on a single URI defined in the variable URIS. If this is 0, then there
@@ -35,7 +49,9 @@
# request). The default value is 300 seconds (5 minutes).
#SHUTDOWN_TIMEOUT=300
+## Type: integer
+## Default: 0
# 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.
-#BYPASS_CACHE=0
+BYPASS_CACHE=0
++++++ libvirt-suse-netcontrol.patch ++++++
Index: libvirt-1.0.2/configure.ac
===================================================================
--- libvirt-1.0.2.orig/configure.ac
+++ libvirt-1.0.2/configure.ac
@@ -153,6 +153,7 @@ LIBVIRT_CHECK_DBUS
LIBVIRT_CHECK_FUSE
LIBVIRT_CHECK_HAL
LIBVIRT_CHECK_NETCF
+LIBVIRT_CHECK_NETCONTROL
LIBVIRT_CHECK_NUMACTL
LIBVIRT_CHECK_OPENWSMAN
LIBVIRT_CHECK_PCIACCESS
@@ -2199,11 +2200,12 @@ if test "$with_libvirtd" = "no" ; then
with_interface=no
fi
-dnl The interface driver depends on the netcf library or udev library
-case $with_interface:$with_netcf:$with_udev in
+dnl The interface driver depends on the netcf library, netcontrol library, or
+dnl udev library
+case $with_interface:$with_netcf:$with_netcontrol:$with_udev in
check:*yes*) with_interface=yes ;;
check:no:no) with_interface=no ;;
- yes:no:no) AC_MSG_ERROR([Requested the Interface driver without netcf or udev support]) ;;
+ yes:no:no) AC_MSG_ERROR([Requested the Interface driver without netcf, netcontrol, or udev support]) ;;
esac
if test "$with_interface" = "yes" ; then
@@ -2473,6 +2475,7 @@ LIBVIRT_RESULT_DBUS
LIBVIRT_RESULT_FUSE
LIBVIRT_RESULT_HAL
LIBVIRT_RESULT_NETCF
+LIBVIRT_RESULT_NETCONTROL
LIBVIRT_RESULT_NUMACTL
LIBVIRT_RESULT_OPENWSMAN
LIBVIRT_RESULT_PCIACCESS
Index: libvirt-1.0.2/src/Makefile.am
===================================================================
--- libvirt-1.0.2.orig/src/Makefile.am
+++ libvirt-1.0.2/src/Makefile.am
@@ -633,6 +633,10 @@ if WITH_NETCF
INTERFACE_DRIVER_SOURCES += \
interface/interface_backend_netcf.c
endif
+if WITH_NETCONTROL
+INTERFACE_DRIVER_SOURCES += \
+ interface/interface_backend_netcf.c
+endif
if WITH_UDEV
INTERFACE_DRIVER_SOURCES += \
interface/interface_backend_udev.c
@@ -1121,11 +1125,16 @@ if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
else
+if WITH_NETCONTROL
+libvirt_driver_interface_la_CFLAGS += $(NETCONTROL_CFLAGS)
+libvirt_driver_interface_la_LIBADD += $(NETCONTROL_LIBS)
+else
if WITH_UDEV
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
endif
endif
+endif
if WITH_DRIVER_MODULES
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
Index: libvirt-1.0.2/tools/virsh.c
===================================================================
--- libvirt-1.0.2.orig/tools/virsh.c
+++ libvirt-1.0.2/tools/virsh.c
@@ -2741,6 +2741,8 @@ vshShowVersion(vshControl *ctl ATTRIBUTE
vshPrint(ctl, " Interface");
# if defined(WITH_NETCF)
vshPrint(ctl, " netcf");
+# elif defined(WITH_NETCONTROL)
+ vshPrint(ctl, " netcontrol");
# elif defined(WITH_UDEV)
vshPrint(ctl, " udev");
# endif
Index: libvirt-1.0.2/src/interface/interface_backend_netcf.c
===================================================================
--- libvirt-1.0.2.orig/src/interface/interface_backend_netcf.c
+++ libvirt-1.0.2/src/interface/interface_backend_netcf.c
@@ -23,7 +23,12 @@
#include
-#include
+#ifdef WITH_NETCONTROL
+# include
+# include
+#else
+# include
+#endif
#include "virerror.h"
#include "datatypes.h"
@@ -52,6 +57,37 @@ static void interfaceDriverUnlock(struct
virMutexUnlock(&driver->lock);
}
+#ifdef WITH_NETCONTROL
+static void interface_nc_log_driver(const char *category,
+ int priority,
+ const char *func,
+ const char *file,
+ long long line,
+ const char *msg,
+ size_t len ATTRIBUTE_UNUSED)
+{
+ int vp;
+
+ switch(priority) {
+ case NC_LOG_FATAL:
+ case NC_LOG_ERROR:
+ vp = VIR_LOG_ERROR;
+ break;
+ case NC_LOG_WARN:
+ vp = VIR_LOG_WARN;
+ break;
+ case NC_LOG_INFO:
+ vp = VIR_LOG_INFO;
+ break;
+ case NC_LOG_DEBUG:
+ default:
+ vp = VIR_LOG_DEBUG;
+ break;
+ }
+ virLogMessage(VIR_LOG_FROM_FILE, vp, file, line, func, 0, "%s", msg);
+}
+#endif
+
static int netcf_to_vir_err(int netcf_errcode)
{
switch (netcf_errcode)
@@ -137,6 +173,10 @@ static virDrvOpenStatus interfaceOpenInt
goto mutex_error;
}
+#ifdef WITH_NETCONTROL
+ nc_logger_redirect_to(interface_nc_log_driver);
+#endif
+
/* open netcf */
if (ncf_init(&driverState->netcf, NULL) != 0)
{
Index: libvirt-1.0.2/src/interface/interface_driver.c
===================================================================
--- libvirt-1.0.2.orig/src/interface/interface_driver.c
+++ libvirt-1.0.2/src/interface/interface_driver.c
@@ -28,8 +28,15 @@ interfaceRegister(void) {
if (netcfIfaceRegister() == 0)
return 0;
#endif /* WITH_NETCF */
+#ifdef WITH_NETCONTROL
+ /* Attempt to load the netcontrol based backend, which is a slightly
+ patched netcf backend */
+ if (netcfIfaceRegister() == 0)
+ return 0;
+#endif /* WITH_NETCONTROL */
#if WITH_UDEV
- /* If there's no netcf or it failed to load, register the udev backend */
+ /* If there's no netcf or netcontrol, or it failed to load, register the
+ udev backend */
if (udevIfaceRegister() == 0)
return 0;
#endif /* WITH_UDEV */
Index: libvirt-1.0.2/m4/virt-netcontrol.m4
===================================================================
--- /dev/null
+++ libvirt-1.0.2/m4/virt-netcontrol.m4
@@ -0,0 +1,35 @@
+dnl The libnetcontrol library
+dnl
+dnl Copyright (C) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl http://www.gnu.org/licenses/.
+dnl
+
+AC_DEFUN([LIBVIRT_CHECK_NETCONTROL],[
+ LIBVIRT_CHECK_PKG([NETCONTROL], [netcontrol], [0.2.0])
+
+ if test "$with_netcontrol" = "yes" ; then
+ old_CFLAGS="$CFLAGS"
+ old_LIBS="$CFLAGS"
+ CFLAGS="$CFLAGS $NETCONTROL_CFLAGS"
+ LIBS="$LIBS $NETCONTROL_LIBS"
+ CFLAGS="$old_CFLAGS"
+ LIBS="$old_LIBS"
+ fi
+])
+
+AC_DEFUN([LIBVIRT_RESULT_NETCONTROL],[
+ LIBVIRT_RESULT_LIB([NETCONTROL])
+])
++++++ libvirtd-defaults.patch ++++++
Index: libvirt-1.0.2/daemon/libvirtd.conf
===================================================================
--- libvirt-1.0.2.orig/daemon/libvirtd.conf
+++ libvirt-1.0.2/daemon/libvirtd.conf
@@ -18,8 +18,8 @@
# It is necessary to setup a CA and issue server certificates before
# using this capability.
#
-# This is enabled by default, uncomment this to disable it
-#listen_tls = 0
+# This is disabled by default, uncomment this to enable it
+#listen_tls = 1
# Listen for unencrypted TCP connections on the public TCP/IP port.
# NB, must pass the --listen flag to the libvirtd process for this to
Index: libvirt-1.0.2/daemon/libvirtd-config.c
===================================================================
--- libvirt-1.0.2.orig/daemon/libvirtd-config.c
+++ libvirt-1.0.2/daemon/libvirtd-config.c
@@ -233,7 +233,7 @@ daemonConfigNew(bool privileged ATTRIBUT
return NULL;
}
- data->listen_tls = 1;
+ data->listen_tls = 0;
data->listen_tcp = 0;
if (!(data->tls_port = strdup(LIBVIRTD_TLS_PORT)))
++++++ libvirtd-init-script.patch ++++++
Adjust libvirtd sysconfig file to conform to SUSE standards
Index: libvirt-1.0.2/daemon/libvirtd.sysconf
===================================================================
--- libvirt-1.0.2.orig/daemon/libvirtd.sysconf
+++ libvirt-1.0.2/daemon/libvirtd.sysconf
@@ -1,16 +1,25 @@
+## Path: System/Virtualization/libvirt
+
+## Type: string
+## Default: /etc/libvirt/libvirtd.conf
# Override the default config file
# NOTE: This setting is no longer honoured if using
# systemd. Set '--config /etc/libvirt/libvirtd.conf'
# in LIBVIRTD_ARGS instead.
-#LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
+LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
-# Listen for TCP/IP connections
-# NB. must setup TLS/SSL keys prior to using this
-#LIBVIRTD_ARGS="--listen"
+## Type: string
+## Default: --listen
+# Arguments to pass to libvirtd
+LIBVIRTD_ARGS="--listen"
+## Type: string
+## Default: none
# Override Kerberos service keytab for SASL/GSSAPI
#KRB5_KTNAME=/etc/libvirt/krb5.tab
+## Type: string
+## Default: none
# Override the QEMU/SDL default audio driver probing when
# starting virtual machines using SDL graphics
#
@@ -20,5 +29,7 @@
#
#SDL_AUDIODRIVER=pulse
-# Override the maximum number of opened files
-#LIBVIRTD_NOFILES_LIMIT=2048
+## Type: integer
+## Default: 2048
+## Override the maximum number of opened files
+LIBVIRTD_NOFILES_LIMIT=2048
++++++ libvirtd-relocation-server.fw ++++++
## Name: Libvirtd Relocation Server
## Description: Enables libvirtd plain relocation service
TCP="49152:49215"
++++++ libvirtd.init ++++++
#!/bin/sh
# the following is the LSB init header see
# http://www.linux-foundation.org/spec//booksets/LSB-Core-generic/LSB-Core-gen...
#
### BEGIN INIT INFO
# Provides: libvirtd
# Required-Start: $network $remote_fs
# Should-Start: xend cgconfig
# Default-Start: 3 5
# Required-Stop: $network $remote_fs
# Should-Stop: xend cgconfig
# Default-Stop: 0 1 2 4 6
# Short-Description: daemon for libvirt virtualization API
# Description: This is a daemon for managing QEMU guest instances
# and libvirt virtual networks
# See http://libvirt.org
### END INIT INFO
LIBVIRTD_BIN=/usr/sbin/libvirtd
LIBVIRTD_PIDFILE=/var/run/libvirtd.pid
test -x $LIBVIRTD_BIN || { echo "$LIBVIRD_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
. /etc/rc.status
rc_reset
test -f /etc/sysconfig/libvirtd && . /etc/sysconfig/libvirtd
LIBVIRTD_CONFIG_ARGS=
if [ -n "$LIBVIRTD_CONFIG" ]
then
LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
fi
case "$1" in
start)
if [ -e $LIBVIRTD_PIDFILE ]; then
if checkproc $LIBVIRTD_BIN ; then
echo -n "libvirtd is already running."
rc_status -v
exit
else
echo "Removing stale PID file $LIBVIRTD_PIDFILE."
rm -f $LIBVIRTD_PIDFILE
fi
fi
echo -n "Starting libvirtd "
mkdir -p /var/cache/libvirt
rm -rf /var/cache/libvirt/*
# LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled
# automatically
if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then
ulimit -n "$LIBVIRTD_NOFILES_LIMIT"
fi
startproc $LIBVIRTD_BIN --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
rc_status -v
;;
stop)
echo -n "Shutting down libvirtd "
rm -f /var/lock/subsys/libvirtd
rm -rf /var/cache/libvirt/*
killproc -TERM $LIBVIRTD_BIN > /dev/null 2>&1
rm -f $LIBVIRTD_PIDFILE
rc_status -v
;;
try-restart)
$0 status >/dev/null && $0 restart
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
reload)
killproc -HUP $LIBVIRTD_BIN
rc_status -v
;;
status)
echo -n "Checking status of libvirtd "
checkproc $LIBVIRTD_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart|try-restart|reload|status}"
rc_failed 2
rc_exit
;;
esac
rc_exit
++++++ relax-qemu-usergroup-check.patch ++++++
Allow qemu driver (and hence libvirtd) to load when qemu
user:group does not exist. The kvm package, which may not
exist on a xen host, creates qemu user:group.
A better (future) solution would be to build the libvirtd
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-1.0.2/src/qemu/qemu_conf.c
===================================================================
--- libvirt-1.0.2.orig/src/qemu/qemu_conf.c
+++ libvirt-1.0.2/src/qemu/qemu_conf.c
@@ -247,7 +247,7 @@ int qemuLoadDriverConfig(virQEMUDriverPt
goto no_memory;
if (virGetUserID(user, &driver->user) < 0)
- goto cleanup;
+ VIR_WARN("User %s does not exist! Continuing...", user);
p = virConfGetValue(conf, "group");
CHECK_TYPE("group", VIR_CONF_STRING);
@@ -255,7 +255,7 @@ int qemuLoadDriverConfig(virQEMUDriverPt
goto no_memory;
if (virGetGroupID(group, &driver->group) < 0)
- goto cleanup;
+ VIR_WARN("Group %s does not exist! Continuing...", group);
GET_VALUE_LONG("dynamic_ownership", driver->dynamicOwnership);
++++++ suse-qemu-conf.patch ++++++
Index: libvirt-1.0.2/src/qemu/qemu.conf
===================================================================
--- libvirt-1.0.2.orig/src/qemu/qemu.conf
+++ libvirt-1.0.2/src/qemu/qemu.conf
@@ -169,7 +169,16 @@
# a special value; security_driver can be set to that value in
# isolation, but it cannot appear in a list of drivers.
#
+# SUSE Note:
+# Currently, Apparmor is the default security framework in SUSE
+# distros. If Apparmor is enabled on the host, libvirtd is
+# generously confined but users must opt-in to confine qemu
+# instances. Change this to 'apparmor' to enable Apparmor
+# confinement of qemu instances.
+#
#security_driver = "selinux"
+# security_driver = "apparmor"
+security_driver = "none"
# If set to non-zero, then the default security labeling
# will make guests confined. If set to zero, then guests
@@ -357,6 +366,15 @@
#allow_disk_format_probing = 1
+# SUSE note:
+# Many lock managers, sanlock included, will kill the resources
+# they protect when terminated. E.g. the sanlock daemon will kill
+# any virtual machines for which it holds disk leases when the
+# daemon is stopped or restarted. Administrators must be vigilant
+# when enabling a lock manager since simply updating the manager
+# may cause it to be restarted, potentially killing the resources
+# it protects.
+#
# To enable 'Sanlock' project based locking of the file
# content (to prevent two VMs writing to the same
# disk), uncomment this
++++++ virtlockd-init-script.patch ++++++
Adjust virtlockd init files to conform to SUSE standards
Index: libvirt-1.0.2/src/locking/virtlockd.sysconf
===================================================================
--- libvirt-1.0.2.orig/src/locking/virtlockd.sysconf
+++ libvirt-1.0.2/src/locking/virtlockd.sysconf
@@ -1,3 +1,7 @@
+## Path: System/Virtualization/virtlockd
+
+## Type: string
+## Default: ""
#
# Pass extra arguments to virtlockd
#VIRTLOCKD_ARGS=
Index: libvirt-1.0.2/src/locking/virtlockd.init.in
===================================================================
--- libvirt-1.0.2.orig/src/locking/virtlockd.init.in
+++ libvirt-1.0.2/src/locking/virtlockd.init.in
@@ -4,11 +4,13 @@
# http://www.linux-foundation.org/spec//booksets/LSB-Core-generic/LSB-Core-gen...
#
### BEGIN INIT INFO
-# Provides: virtlockd
-# Default-Start: 3 4 5
+# Provides: virtlockd
+# Required-Start: $network $remote_fs
+# Default-Start: 3 4 5
+# Required-Stop: $network $remote_fs
# Short-Description: virtual machine lock manager
-# Description: This is a daemon for managing locks
-# on virtual machine disk images
+# Description: This is a daemon for managing locks
+# on virtual machine disk images
### END INIT INFO
# the following is chkconfig init header
@@ -23,35 +25,39 @@
# pidfile: @localstatedir@/run/libvirt/virtlockd.pid
#
-# Source function library.
-. @sysconfdir@/rc.d/init.d/functions
+. @sysconfdir@/rc.status
+rc_reset
SERVICE=virtlockd
-PROCESS=virtlockd
+PROCESS=@sbindir@/virtlockd
PIDFILE=@localstatedir@/run/libvirt/lockd/$SERVICE.pid
VIRTLOCKD_ARGS=
test -f @sysconfdir@/sysconfig/virtlockd && . @sysconfdir@/sysconfig/virtlockd
-RETVAL=0
+if [ -d @localstatedir@/lock/subsys ]; then
+ VAR_SUBSYS_VIRTLOCKD=@localstatedir@/lock/subsys/$SERVICE
+else
+ VAR_SUBSYS_VIRTLOCKD=@localstatedir@/lock/$SERVICE
+fi
start() {
- echo -n $"Starting $SERVICE daemon: "
- daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $VIRTLOCKD_ARGS
+ echo -n $"Starting $SERVICE "
+ startproc $PROCESS --daemon $VIRTLOCKD_ARGS
RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE
+ rc_status -v
+ [ $RETVAL -eq 0 ] && touch $VAR_SUBSYS_VIRTLOCKD
}
stop() {
- echo -n $"Stopping $SERVICE daemon: "
+ echo -n $"Stopping $SERVICE "
- killproc -p $PIDFILE $PROCESS
+ killproc -p $PIDFILE $PROCESS > /dev/null 2>&1
RETVAL=$?
- echo
+ rc_status -v
if [ $RETVAL -eq 0 ]; then
- rm -f @localstatedir@/lock/subsys/$SERVICE
+ rm -f $VAR_SUBSYS_VIRTLOCKD
rm -f $PIDFILE
fi
}
@@ -65,9 +71,7 @@ reload() {
echo -n $"Reloading $SERVICE configuration: "
killproc -p $PIDFILE $PROCESS -HUP
- RETVAL=$?
- echo
- return $RETVAL
+ rc_status
}
# See how we were called.
@@ -76,18 +80,20 @@ case "$1" in
$1
;;
status)
- status -p $PIDFILE $PROCESS
- RETVAL=$?
+ echo -n "Checking status of $SERVICE "
+ checkproc $PROCESS
+ rc_status -v
;;
force-reload)
reload
;;
condrestart|try-restart)
- [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || :
+ [ -f $VAR_SUBSYS_VIRTLOCKD ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}"
- exit 2
+ rc_failed 2
+ rc_exit
;;
esac
-exit $RETVAL
+rc_exit
++++++ xen-name-for-devid.patch ++++++
Do not search xenstore for disk/network/PCI device IDs
Disk, network, and PCI devices can be referenced by name in Xen,
e.g. when modifying their configuration or remvoving them. As such,
don't search xenstore for a device ID corresponding to these devices.
Instead, search the devices contained in the domain definition and use
the devices's target name if found.
Note that for network devices, the mac address is used for the device
name. For PCI devices, the bdf (bus:dev:fun) specifier is used for
the device name.
This approach allows removing a disk/network/PCI device when domain
is inactive. We obviously can't search xenstore when the domain is
inactive.
Index: libvirt-1.0.2/src/xen/xend_internal.c
===================================================================
--- libvirt-1.0.2.orig/src/xen/xend_internal.c
+++ libvirt-1.0.2/src/xen/xend_internal.c
@@ -61,6 +61,7 @@
static int
virDomainXMLDevID(virDomainPtr domain,
+ virDomainDefPtr domDef,
virDomainDeviceDefPtr dev,
char *class,
char *ref,
@@ -2760,7 +2761,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
sexpr = virBufferContentAndReset(&buf);
- if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref))) {
+ if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref))) {
/* device doesn't exist, define it */
ret = xend_op(domain->conn, domain->name, "op", "device_create",
"config", sexpr, NULL);
@@ -2881,7 +2882,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr
sexpr = virBufferContentAndReset(&buf);
- if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref))) {
+ if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref))) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("requested device does not exist"));
goto cleanup;
@@ -2976,7 +2977,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
def, xml, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
- if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref)))
+ if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref)))
goto cleanup;
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
@@ -3912,18 +3913,18 @@ struct xenUnifiedDriver xenDaemonDriver
* @dev: pointer to device config object
* @class: Xen device class "vbd" or "vif" (OUT)
* @ref: Xen device reference (OUT)
+ * @ref_len: Length of character buffer proviced by the ref parameter
*
* Set class according to XML root, and:
* - if disk, copy in ref the target name from description
- * - if network, get MAC address from description, scan XenStore and
- * copy in ref the corresponding vif number.
- * - if pci, get BDF from description, scan XenStore and
- * copy in ref the corresponding dev number.
+ * - if network, copy in ref the target MAC address from description
+ * - if pci, copy in ref the target BDF from description
*
* Returns 0 in case of success, -1 in case of failure.
*/
static int
virDomainXMLDevID(virDomainPtr domain,
+ virDomainDefPtr domDef,
virDomainDeviceDefPtr dev,
char *class,
char *ref,
@@ -3931,9 +3932,11 @@ virDomainXMLDevID(virDomainPtr domain,
{
xenUnifiedPrivatePtr priv = domain->conn->privateData;
char *xref;
- char *tmp;
+ unsigned int i;
if (dev->type == VIR_DOMAIN_DEVICE_DISK) {
+ if (dev->data.disk->dst == NULL)
+ return -1;
if (dev->data.disk->driverName &&
STREQ(dev->data.disk->driverName, "tap"))
strcpy(class, "tap");
@@ -3943,19 +3946,17 @@ virDomainXMLDevID(virDomainPtr domain,
else
strcpy(class, "vbd");
- if (dev->data.disk->dst == NULL)
- return -1;
- xenUnifiedLock(priv);
- xref = xenStoreDomainGetDiskID(domain->conn, domain->id,
- dev->data.disk->dst);
- xenUnifiedUnlock(priv);
- if (xref == NULL)
- return -1;
-
- tmp = virStrcpy(ref, xref, ref_len);
- VIR_FREE(xref);
- if (tmp == NULL)
- return -1;
+ /* For disks, the device name can be used directly. */
+ for (i = 0; i < domDef->ndisks; i++) {
+ virDomainDiskDefPtr disk = domDef->disks[i];
+ if (STREQ(dev->data.disk->dst, disk->dst)) {
+ if (virStrcpy(ref, disk->dst, ref_len) == NULL)
+ return -1;
+ else
+ return 0;
+ }
+ }
+ return -1;
} else if (dev->type == VIR_DOMAIN_DEVICE_NET) {
char mac[30];
virDomainNetDefPtr def = dev->data.net;
@@ -3965,17 +3966,22 @@ virDomainXMLDevID(virDomainPtr domain,
strcpy(class, "vif");
- xenUnifiedLock(priv);
- xref = xenStoreDomainGetNetworkID(domain->conn, domain->id,
- mac);
- xenUnifiedUnlock(priv);
- if (xref == NULL)
- return -1;
-
- tmp = virStrcpy(ref, xref, ref_len);
- VIR_FREE(xref);
- if (tmp == NULL)
- return -1;
+ /* For nics, the mac address can be used directly. */
+ for (i = 0; i < domDef->nnets; i++) {
+ char dst_mac[30];
+ virDomainNetDefPtr dst_net = domDef->nets[i];
+ snprintf(dst_mac, sizeof(dst_mac), "%02x:%02x:%02x:%02x:%02x:%02x",
+ dst_net->mac.addr[0], dst_net->mac.addr[1],
+ dst_net->mac.addr[2], dst_net->mac.addr[3],
+ dst_net->mac.addr[4], dst_net->mac.addr[5]);
+ if (STREQ(mac, dst_mac)) {
+ if (virStrcpy(ref, dst_mac, ref_len) == NULL)
+ return -1;
+ else
+ return 0;
+ }
+ }
+ return -1;
} else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
dev->data.hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
@@ -3993,17 +3999,44 @@ virDomainXMLDevID(virDomainPtr domain,
strcpy(class, "pci");
- xenUnifiedLock(priv);
- xref = xenStoreDomainGetPCIID(domain->conn, domain->id, bdf);
- xenUnifiedUnlock(priv);
- VIR_FREE(bdf);
- if (xref == NULL)
- return -1;
+ /* For PCI devices, the device BFD can be used directly. */
+ for (i = 0 ; i < domDef->nhostdevs ; i++) {
+ char *dst_bdf;
+ virDomainHostdevDefPtr hostdev = domDef->hostdevs[i];
+
+ if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
+ continue;
+ if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
+ continue;
+
+ if (virAsprintf(&dst_bdf, "%04x:%02x:%02x.%0x",
+ hostdev->source.subsys.u.pci.domain,
+ hostdev->source.subsys.u.pci.bus,
+ hostdev->source.subsys.u.pci.slot,
+ hostdev->source.subsys.u.pci.function) < 0) {
+ virReportOOMError();
+ VIR_FREE(bdf);
+ return -1;
+ }
- tmp = virStrcpy(ref, xref, ref_len);
- VIR_FREE(xref);
- if (tmp == NULL)
- return -1;
+ if (STREQ(bdf, dst_bdf)) {
+ if (virStrcpy(ref, dst_bdf, ref_len) == NULL) {
+ virReportOOMError();
+ VIR_FREE(dst_bdf);
+ VIR_FREE(bdf);
+ return -1;
+ }
+ else {
+ VIR_FREE(dst_bdf);
+ VIR_FREE(bdf);
+ return 0;
+ }
+ }
+ VIR_FREE(dst_bdf);
+ }
+
+ VIR_FREE(bdf);
+ return -1;
} else {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("hotplug of device type not supported"));
++++++ xen-pv-cdrom.patch ++++++
Index: libvirt-1.0.2/src/xenxs/xen_sxpr.c
===================================================================
--- libvirt-1.0.2.orig/src/xenxs/xen_sxpr.c
+++ libvirt-1.0.2/src/xenxs/xen_sxpr.c
@@ -341,7 +341,7 @@ error:
static int
xenParseSxprDisks(virDomainDefPtr def,
const struct sexpr *root,
- int hvm,
+ int hvm ATTRIBUTE_UNUSED,
int xendConfigVersion)
{
const struct sexpr *cur, *node;
@@ -392,7 +392,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")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("domain information incomplete, vbd has no src"));
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org