From 4514dc2f52c44196fe0587080b9bc32d8b0429bd11ff6623c963a674857c4316 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Tue, 4 Jun 2013 22:48:46 +0000 Subject: [PATCH] - Update to libvirt 1.0.6 - Move VirtualBox driver into libvirtd - Support for static routes on a virtual bridge - Various improvement for hostdev SCSI support - Switch to VIR_STRDUP and VIR_STRNDUP - Various cleanups and improvement in Xen and LXC drivers - Many incremental improvements and bug fixes, see http://libvirt.org/news.html - Drop upstream patches: f493d83f-cgroup-swap-control.patch, 486a86eb-cgroups-docs.patch, 0ced83dc-cgroup-escape-dot.patch, bbe97ae9-no-cgroups.patch, c2cf5f1c-no-cgroups-fix.patch, 95c6cc34-selinux.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=268 --- 0ced83dc-cgroup-escape-dot.patch | 24 -- 486a86eb-cgroups-docs.patch | 317 --------------------------- 95c6cc34-selinux.patch | 29 --- bbe97ae9-no-cgroups.patch | 102 --------- c2cf5f1c-no-cgroups-fix.patch | 49 ----- clone.patch | 12 +- f493d83f-cgroup-swap-control.patch | 34 --- fix-pci-attach-xen-driver.patch | 18 +- install-apparmor-profiles.patch | 36 +-- libvirt-1.0.5.1.tar.bz2 | 3 - libvirt-1.0.6.tar.bz2 | 3 + libvirt-guests-init-script.patch | 45 ++-- libvirt-suse-netcontrol.patch | 46 ++-- libvirt.changes | 16 ++ libvirt.spec | 19 +- libvirtd-defaults.patch | 16 +- libvirtd-init-script.patch | 6 +- relax-qemu-usergroup-check.patch | 8 +- support-managed-pci-xen-driver.patch | 30 +-- suse-qemu-conf.patch | 10 +- virtlockd-init-script.patch | 12 +- xen-name-for-devid.patch | 98 +++------ xen-pv-cdrom.patch | 10 +- 23 files changed, 176 insertions(+), 767 deletions(-) delete mode 100644 0ced83dc-cgroup-escape-dot.patch delete mode 100644 486a86eb-cgroups-docs.patch delete mode 100644 95c6cc34-selinux.patch delete mode 100644 bbe97ae9-no-cgroups.patch delete mode 100644 c2cf5f1c-no-cgroups-fix.patch delete mode 100644 f493d83f-cgroup-swap-control.patch delete mode 100644 libvirt-1.0.5.1.tar.bz2 create mode 100644 libvirt-1.0.6.tar.bz2 diff --git a/0ced83dc-cgroup-escape-dot.patch b/0ced83dc-cgroup-escape-dot.patch deleted file mode 100644 index 8088327..0000000 --- a/0ced83dc-cgroup-escape-dot.patch +++ /dev/null @@ -1,24 +0,0 @@ -commit 0ced83dcfbb19af1201202e1af0a7073c338aabd -Author: Daniel P. Berrange -Date: Fri May 3 20:56:50 2013 +0100 - - Escaping leading '.' in cgroup names - - Escaping a leading '.' with '_' in the cgroup names - - Signed-off-by: Daniel P. Berrange - -Index: libvirt-1.0.5.1/src/util/vircgroup.c -=================================================================== ---- libvirt-1.0.5.1.orig/src/util/vircgroup.c -+++ libvirt-1.0.5.1/src/util/vircgroup.c -@@ -1106,7 +1106,8 @@ static int virCgroupPartitionNeedsEscapi - if (STRPREFIX(path, "cgroup.")) - return 1; - -- if (path[0] == '_') -+ if (path[0] == '_' || -+ path[0] == '.') - return 1; - - if (!(fp = fopen("/proc/cgroups", "r"))) diff --git a/486a86eb-cgroups-docs.patch b/486a86eb-cgroups-docs.patch deleted file mode 100644 index 57e3a8b..0000000 --- a/486a86eb-cgroups-docs.patch +++ /dev/null @@ -1,317 +0,0 @@ -commit 486a86eb184c008c5957fb68c63f163289f3344b -Author: Daniel P. Berrange -Date: Fri May 3 16:58:26 2013 +0100 - - Add docs about cgroups layout and usage - - Describe the new cgroups layout, how to customize placement - of guests and what virsh commands are used to access the - parameters. - - Signed-off-by: Daniel P. Berrange - -Index: libvirt-1.0.5.1/docs/cgroups.html.in -=================================================================== ---- /dev/null -+++ libvirt-1.0.5.1/docs/cgroups.html.in -@@ -0,0 +1,285 @@ -+ -+ -+ -+ -+

Control Groups Resource Management

