From 2e973f5fca74f0e7c7bc05907cb27580fdc14843f5fc6c8b45b44bc3f13a1bed Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Wed, 2 Mar 2016 20:40:27 +0000 Subject: [PATCH] improve libxl-support-block-script.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=513 --- libxl-support-block-script.patch | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libxl-support-block-script.patch b/libxl-support-block-script.patch index e32ccec..5e5d251 100644 --- a/libxl-support-block-script.patch +++ b/libxl-support-block-script.patch @@ -11,13 +11,16 @@ Index: libvirt-1.3.2/src/libxl/libxl_conf.c =================================================================== --- libvirt-1.3.2.orig/src/libxl/libxl_conf.c +++ libvirt-1.3.2/src/libxl/libxl_conf.c -@@ -891,6 +891,22 @@ libxlDiskSetDiscard(libxl_device_disk *x +@@ -891,6 +891,25 @@ libxlDiskSetDiscard(libxl_device_disk *x } +static int +libxlDiskSetScript(libxl_device_disk *x_disk, const char *disk_spec) +{ ++ if (disk_spec == NULL) ++ return 0; ++ + if (STRPREFIX(disk_spec, "dmmd:")) { + if (VIR_STRDUP(x_disk->script, "block-dmmd") < 0) + return -1; @@ -34,7 +37,7 @@ Index: libvirt-1.3.2/src/libxl/libxl_conf.c #define LIBXL_QEMU_DM_STR "Options specific to the Xen version:" int -@@ -1108,6 +1124,7 @@ libxlMakeNetworkDiskSrc(virStorageSource +@@ -1108,6 +1127,7 @@ libxlMakeNetworkDiskSrc(virStorageSource int libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk) { @@ -42,7 +45,7 @@ Index: libvirt-1.3.2/src/libxl/libxl_conf.c const char *driver; int format; int actual_type = virStorageSourceGetActualType(l_disk->src); -@@ -1118,7 +1135,7 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk +@@ -1118,7 +1138,7 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk if (libxlMakeNetworkDiskSrc(l_disk->src, &x_disk->pdev_path) < 0) return -1; } else { @@ -51,7 +54,7 @@ Index: libvirt-1.3.2/src/libxl/libxl_conf.c return -1; } -@@ -1227,6 +1244,9 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk +@@ -1227,6 +1247,9 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0; if (libxlDiskSetDiscard(x_disk, l_disk->discard) < 0) return -1;