-+ -+
    -+ -+

    -+ The QEMU and LXC drivers make use of the Linux "Control Groups" facility -+ for applying resource management to their virtual machines and containers. -+

    -+ -+

    Required controllers

    -+ -+

    -+ The control groups filesystem supports multiple "controllers". By default -+ the init system (such as systemd) should mount all controllers compiled -+ into the kernel at /sys/fs/cgroup/$CONTROLLER-NAME. Libvirt -+ will never attempt to mount any controllers itself, merely detect where -+ they are mounted. -+

    -+ -+

    -+ The QEMU driver is capable of using the cpuset, -+ cpu, memory, blkio and -+ devices controllers. None of them are compulsory. -+ If any controller is not mounted, the resource management APIs -+ which use it will cease to operate. It is possible to explicitly -+ turn off use of a controller, even when mounted, via the -+ /etc/libvirt/qemu.conf configuration file. -+

    -+ -+

    -+ The LXC driver is capable of using the cpuset, -+ cpu, cpuset, freezer, -+ memory, blkio and devices -+ controllers. The cpuset, devices -+ and memory controllers are compulsory. Without -+ them mounted, no containers can be started. If any of the -+ other controllers are not mounted, the resource management APIs -+ which use them will cease to operate. -+

    -+ -+

    Current cgroups layout

    -+ -+

    -+ As of libvirt 1.0.5 or later, the cgroups layout created by libvirt has been -+ simplified, in order to facilitate the setup of resource control policies by -+ administrators / management applications. The layout is based on the concepts of -+ "partitions" and "consumers". Each virtual machine or container is a consumer, -+ and has a corresponding cgroup named $VMNAME.libvirt-{qemu,lxc}. -+ Each consumer is associated with exactly one partition, which also have a -+ corresponding cgroup usually named $PARTNAME.partition. The -+ exceptions to this naming rule are the three top level default partitions, -+ named /system (for system services), /user (for -+ user login sessions) and /machine (for virtual machines and -+ containers). By default every consumer will of course be associated with -+ the /machine partition. This leads to a hierarchy that looks -+ like -+

    -+ -+
    -+$ROOT
    -+  |
    -+  +- system
    -+  |   |
    -+  |   +- libvirtd.service
    -+  |
    -+  +- machine
    -+      |
    -+      +- vm1.libvirt-qemu
    -+      |   |
    -+      |   +- emulator
    -+      |   +- vcpu0
    -+      |   +- vcpu1
    -+      |
    -+      +- vm2.libvirt-qemu
    -+      |   |
    -+      |   +- emulator
    -+      |   +- vcpu0
    -+      |   +- vcpu1
    -+      |
    -+      +- vm3.libvirt-qemu
    -+      |   |
    -+      |   +- emulator
    -+      |   +- vcpu0
    -+      |   +- vcpu1
    -+      |
    -+      +- container1.libvirt-lxc
    -+      |
    -+      +- container2.libvirt-lxc
    -+      |
    -+      +- container3.libvirt-lxc
    -+    
    -+ -+

    -+ The default cgroups layout ensures that, when there is contention for -+ CPU time, it is shared equally between system services, user sessions -+ and virtual machines / containers. This prevents virtual machines from -+ locking the administrator out of the host, or impacting execution of -+ system services. Conversely, when there is no contention from -+ system services / user sessions, it is possible for virtual machines -+ to fully utilize the host CPUs. -+

    -+ -+

    Using custom partitions

    -+ -+

    -+ If there is a need to apply resource constraints to groups of -+ virtual machines or containers, then the single default -+ partition /machine may not be sufficiently -+ flexible. The administrator may wish to sub-divide the -+ default partition, for example into "testing" and "production" -+ partitions, and then assign each guest to a specific -+ sub-partition. This is achieved via a small element addition -+ to the guest domain XML config, just below the main domain -+ element -+

    -+ -+
    -+  ...
    -+  <resource>
    -+    <partition>/machine/production</partition>
    -+  </resource>
    -+  ...
    -+    
    -+ -+

    -+ Libvirt will not auto-create the cgroups directory to back -+ this partition. In the future, libvirt / virsh will provide -+ APIs / commands to create custom partitions, but currently -+ this is left as an exercise for the administrator. For -+ example, given the XML config above, the admin would need -+ to create a cgroup named '/machine/production.partition' -+

    -+ -+
    -+# cd /sys/fs/cgroup
    -+# for i in blkio cpu,cpuacct cpuset devices freezer memory net_cls perf_event
    -+  do
    -+    mkdir $i/machine/production.partition
    -+  done
    -+# for i in cpuset.cpus  cpuset.mems
    -+  do
    -+    cat cpuset/machine/$i > cpuset/machine/production.partition/$i
    -+  done
    -+
    -+ -+

    -+ Note: the cgroups directory created as a ".partition" -+ suffix, but the XML config does not require this suffix. -+

    -+ -+

    -+ Note: the ability to place guests in custom -+ partitions is only available with libvirt >= 1.0.5, using -+ the new cgroup layout. The legacy cgroups layout described -+ later did not support customization per guest. -+

    -+ -+

    Resource management APIs/commands

    -+ -+

    -+ Since libvirt aims to provide an API which is portable across -+ hypervisors, the concept of cgroups is not exposed directly -+ in the API or XML configuration. It is considered to be an -+ internal implementation detail. Instead libvirt provides a -+ set of APIs for applying resource controls, which are then -+ mapped to corresponding cgroup tunables -+

    -+ -+

    Scheduler tuning

    -+ -+

    -+ Parameters from the "cpu" controller are exposed via the -+ schedinfo command in virsh. -+

    -+ -+
    -+# virsh schedinfo demo
    -+Scheduler      : posix
    -+cpu_shares     : 1024
    -+vcpu_period    : 100000
    -+vcpu_quota     : -1
    -+emulator_period: 100000
    -+emulator_quota : -1
    -+ -+ -+

    Block I/O tuning

    -+ -+

    -+ Parameters from the "blkio" controller are exposed via the -+ bkliotune command in virsh. -+

    -+ -+ -+
    -+# virsh blkiotune demo
    -+weight         : 500
    -+device_weight  : 
    -+ -+

    Memory tuning

    -+ -+

    -+ Parameters from the "memory" controller are exposed via the -+ memtune command in virsh. -+

    -+ -+
    -+# virsh memtune demo
    -+hard_limit     : 580192
    -+soft_limit     : unlimited
    -+swap_hard_limit: unlimited
    -+    
    -+ -+

    Network tuning

    -+ -+

    -+ The net_cls is not currently used. Instead traffic -+ filter policies are set directly against individual virtual -+ network interfaces. -+

    -+ -+

    Legacy cgroups layout

    -+ -+

    -+ Prior to libvirt 1.0.5, the cgroups layout created by libvirt was different -+ from that described above, and did not allow for administrator customization. -+ Libvirt used a fixed, 3-level hierarchy libvirt/{qemu,lxc}/$VMNAME -+ which was rooted at the point in the hierarchy where libvirtd itself was -+ located. So if libvirtd was placed at /system/libvirtd.service -+ by systemd, the groups for each virtual machine / container would be located -+ at /system/libvirtd.service/libvirt/{qemu,lxc}/$VMNAME. In addition -+ to this, the QEMU drivers further child groups for each vCPU thread and the -+ emulator thread(s). This leads to a hierarchy that looked like -+

    -+ -+ -+
    -+$ROOT
    -+  |
    -+  +- system
    -+      |
    -+      +- libvirtd.service
    -+           |
    -+           +- libvirt
    -+               |
    -+               +- qemu
    -+               |   |
    -+               |   +- vm1
    -+               |   |   |
    -+               |   |   +- emulator
    -+               |   |   +- vcpu0
    -+               |   |   +- vcpu1
    -+               |   |
    -+               |   +- vm2
    -+               |   |   |
    -+               |   |   +- emulator
    -+               |   |   +- vcpu0
    -+               |   |   +- vcpu1
    -+               |   |
    -+               |   +- vm3
    -+               |       |
    -+               |       +- emulator
    -+               |       +- vcpu0
    -+               |       +- vcpu1
    -+               |
    -+               +- lxc
    -+                   |
    -+                   +- container1
    -+                   |
    -+                   +- container2
    -+                   |
    -+                   +- container3
    -+    
    -+ -+

    -+ Although current releases are much improved, historically the use of deep -+ hierarchies has had a significant negative impact on the kernel scalability. -+ The legacy libvirt cgroups layout highlighted these problems, to the detriment -+ of the performance of virtual machines and containers. -+

    -+ -+ -Index: libvirt-1.0.5.1/docs/sitemap.html.in -=================================================================== ---- libvirt-1.0.5.1.orig/docs/sitemap.html.in -+++ libvirt-1.0.5.1/docs/sitemap.html.in -@@ -87,6 +87,10 @@ - Ensuring exclusive guest access to disks - -
  • -+ CGroups -+ Control groups integration -+
  • -+
  • - Hooks - Hooks for system specific management -
  • diff --git a/95c6cc34-selinux.patch b/95c6cc34-selinux.patch deleted file mode 100644 index 17051c8..0000000 --- a/95c6cc34-selinux.patch +++ /dev/null @@ -1,29 +0,0 @@ -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.5.1/src/lxc/lxc_container.c -=================================================================== ---- libvirt-1.0.5.1.orig/src/lxc/lxc_container.c -+++ libvirt-1.0.5.1/src/lxc/lxc_container.c -@@ -701,6 +701,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"), diff --git a/bbe97ae9-no-cgroups.patch b/bbe97ae9-no-cgroups.patch deleted file mode 100644 index 150aa21..0000000 --- a/bbe97ae9-no-cgroups.patch +++ /dev/null @@ -1,102 +0,0 @@ -commit bbe97ae968eba60b71e0066d49f9fc909966d9d6 -Author: Jim Fehlig -Date: Fri May 10 12:05:00 2013 -0600 - - Fix starting domains when kernel has no cgroups support - - Found that I was unable to start existing domains after updating - to a kernel with no cgroups support - - # zgrep CGROUP /proc/config.gz - # CONFIG_CGROUPS is not set - # virsh start test - error: Failed to start domain test - error: Unable to initialize /machine cgroup: Cannot allocate memory - - virCgroupPartitionNeedsEscaping() correctly returns errno (ENOENT) when - attempting to open /proc/cgroups on such a system, but it was being - dropped in virCgroupSetPartitionSuffix(). - - Change virCgroupSetPartitionSuffix() to propagate errors returned by - its callees. Also check for ENOENT in qemuInitCgroup() when determining - if cgroups support is available. - -Index: libvirt-1.0.5.1/src/qemu/qemu_cgroup.c -=================================================================== ---- libvirt-1.0.5.1.orig/src/qemu/qemu_cgroup.c -+++ libvirt-1.0.5.1/src/qemu/qemu_cgroup.c -@@ -415,7 +415,8 @@ int qemuInitCgroup(virQEMUDriverPtr driv - if (rc != 0) { - if (rc == -ENXIO || - rc == -EPERM || -- rc == -EACCES) { /* No cgroups mounts == success */ -+ rc == -EACCES || -+ rc == -ENOENT) { /* No cgroups mounts == success */ - VIR_DEBUG("No cgroups present/configured/accessible, ignoring error"); - goto done; - } -Index: libvirt-1.0.5.1/src/util/vircgroup.c -=================================================================== ---- libvirt-1.0.5.1.orig/src/util/vircgroup.c -+++ libvirt-1.0.5.1/src/util/vircgroup.c -@@ -1168,14 +1168,14 @@ static int virCgroupPartitionEscape(char - return 0; - } - --static char *virCgroupSetPartitionSuffix(const char *path) -+static int virCgroupSetPartitionSuffix(const char *path, char **res) - { - char **tokens = virStringSplit(path, "/", 0); - size_t i; -- char *ret = NULL; -+ int ret = -1; - - if (!tokens) -- return NULL; -+ return ret; - - for (i = 0 ; tokens[i] != NULL ; i++) { - /* Whitelist the 3 top level fixed dirs -@@ -1194,20 +1194,27 @@ static char *virCgroupSetPartitionSuffix - !strchr(tokens[i], '.')) { - if (VIR_REALLOC_N(tokens[i], - strlen(tokens[i]) + strlen(".partition") + 1) < 0) { -+ ret = -ENOMEM; - virReportOOMError(); - goto cleanup; - } - strcat(tokens[i], ".partition"); - } - -- if (virCgroupPartitionEscape(&(tokens[i])) < 0) { -- virReportOOMError(); -+ ret = virCgroupPartitionEscape(&(tokens[i])); -+ if (ret < 0) { -+ if (ret == -ENOMEM) -+ virReportOOMError(); - goto cleanup; - } - } - -- if (!(ret = virStringJoin((const char **)tokens, "/"))) -+ if (!(*res = virStringJoin((const char **)tokens, "/"))) { -+ ret = -ENOMEM; - goto cleanup; -+ } -+ -+ ret = 0; - - cleanup: - virStringFreeList(tokens); -@@ -1242,9 +1249,9 @@ int virCgroupNewPartition(const char *pa - - /* XXX convert all cgroups APIs to use error report - * APIs instead of returning errno */ -- if (!(newpath = virCgroupSetPartitionSuffix(path))) { -+ rc = virCgroupSetPartitionSuffix(path, &newpath); -+ if (rc < 0) { - virResetLastError(); -- rc = -ENOMEM; - goto cleanup; - } - diff --git a/c2cf5f1c-no-cgroups-fix.patch b/c2cf5f1c-no-cgroups-fix.patch deleted file mode 100644 index e0fa15e..0000000 --- a/c2cf5f1c-no-cgroups-fix.patch +++ /dev/null @@ -1,49 +0,0 @@ -commit c2cf5f1c2abc81d607abe34bf5dc4c615a9b8b4d -Author: Daniel P. Berrange -Date: Thu May 16 18:47:07 2013 +0100 - - Fix failure to detect missing cgroup partitions - - Change bbe97ae968eba60b71e0066d49f9fc909966d9d6 caused the - QEMU driver to ignore ENOENT errors from cgroups, in order - to cope with missing /proc/cgroups. This is not good though - because many other things can cause ENOENT and should not - be ignored. The callers expect to see ENXIO when cgroups - are not present, so adjust the code to report that errno - when /proc/cgroups is missing - - Signed-off-by: Daniel P. Berrange - -Index: libvirt-1.0.5.1/src/qemu/qemu_cgroup.c -=================================================================== ---- libvirt-1.0.5.1.orig/src/qemu/qemu_cgroup.c -+++ libvirt-1.0.5.1/src/qemu/qemu_cgroup.c -@@ -415,8 +415,7 @@ int qemuInitCgroup(virQEMUDriverPtr driv - if (rc != 0) { - if (rc == -ENXIO || - rc == -EPERM || -- rc == -EACCES || -- rc == -ENOENT) { /* No cgroups mounts == success */ -+ rc == -EACCES) { /* No cgroups mounts == success */ - VIR_DEBUG("No cgroups present/configured/accessible, ignoring error"); - goto done; - } -Index: libvirt-1.0.5.1/src/util/vircgroup.c -=================================================================== ---- libvirt-1.0.5.1.orig/src/util/vircgroup.c -+++ libvirt-1.0.5.1/src/util/vircgroup.c -@@ -1110,8 +1110,13 @@ static int virCgroupPartitionNeedsEscapi - path[0] == '.') - return 1; - -- if (!(fp = fopen("/proc/cgroups", "r"))) -+ if (!(fp = fopen("/proc/cgroups", "r"))) { -+ /* The API contract is that we return ENXIO -+ * if cgroups are not available on a host */ -+ if (errno == ENOENT) -+ errno = ENXIO; - return -errno; -+ } - - /* - * Data looks like this: diff --git a/clone.patch b/clone.patch index b78b059..3a24b32 100644 --- a/clone.patch +++ b/clone.patch @@ -2,7 +2,7 @@ Index: src/lxc/lxc_container.c =================================================================== --- src/lxc/lxc_container.c.orig +++ src/lxc/lxc_container.c -@@ -138,6 +138,7 @@ int lxcContainerHasReboot(void) +@@ -142,6 +142,7 @@ int lxcContainerHasReboot(void) int cmd, v; int status; char *tmp; @@ -10,7 +10,7 @@ Index: src/lxc/lxc_container.c if (virFileReadAll("/proc/sys/kernel/ctrl-alt-del", 10, &buf) < 0) return -1; -@@ -154,14 +155,21 @@ int lxcContainerHasReboot(void) +@@ -158,14 +159,21 @@ int lxcContainerHasReboot(void) VIR_FREE(buf); cmd = v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF; @@ -34,7 +34,7 @@ Index: src/lxc/lxc_container.c VIR_FREE(stack); if (cpid < 0) { virReportSystemError(errno, "%s", -@@ -2122,6 +2130,9 @@ int lxcContainerStart(virDomainDefPtr de +@@ -2108,6 +2116,9 @@ int lxcContainerStart(virDomainDefPtr de ttyPaths, nttyPaths, handshakefd}; /* allocate a stack for the container */ @@ -44,7 +44,7 @@ Index: src/lxc/lxc_container.c if (VIR_ALLOC_N(stack, stacksize) < 0) { virReportOOMError(); return -1; -@@ -2140,7 +2151,11 @@ int lxcContainerStart(virDomainDefPtr de +@@ -2126,7 +2137,11 @@ int lxcContainerStart(virDomainDefPtr de cflags |= CLONE_NEWNET; } @@ -56,7 +56,7 @@ Index: src/lxc/lxc_container.c VIR_FREE(stack); VIR_DEBUG("clone() completed, new container PID is %d", pid); -@@ -2166,6 +2181,7 @@ int lxcContainerAvailable(int features) +@@ -2152,6 +2167,7 @@ int lxcContainerAvailable(int features) int cpid; char *childStack; char *stack; @@ -64,7 +64,7 @@ Index: src/lxc/lxc_container.c if (features & LXC_CONTAINER_FEATURE_USER) flags |= CLONE_NEWUSER; -@@ -2173,14 +2189,21 @@ int lxcContainerAvailable(int features) +@@ -2159,14 +2175,21 @@ int lxcContainerAvailable(int features) if (features & LXC_CONTAINER_FEATURE_NET) flags |= CLONE_NEWNET; diff --git a/f493d83f-cgroup-swap-control.patch b/f493d83f-cgroup-swap-control.patch deleted file mode 100644 index 7153d6b..0000000 --- a/f493d83f-cgroup-swap-control.patch +++ /dev/null @@ -1,34 +0,0 @@ -commit f493d83fbd3257453e63f2f32ee90a216fd531c1 -Author: Daniel P. Berrange -Date: Thu May 9 13:53:39 2013 +0100 - - Cope with missing swap cgroup controls - - It is possible to build a kernel without swap cgroup controls - present. This causes a fatal error when querying memory - parameters. Treat missing swap controls as meaning "unlimited". - The fatal error remains if the user tries to actually change - the limit. - - Signed-off-by: Daniel P. Berrange - -Index: libvirt-1.0.5.1/src/qemu/qemu_driver.c -=================================================================== ---- libvirt-1.0.5.1.orig/src/qemu/qemu_driver.c -+++ libvirt-1.0.5.1/src/qemu/qemu_driver.c -@@ -7352,9 +7352,12 @@ qemuDomainGetMemoryParameters(virDomainP - case 2: /* fill swap hard limit here */ - rc = virCgroupGetMemSwapHardLimit(priv->cgroup, &val); - if (rc != 0) { -- virReportSystemError(-rc, "%s", -- _("unable to get swap hard limit")); -- goto cleanup; -+ if (rc != -ENOENT) { -+ virReportSystemError(-rc, "%s", -+ _("unable to get swap hard limit")); -+ goto cleanup; -+ } -+ val = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED; - } - if (virTypedParameterAssign(param, - VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT, diff --git a/fix-pci-attach-xen-driver.patch b/fix-pci-attach-xen-driver.patch index 21a8824..1d80216 100644 --- a/fix-pci-attach-xen-driver.patch +++ b/fix-pci-attach-xen-driver.patch @@ -8,11 +8,11 @@ uses the 'device_configure' RPC. This patch changes the xend driver to always call 'device_configure' for PCI devices to be consistent with the usage in the xen tools. -Index: libvirt-1.0.5.1/src/xen/xend_internal.c +Index: libvirt-1.0.6/src/xen/xend_internal.c =================================================================== ---- libvirt-1.0.5.1.orig/src/xen/xend_internal.c -+++ libvirt-1.0.5.1/src/xen/xend_internal.c -@@ -2473,6 +2473,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr +--- libvirt-1.0.6.orig/src/xen/xend_internal.c ++++ libvirt-1.0.6/src/xen/xend_internal.c +@@ -2220,6 +2220,7 @@ xenDaemonAttachDeviceFlags(virConnectPtr virBuffer buf = VIR_BUFFER_INITIALIZER; char class[8], ref[80]; char *target = NULL; @@ -20,23 +20,23 @@ Index: libvirt-1.0.5.1/src/xen/xend_internal.c virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); -@@ -2585,8 +2586,18 @@ xenDaemonAttachDeviceFlags(virDomainPtr +@@ -2320,8 +2321,18 @@ xenDaemonAttachDeviceFlags(virConnectPtr } sexpr = virBufferContentAndReset(&buf); -+ new_dev = virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref)); ++ new_dev = virDomainXMLDevID(conn, minidef, dev, class, ref, sizeof(ref)); -- if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref))) { +- if (virDomainXMLDevID(conn, minidef, dev, class, ref, sizeof(ref))) { + /* always call 'device_configure' for pci device */ + 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) { -+ ret = xend_op(domain->conn, domain->name, "op", "device_configure", ++ ret = xend_op(conn, def->name, "op", "device_configure", + "config", sexpr, "dev", ref, NULL); + goto cleanup; + } + + if (new_dev) { /* device doesn't exist, define it */ - ret = xend_op(domain->conn, domain->name, "op", "device_create", + ret = xend_op(conn, def->name, "op", "device_create", "config", sexpr, NULL); diff --git a/install-apparmor-profiles.patch b/install-apparmor-profiles.patch index 24a5435..40c4aad 100644 --- a/install-apparmor-profiles.patch +++ b/install-apparmor-profiles.patch @@ -1,10 +1,10 @@ -Index: libvirt-1.0.5.1/examples/apparmor/Makefile.am +Index: libvirt-1.0.6/examples/apparmor/Makefile.am =================================================================== ---- libvirt-1.0.5.1.orig/examples/apparmor/Makefile.am -+++ libvirt-1.0.5.1/examples/apparmor/Makefile.am -@@ -1,8 +1,45 @@ - ## Copyright (C) 2005-2011 Red Hat, Inc. - ## See COPYING.LIB for the License of this software +--- libvirt-1.0.6.orig/examples/apparmor/Makefile.am ++++ libvirt-1.0.6/examples/apparmor/Makefile.am +@@ -14,8 +14,45 @@ + ## License along with this library. If not, see + ## . -EXTRA_DIST= \ - TEMPLATE \ @@ -53,10 +53,10 @@ Index: libvirt-1.0.5.1/examples/apparmor/Makefile.am + rm -f $(DESTDIR)$(sysconfdir)/apparmor.d/libvirt/TEMPLATE + +endif -Index: libvirt-1.0.5.1/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in +Index: libvirt-1.0.6/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in =================================================================== --- /dev/null -+++ libvirt-1.0.5.1/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in ++++ libvirt-1.0.6/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in @@ -0,0 +1,40 @@ +# Last Modified: Fri Aug 19 11:21:48 2011 +#include @@ -98,9 +98,9 @@ Index: libvirt-1.0.5.1/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in + /var/lib/kvm/images/ r, + /var/lib/kvm/images/** r, +} -Index: libvirt-1.0.5.1/examples/apparmor/usr.lib.libvirt.virt-aa-helper +Index: libvirt-1.0.6/examples/apparmor/usr.lib.libvirt.virt-aa-helper =================================================================== ---- libvirt-1.0.5.1.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper +--- libvirt-1.0.6.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper +++ /dev/null @@ -1,38 +0,0 @@ -# Last Modified: Mon Apr 5 15:10:27 2010 @@ -141,9 +141,9 @@ Index: libvirt-1.0.5.1/examples/apparmor/usr.lib.libvirt.virt-aa-helper - /var/lib/libvirt/images/ r, - /var/lib/libvirt/images/** r, -} -Index: libvirt-1.0.5.1/examples/apparmor/usr.sbin.libvirtd +Index: libvirt-1.0.6/examples/apparmor/usr.sbin.libvirtd =================================================================== ---- libvirt-1.0.5.1.orig/examples/apparmor/usr.sbin.libvirtd +--- libvirt-1.0.6.orig/examples/apparmor/usr.sbin.libvirtd +++ /dev/null @@ -1,52 +0,0 @@ -# Last Modified: Mon Apr 5 15:03:58 2010 @@ -198,10 +198,10 @@ Index: libvirt-1.0.5.1/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-1.0.5.1/examples/apparmor/usr.sbin.libvirtd.in +Index: libvirt-1.0.6/examples/apparmor/usr.sbin.libvirtd.in =================================================================== --- /dev/null -+++ libvirt-1.0.5.1/examples/apparmor/usr.sbin.libvirtd.in ++++ libvirt-1.0.6/examples/apparmor/usr.sbin.libvirtd.in @@ -0,0 +1,58 @@ +# Last Modified: Fri Aug 19 11:20:36 2011 +#include @@ -261,9 +261,9 @@ Index: libvirt-1.0.5.1/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-1.0.5.1/examples/apparmor/libvirt-qemu +Index: libvirt-1.0.6/examples/apparmor/libvirt-qemu =================================================================== ---- libvirt-1.0.5.1.orig/examples/apparmor/libvirt-qemu +--- libvirt-1.0.6.orig/examples/apparmor/libvirt-qemu +++ /dev/null @@ -1,129 +0,0 @@ -# Last Modified: Fri Mar 9 14:43:22 2012 @@ -395,10 +395,10 @@ Index: libvirt-1.0.5.1/examples/apparmor/libvirt-qemu - - /usr/libexec/qemu-bridge-helper rmix, - } -Index: libvirt-1.0.5.1/examples/apparmor/libvirt-qemu.in +Index: libvirt-1.0.6/examples/apparmor/libvirt-qemu.in =================================================================== --- /dev/null -+++ libvirt-1.0.5.1/examples/apparmor/libvirt-qemu.in ++++ libvirt-1.0.6/examples/apparmor/libvirt-qemu.in @@ -0,0 +1,132 @@ +# Last Modified: Fri Mar 9 14:43:22 2012 + diff --git a/libvirt-1.0.5.1.tar.bz2 b/libvirt-1.0.5.1.tar.bz2 deleted file mode 100644 index 1163fcc..0000000 --- a/libvirt-1.0.5.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e3e635e965c91bc84e23aed1db0279a7b3d80055ff0146327e9b271680ddf0af -size 17142845 diff --git a/libvirt-1.0.6.tar.bz2 b/libvirt-1.0.6.tar.bz2 new file mode 100644 index 0000000..d54aefc --- /dev/null +++ b/libvirt-1.0.6.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:254926d680dde3aa41e69eacc8dd72d346fa9d15dde66fa5a5883b0fac5f5475 +size 17229166 diff --git a/libvirt-guests-init-script.patch b/libvirt-guests-init-script.patch index 182662c..ed2e301 100644 --- a/libvirt-guests-init-script.patch +++ b/libvirt-guests-init-script.patch @@ -1,9 +1,9 @@ Adjust libvirt-guests init files to conform to SUSE standards -Index: libvirt-1.0.5.1/tools/libvirt-guests.init.in +Index: libvirt-1.0.6/tools/libvirt-guests.init.in =================================================================== ---- libvirt-1.0.5.1.orig/tools/libvirt-guests.init.in -+++ libvirt-1.0.5.1/tools/libvirt-guests.init.in +--- libvirt-1.0.6.orig/tools/libvirt-guests.init.in ++++ libvirt-1.0.6/tools/libvirt-guests.init.in @@ -3,15 +3,15 @@ # the following is the LSB init header # @@ -28,12 +28,13 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.init.in ### END INIT INFO # the following is chkconfig init header -Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in +Index: libvirt-1.0.6/tools/libvirt-guests.sh.in =================================================================== ---- libvirt-1.0.5.1.orig/tools/libvirt-guests.sh.in -+++ libvirt-1.0.5.1/tools/libvirt-guests.sh.in -@@ -1,13 +1,12 @@ - #!/bin/sh +--- libvirt-1.0.6.orig/tools/libvirt-guests.sh.in ++++ libvirt-1.0.6/tools/libvirt-guests.sh.in +@@ -16,14 +16,13 @@ + # License along with this library. If not, see + # . +. /etc/rc.status +rc_reset @@ -49,7 +50,7 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in # 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- +@@ -42,9 +41,11 @@ test -f "$sysconfdir"/sysconfig/libvirt- . "$sysconfdir"/sysconfig/libvirt-guests LISTFILE="$localstatedir"/lib/libvirt/libvirt-guests @@ -64,7 +65,7 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in # retval COMMAND ARGUMENTS... # run command with arguments and convert non-zero return value to 1 and set -@@ -36,7 +37,7 @@ RETVAL=0 +@@ -52,7 +53,7 @@ RETVAL=0 retval() { "$@" if [ $? -ne 0 ]; then @@ -73,7 +74,7 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in return 1 else return 0 -@@ -65,6 +66,25 @@ run_virsh_c() { +@@ -81,6 +82,25 @@ run_virsh_c() { ( export LC_ALL=C; run_virsh "$@" ) } @@ -99,7 +100,7 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in # test_connect URI # check if URI is reachable test_connect() -@@ -91,7 +111,7 @@ list_guests() { +@@ -107,7 +127,7 @@ list_guests() { list=$(run_virsh_c "$uri" list --uuid $persistent) if [ $? -ne 0 ]; then @@ -108,7 +109,7 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in return 1 fi -@@ -117,7 +137,7 @@ guest_is_on() { +@@ -133,7 +153,7 @@ guest_is_on() { guest_running=false id=$(run_virsh "$uri" domid "$uuid") if [ $? -ne 0 ]; then @@ -117,7 +118,7 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in return 1 fi -@@ -165,6 +185,12 @@ start() { +@@ -181,6 +201,12 @@ start() { test_connect "$uri" || continue @@ -130,7 +131,7 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in eval_gettext "Resuming guests on \$uri URI..."; echo for guest in $list; do name=$(guest_name "$uri" "$guest") -@@ -378,7 +404,7 @@ shutdown_guests_parallel() +@@ -394,7 +420,7 @@ shutdown_guests_parallel() timeout=$(($timeout - 1)) if [ $timeout -le 0 ]; then eval_gettext "Timeout expired while shutting down domains"; echo @@ -139,7 +140,7 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in return fi else -@@ -406,7 +432,7 @@ stop() { +@@ -422,7 +448,7 @@ stop() { if [ $SHUTDOWN_TIMEOUT -lt 0 ]; then gettext "SHUTDOWN_TIMEOUT must be equal or greater than 0" echo @@ -148,7 +149,7 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in return fi fi -@@ -454,14 +480,14 @@ stop() { +@@ -470,14 +496,14 @@ stop() { if [ $? -ne 0 ]; then eval_gettext "Failed to list persistent guests on \$uri" echo @@ -165,7 +166,7 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in set +f return fi -@@ -520,14 +546,13 @@ gueststatus() { +@@ -536,14 +562,13 @@ gueststatus() { rh_status() { if [ -f "$LISTFILE" ]; then gettext "stopped, with saved guests"; echo @@ -182,16 +183,16 @@ Index: libvirt-1.0.5.1/tools/libvirt-guests.sh.in fi fi } -@@ -572,4 +597,4 @@ case "$1" in +@@ -588,4 +613,4 @@ case "$1" in usage ;; esac -exit $RETVAL +rc_exit -Index: libvirt-1.0.5.1/tools/libvirt-guests.sysconf +Index: libvirt-1.0.6/tools/libvirt-guests.sysconf =================================================================== ---- libvirt-1.0.5.1.orig/tools/libvirt-guests.sysconf -+++ libvirt-1.0.5.1/tools/libvirt-guests.sysconf +--- libvirt-1.0.6.orig/tools/libvirt-guests.sysconf ++++ libvirt-1.0.6/tools/libvirt-guests.sysconf @@ -1,19 +1,29 @@ +## Path: System/Virtualization/libvirt-guests + diff --git a/libvirt-suse-netcontrol.patch b/libvirt-suse-netcontrol.patch index 23816eb..aaec9af 100644 --- a/libvirt-suse-netcontrol.patch +++ b/libvirt-suse-netcontrol.patch @@ -1,8 +1,8 @@ -Index: libvirt-1.0.5.1/configure.ac +Index: libvirt-1.0.6/configure.ac =================================================================== ---- libvirt-1.0.5.1.orig/configure.ac -+++ libvirt-1.0.5.1/configure.ac -@@ -159,6 +159,7 @@ LIBVIRT_CHECK_DBUS +--- libvirt-1.0.6.orig/configure.ac ++++ libvirt-1.0.6/configure.ac +@@ -172,6 +172,7 @@ LIBVIRT_CHECK_DBUS LIBVIRT_CHECK_FUSE LIBVIRT_CHECK_HAL LIBVIRT_CHECK_NETCF @@ -10,7 +10,7 @@ Index: libvirt-1.0.5.1/configure.ac LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_OPENWSMAN LIBVIRT_CHECK_PCIACCESS -@@ -2205,11 +2206,12 @@ if test "$with_libvirtd" = "no" ; then +@@ -2227,11 +2228,12 @@ if test "$with_libvirtd" = "no" ; then with_interface=no fi @@ -26,7 +26,7 @@ Index: libvirt-1.0.5.1/configure.ac esac if test "$with_interface" = "yes" ; then -@@ -2488,6 +2490,7 @@ LIBVIRT_RESULT_DBUS +@@ -2510,6 +2512,7 @@ LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_HAL LIBVIRT_RESULT_NETCF @@ -34,11 +34,11 @@ Index: libvirt-1.0.5.1/configure.ac LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_OPENWSMAN LIBVIRT_RESULT_PCIACCESS -Index: libvirt-1.0.5.1/src/Makefile.am +Index: libvirt-1.0.6/src/Makefile.am =================================================================== ---- libvirt-1.0.5.1.orig/src/Makefile.am -+++ libvirt-1.0.5.1/src/Makefile.am -@@ -715,6 +715,10 @@ if WITH_NETCF +--- libvirt-1.0.6.orig/src/Makefile.am ++++ libvirt-1.0.6/src/Makefile.am +@@ -716,6 +716,10 @@ if WITH_NETCF INTERFACE_DRIVER_SOURCES += \ interface/interface_backend_netcf.c endif @@ -49,7 +49,7 @@ Index: libvirt-1.0.5.1/src/Makefile.am if WITH_UDEV INTERFACE_DRIVER_SOURCES += \ interface/interface_backend_udev.c -@@ -1200,11 +1204,16 @@ if WITH_NETCF +@@ -1215,11 +1219,16 @@ if WITH_NETCF libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS) libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS) else @@ -66,11 +66,11 @@ Index: libvirt-1.0.5.1/src/Makefile.am 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.5.1/tools/virsh.c +Index: libvirt-1.0.6/tools/virsh.c =================================================================== ---- libvirt-1.0.5.1.orig/tools/virsh.c -+++ libvirt-1.0.5.1/tools/virsh.c -@@ -2888,6 +2888,8 @@ vshShowVersion(vshControl *ctl ATTRIBUTE +--- libvirt-1.0.6.orig/tools/virsh.c ++++ libvirt-1.0.6/tools/virsh.c +@@ -2886,6 +2886,8 @@ vshShowVersion(vshControl *ctl ATTRIBUTE vshPrint(ctl, " Interface"); # if defined(WITH_NETCF) vshPrint(ctl, " netcf"); @@ -79,10 +79,10 @@ Index: libvirt-1.0.5.1/tools/virsh.c # elif defined(WITH_UDEV) vshPrint(ctl, " udev"); # endif -Index: libvirt-1.0.5.1/src/interface/interface_backend_netcf.c +Index: libvirt-1.0.6/src/interface/interface_backend_netcf.c =================================================================== ---- libvirt-1.0.5.1.orig/src/interface/interface_backend_netcf.c -+++ libvirt-1.0.5.1/src/interface/interface_backend_netcf.c +--- libvirt-1.0.6.orig/src/interface/interface_backend_netcf.c ++++ libvirt-1.0.6/src/interface/interface_backend_netcf.c @@ -23,7 +23,12 @@ #include @@ -146,10 +146,10 @@ Index: libvirt-1.0.5.1/src/interface/interface_backend_netcf.c /* open netcf */ if (ncf_init(&driverState->netcf, NULL) != 0) { -Index: libvirt-1.0.5.1/src/interface/interface_driver.c +Index: libvirt-1.0.6/src/interface/interface_driver.c =================================================================== ---- libvirt-1.0.5.1.orig/src/interface/interface_driver.c -+++ libvirt-1.0.5.1/src/interface/interface_driver.c +--- libvirt-1.0.6.orig/src/interface/interface_driver.c ++++ libvirt-1.0.6/src/interface/interface_driver.c @@ -28,8 +28,15 @@ interfaceRegister(void) { if (netcfIfaceRegister() == 0) return 0; @@ -167,10 +167,10 @@ Index: libvirt-1.0.5.1/src/interface/interface_driver.c if (udevIfaceRegister() == 0) return 0; #endif /* WITH_UDEV */ -Index: libvirt-1.0.5.1/m4/virt-netcontrol.m4 +Index: libvirt-1.0.6/m4/virt-netcontrol.m4 =================================================================== --- /dev/null -+++ libvirt-1.0.5.1/m4/virt-netcontrol.m4 ++++ libvirt-1.0.6/m4/virt-netcontrol.m4 @@ -0,0 +1,35 @@ +dnl The libnetcontrol library +dnl diff --git a/libvirt.changes b/libvirt.changes index 3acc866..0823a0c 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Tue Jun 4 16:44:30 MDT 2013 - jfehlig@suse.com + +- Update to libvirt 1.0.6 + - Move VirtualBox driver into libvirtd + - Support for static routes on a virtual bridge + - Various improvement for hostdev SCSI support + - Switch to VIR_STRDUP and VIR_STRNDUP + - Various cleanups and improvement in Xen and LXC drivers + - Many incremental improvements and bug fixes, see + http://libvirt.org/news.html + - Drop upstream patches: f493d83f-cgroup-swap-control.patch, + 486a86eb-cgroups-docs.patch, 0ced83dc-cgroup-escape-dot.patch, + bbe97ae9-no-cgroups.patch, c2cf5f1c-no-cgroups-fix.patch, + 95c6cc34-selinux.patch + ------------------------------------------------------------------- Tue May 21 08:32:02 MDT 2013 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index d90ef05..42d2f07 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -106,6 +106,11 @@ %define with_libxl 0 %endif +# vbox is available only on i386 x86_64 +%ifnarch %{ix86} x86_64 +%define with_vbox 0 +%endif + # numactl only on x86_64 and ia64 %ifnarch x86_64 ia64 %define with_numactl 0 @@ -343,7 +348,7 @@ BuildRequires: libblkid-devel >= 2.17 Name: libvirt Url: http://libvirt.org/ -Version: 1.0.5.1 +Version: 1.0.6 Release: 0 Summary: A C toolkit to interact with the virtualization capabilities of Linux License: LGPL-2.1+ @@ -423,12 +428,6 @@ Source1: libvirtd.init Source2: libvirtd-relocation-server.fw Source99: baselibs.conf # Upstream patches -Patch0: f493d83f-cgroup-swap-control.patch -Patch1: 486a86eb-cgroups-docs.patch -Patch2: 0ced83dc-cgroup-escape-dot.patch -Patch3: bbe97ae9-no-cgroups.patch -Patch4: c2cf5f1c-no-cgroups-fix.patch -Patch5: 95c6cc34-selinux.patch # Need to go upstream Patch100: xen-name-for-devid.patch Patch101: clone.patch @@ -569,12 +568,6 @@ Authors: %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 %patch100 -p1 %patch101 %patch102 -p1 diff --git a/libvirtd-defaults.patch b/libvirtd-defaults.patch index 668138d..45b06a2 100644 --- a/libvirtd-defaults.patch +++ b/libvirtd-defaults.patch @@ -1,7 +1,7 @@ -Index: libvirt-1.0.5.1/daemon/libvirtd.conf +Index: libvirt-1.0.6/daemon/libvirtd.conf =================================================================== ---- libvirt-1.0.5.1.orig/daemon/libvirtd.conf -+++ libvirt-1.0.5.1/daemon/libvirtd.conf +--- libvirt-1.0.6.orig/daemon/libvirtd.conf ++++ libvirt-1.0.6/daemon/libvirtd.conf @@ -18,8 +18,8 @@ # It is necessary to setup a CA and issue server certificates before # using this capability. @@ -13,11 +13,11 @@ Index: libvirt-1.0.5.1/daemon/libvirtd.conf # 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.5.1/daemon/libvirtd-config.c +Index: libvirt-1.0.6/daemon/libvirtd-config.c =================================================================== ---- libvirt-1.0.5.1.orig/daemon/libvirtd-config.c -+++ libvirt-1.0.5.1/daemon/libvirtd-config.c -@@ -233,7 +233,7 @@ daemonConfigNew(bool privileged ATTRIBUT +--- libvirt-1.0.6.orig/daemon/libvirtd-config.c ++++ libvirt-1.0.6/daemon/libvirtd-config.c +@@ -225,7 +225,7 @@ daemonConfigNew(bool privileged ATTRIBUT return NULL; } @@ -25,4 +25,4 @@ Index: libvirt-1.0.5.1/daemon/libvirtd-config.c + data->listen_tls = 0; data->listen_tcp = 0; - if (!(data->tls_port = strdup(LIBVIRTD_TLS_PORT))) + if (VIR_STRDUP(data->tls_port, LIBVIRTD_TLS_PORT) < 0 || diff --git a/libvirtd-init-script.patch b/libvirtd-init-script.patch index 8a8e6db..141fb15 100644 --- a/libvirtd-init-script.patch +++ b/libvirtd-init-script.patch @@ -1,9 +1,9 @@ Adjust libvirtd sysconfig file to conform to SUSE standards -Index: libvirt-1.0.5.1/daemon/libvirtd.sysconf +Index: libvirt-1.0.6/daemon/libvirtd.sysconf =================================================================== ---- libvirt-1.0.5.1.orig/daemon/libvirtd.sysconf -+++ libvirt-1.0.5.1/daemon/libvirtd.sysconf +--- libvirt-1.0.6.orig/daemon/libvirtd.sysconf ++++ libvirt-1.0.6/daemon/libvirtd.sysconf @@ -1,16 +1,25 @@ +## Path: System/Virtualization/libvirt + diff --git a/relax-qemu-usergroup-check.patch b/relax-qemu-usergroup-check.patch index 3c00943..d08af22 100644 --- a/relax-qemu-usergroup-check.patch +++ b/relax-qemu-usergroup-check.patch @@ -7,11 +7,11 @@ 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.5.1/src/qemu/qemu_conf.c +Index: libvirt-1.0.6/src/qemu/qemu_conf.c =================================================================== ---- libvirt-1.0.5.1.orig/src/qemu/qemu_conf.c -+++ libvirt-1.0.5.1/src/qemu/qemu_conf.c -@@ -435,15 +435,15 @@ int virQEMUDriverConfigLoadFile(virQEMUD +--- libvirt-1.0.6.orig/src/qemu/qemu_conf.c ++++ libvirt-1.0.6/src/qemu/qemu_conf.c +@@ -465,15 +465,15 @@ int virQEMUDriverConfigLoadFile(virQEMUD p = virConfGetValue(conf, "user"); CHECK_TYPE("user", VIR_CONF_STRING); diff --git a/support-managed-pci-xen-driver.patch b/support-managed-pci-xen-driver.patch index 386e08e..b8d1b91 100644 --- a/support-managed-pci-xen-driver.patch +++ b/support-managed-pci-xen-driver.patch @@ -8,11 +8,11 @@ Subject: [PATCH] support managed pci devices in xen driver src/xenxs/xen_xm.c | 28 +++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 15 deletions(-) -Index: libvirt-1.0.5.1/src/xenxs/xen_sxpr.c +Index: libvirt-1.0.6/src/xenxs/xen_sxpr.c =================================================================== ---- libvirt-1.0.5.1.orig/src/xenxs/xen_sxpr.c -+++ libvirt-1.0.5.1/src/xenxs/xen_sxpr.c -@@ -1035,6 +1035,7 @@ xenParseSxprPCI(virDomainDefPtr def, +--- libvirt-1.0.6.orig/src/xenxs/xen_sxpr.c ++++ libvirt-1.0.6/src/xenxs/xen_sxpr.c +@@ -1006,6 +1006,7 @@ xenParseSxprPCI(virDomainDefPtr def, int busID; int slotID; int funcID; @@ -20,7 +20,7 @@ Index: libvirt-1.0.5.1/src/xenxs/xen_sxpr.c node = cur->u.s.car; if (!sexpr_lookup(node, "dev")) -@@ -1082,11 +1083,13 @@ xenParseSxprPCI(virDomainDefPtr def, +@@ -1053,11 +1054,13 @@ xenParseSxprPCI(virDomainDefPtr def, goto error; } @@ -35,7 +35,7 @@ Index: libvirt-1.0.5.1/src/xenxs/xen_sxpr.c dev->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI; dev->source.subsys.u.pci.addr.domain = domainID; dev->source.subsys.u.pci.addr.bus = busID; -@@ -2042,11 +2045,15 @@ static void +@@ -2013,11 +2016,15 @@ static void xenFormatSxprPCI(virDomainHostdevDefPtr def, virBufferPtr buf) { @@ -52,7 +52,7 @@ Index: libvirt-1.0.5.1/src/xenxs/xen_sxpr.c } -@@ -2065,12 +2072,6 @@ xenFormatSxprOnePCI(virDomainHostdevDefP +@@ -2036,12 +2043,6 @@ xenFormatSxprOnePCI(virDomainHostdevDefP virBufferPtr buf, int detach) { @@ -65,8 +65,8 @@ Index: libvirt-1.0.5.1/src/xenxs/xen_sxpr.c virBufferAddLit(buf, "(pci "); xenFormatSxprPCI(def, buf); if (detach) -@@ -2125,12 +2126,6 @@ xenFormatSxprAllPCI(virDomainDefPtr def, - for (i = 0 ; i < def->nhostdevs ; i++) { +@@ -2096,12 +2097,6 @@ xenFormatSxprAllPCI(virDomainDefPtr def, + for (i = 0; i < def->nhostdevs; i++) { if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) { - if (def->hostdevs[i]->managed) { @@ -78,11 +78,11 @@ Index: libvirt-1.0.5.1/src/xenxs/xen_sxpr.c xenFormatSxprPCI(def->hostdevs[i], buf); } } -Index: libvirt-1.0.5.1/src/xenxs/xen_xm.c +Index: libvirt-1.0.6/src/xenxs/xen_xm.c =================================================================== ---- libvirt-1.0.5.1.orig/src/xenxs/xen_xm.c -+++ libvirt-1.0.5.1/src/xenxs/xen_xm.c -@@ -815,6 +815,8 @@ xenParseXM(virConfPtr conf, int xendConf +--- libvirt-1.0.6.orig/src/xenxs/xen_xm.c ++++ libvirt-1.0.6/src/xenxs/xen_xm.c +@@ -806,6 +806,8 @@ xenParseXM(virConfPtr conf, int xendConf int busID; int slotID; int funcID; @@ -91,7 +91,7 @@ Index: libvirt-1.0.5.1/src/xenxs/xen_xm.c domain[0] = bus[0] = slot[0] = func[0] = '\0'; -@@ -824,6 +826,11 @@ xenParseXM(virConfPtr conf, int xendConf +@@ -815,6 +817,11 @@ xenParseXM(virConfPtr conf, int xendConf /* pci=['0000:00:1b.0','0000:00:13.0'] */ if (!(key = list->str)) goto skippci; @@ -103,7 +103,7 @@ Index: libvirt-1.0.5.1/src/xenxs/xen_xm.c if (!(nextkey = strchr(key, ':'))) goto skippci; -@@ -872,10 +879,30 @@ xenParseXM(virConfPtr conf, int xendConf +@@ -863,10 +870,30 @@ xenParseXM(virConfPtr conf, int xendConf if (virStrToLong_i(func, NULL, 16, &funcID) < 0) goto skippci; diff --git a/suse-qemu-conf.patch b/suse-qemu-conf.patch index 3831cb6..6455b7f 100644 --- a/suse-qemu-conf.patch +++ b/suse-qemu-conf.patch @@ -1,8 +1,8 @@ -Index: libvirt-1.0.5.1/src/qemu/qemu.conf +Index: libvirt-1.0.6/src/qemu/qemu.conf =================================================================== ---- libvirt-1.0.5.1.orig/src/qemu/qemu.conf -+++ libvirt-1.0.5.1/src/qemu/qemu.conf -@@ -169,7 +169,16 @@ +--- libvirt-1.0.6.orig/src/qemu/qemu.conf ++++ libvirt-1.0.6/src/qemu/qemu.conf +@@ -175,7 +175,16 @@ # a special value; security_driver can be set to that value in # isolation, but it cannot appear in a list of drivers. # @@ -19,7 +19,7 @@ Index: libvirt-1.0.5.1/src/qemu/qemu.conf # If set to non-zero, then the default security labeling # will make guests confined. If set to zero, then guests -@@ -365,6 +374,15 @@ +@@ -371,6 +380,15 @@ #allow_disk_format_probing = 1 diff --git a/virtlockd-init-script.patch b/virtlockd-init-script.patch index 8f858c1..eea0651 100644 --- a/virtlockd-init-script.patch +++ b/virtlockd-init-script.patch @@ -1,9 +1,9 @@ Adjust virtlockd init files to conform to SUSE standards -Index: libvirt-1.0.5.1/src/locking/virtlockd.sysconf +Index: libvirt-1.0.6/src/locking/virtlockd.sysconf =================================================================== ---- libvirt-1.0.5.1.orig/src/locking/virtlockd.sysconf -+++ libvirt-1.0.5.1/src/locking/virtlockd.sysconf +--- libvirt-1.0.6.orig/src/locking/virtlockd.sysconf ++++ libvirt-1.0.6/src/locking/virtlockd.sysconf @@ -1,3 +1,7 @@ +## Path: System/Virtualization/virtlockd + @@ -12,10 +12,10 @@ Index: libvirt-1.0.5.1/src/locking/virtlockd.sysconf # # Pass extra arguments to virtlockd #VIRTLOCKD_ARGS= -Index: libvirt-1.0.5.1/src/locking/virtlockd.init.in +Index: libvirt-1.0.6/src/locking/virtlockd.init.in =================================================================== ---- libvirt-1.0.5.1.orig/src/locking/virtlockd.init.in -+++ libvirt-1.0.5.1/src/locking/virtlockd.init.in +--- libvirt-1.0.6.orig/src/locking/virtlockd.init.in ++++ libvirt-1.0.6/src/locking/virtlockd.init.in @@ -4,11 +4,13 @@ # http://www.linux-foundation.org/spec//booksets/LSB-Core-generic/LSB-Core-generic.html#INITSCRCOMCONV # diff --git a/xen-name-for-devid.patch b/xen-name-for-devid.patch index 0927542..04cd05a 100644 --- a/xen-name-for-devid.patch +++ b/xen-name-for-devid.patch @@ -14,78 +14,32 @@ is inactive. We obviously can't search xenstore when the domain is inactive. -Index: libvirt-1.0.5.1/src/xen/xend_internal.c +Index: libvirt-1.0.6/src/xen/xend_internal.c =================================================================== ---- libvirt-1.0.5.1.orig/src/xen/xend_internal.c -+++ libvirt-1.0.5.1/src/xen/xend_internal.c -@@ -60,8 +60,8 @@ +--- libvirt-1.0.6.orig/src/xen/xend_internal.c ++++ libvirt-1.0.6/src/xen/xend_internal.c +@@ -70,7 +70,7 @@ #define XEND_RCV_BUF_MAX_LEN (256 * 1024) static int --virDomainXMLDevID(virDomainPtr domain, virDomainDeviceDefPtr dev, char *class, -- char *ref, int ref_len); -+virDomainXMLDevID(virDomainPtr domain, virDomainDefPtr domDef, -+ virDomainDeviceDefPtr dev, char *class, char *ref, int ref_len); +-virDomainXMLDevID(virConnectPtr conn, virDomainDefPtr domain, ++virDomainXMLDevID(virConnectPtr conn ATTRIBUTE_UNUSED, virDomainDefPtr domain, + virDomainDeviceDefPtr dev, char *class, + char *ref, int ref_len); - /** - * do_connect: -@@ -2586,7 +2586,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); -@@ -2701,7 +2701,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; -@@ -2790,7 +2790,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr - 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) { -@@ -3682,31 +3682,32 @@ struct xenUnifiedDriver xenDaemonDriver - /** - * virDomainXMLDevID: - * @domain: pointer to domain object -+ * @domDef: pointer to domain definition object - * @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 - * +@@ -3332,18 +3332,18 @@ xenDaemonDomainBlockPeek(virConnectPtr c * Returns 0 in case of success, -1 in case of failure. */ static int - virDomainXMLDevID(virDomainPtr domain, -+ virDomainDefPtr domDef, +-virDomainXMLDevID(virConnectPtr conn, ++virDomainXMLDevID(virConnectPtr conn ATTRIBUTE_UNUSED, + virDomainDefPtr def, virDomainDeviceDefPtr dev, char *class, char *ref, int ref_len) { -- xenUnifiedPrivatePtr priv = domain->conn->privateData; +- xenUnifiedPrivatePtr priv = conn->privateData; - char *xref; - char *tmp; + unsigned int i; @@ -96,14 +50,14 @@ Index: libvirt-1.0.5.1/src/xen/xend_internal.c if (dev->data.disk->driverName && STREQ(dev->data.disk->driverName, "tap")) strcpy(class, "tap"); -@@ -3716,19 +3717,17 @@ virDomainXMLDevID(virDomainPtr domain, +@@ -3353,19 +3353,17 @@ virDomainXMLDevID(virConnectPtr conn, else strcpy(class, "vbd"); - if (dev->data.disk->dst == NULL) - return -1; - xenUnifiedLock(priv); -- xref = xenStoreDomainGetDiskID(domain->conn, domain->id, +- xref = xenStoreDomainGetDiskID(conn, def->id, - dev->data.disk->dst); - xenUnifiedUnlock(priv); - if (xref == NULL) @@ -114,8 +68,8 @@ Index: libvirt-1.0.5.1/src/xen/xend_internal.c - 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]; ++ for (i = 0; i < def->ndisks; i++) { ++ virDomainDiskDefPtr disk = def->disks[i]; + if (STREQ(dev->data.disk->dst, disk->dst)) { + if (virStrcpy(ref, disk->dst, ref_len) == NULL) + return -1; @@ -126,13 +80,13 @@ Index: libvirt-1.0.5.1/src/xen/xend_internal.c + return -1; } else if (dev->type == VIR_DOMAIN_DEVICE_NET) { char mac[VIR_MAC_STRING_BUFLEN]; - virDomainNetDefPtr def = dev->data.net; -@@ -3736,16 +3735,22 @@ virDomainXMLDevID(virDomainPtr domain, + virDomainNetDefPtr netdef = dev->data.net; +@@ -3373,16 +3371,22 @@ virDomainXMLDevID(virConnectPtr conn, strcpy(class, "vif"); - xenUnifiedLock(priv); -- xref = xenStoreDomainGetNetworkID(domain->conn, domain->id, mac); +- xref = xenStoreDomainGetNetworkID(conn, def->id, mac); - xenUnifiedUnlock(priv); - if (xref == NULL) - return -1; @@ -142,9 +96,9 @@ Index: libvirt-1.0.5.1/src/xen/xend_internal.c - if (tmp == NULL) - return -1; + /* For nics, the mac address can be used directly. */ -+ for (i = 0; i < domDef->nnets; i++) { ++ for (i = 0; i < def->nnets; i++) { + char dst_mac[30]; -+ virDomainNetDefPtr dst_net = domDef->nets[i]; ++ virDomainNetDefPtr dst_net = def->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], @@ -160,20 +114,20 @@ Index: libvirt-1.0.5.1/src/xen/xend_internal.c } 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) { -@@ -3763,17 +3768,44 @@ virDomainXMLDevID(virDomainPtr domain, +@@ -3400,17 +3404,44 @@ virDomainXMLDevID(virConnectPtr conn, strcpy(class, "pci"); - xenUnifiedLock(priv); -- xref = xenStoreDomainGetPCIID(domain->conn, domain->id, bdf); +- xref = xenStoreDomainGetPCIID(conn, def->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++) { ++ for (i = 0 ; i < def->nhostdevs ; i++) { + char *dst_bdf; -+ virDomainHostdevDefPtr hostdev = domDef->hostdevs[i]; ++ virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + + if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) + continue; diff --git a/xen-pv-cdrom.patch b/xen-pv-cdrom.patch index 8d4f47f..b2a29e1 100644 --- a/xen-pv-cdrom.patch +++ b/xen-pv-cdrom.patch @@ -1,8 +1,8 @@ -Index: libvirt-1.0.5.1/src/xenxs/xen_sxpr.c +Index: libvirt-1.0.6/src/xenxs/xen_sxpr.c =================================================================== ---- libvirt-1.0.5.1.orig/src/xenxs/xen_sxpr.c -+++ libvirt-1.0.5.1/src/xenxs/xen_sxpr.c -@@ -341,7 +341,7 @@ error: +--- libvirt-1.0.6.orig/src/xenxs/xen_sxpr.c ++++ libvirt-1.0.6/src/xenxs/xen_sxpr.c +@@ -328,7 +328,7 @@ error: static int xenParseSxprDisks(virDomainDefPtr def, const struct sexpr *root, @@ -11,7 +11,7 @@ Index: libvirt-1.0.5.1/src/xenxs/xen_sxpr.c int xendConfigVersion) { const struct sexpr *cur, *node; -@@ -392,7 +392,6 @@ xenParseSxprDisks(virDomainDefPtr def, +@@ -379,7 +379,6 @@ xenParseSxprDisks(virDomainDefPtr def, /* There is a case without the uname to the CD-ROM device */ offset = strchr(dst, ':'); if (!offset ||