forked from pool/libvirt
improve libxl-support-block-script.patch
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=513
This commit is contained in:
parent
89b02a08bc
commit
2e973f5fca
@ -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.orig/src/libxl/libxl_conf.c
|
||||||
+++ libvirt-1.3.2/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
|
+static int
|
||||||
+libxlDiskSetScript(libxl_device_disk *x_disk, const char *disk_spec)
|
+libxlDiskSetScript(libxl_device_disk *x_disk, const char *disk_spec)
|
||||||
+{
|
+{
|
||||||
|
+ if (disk_spec == NULL)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
+ if (STRPREFIX(disk_spec, "dmmd:")) {
|
+ if (STRPREFIX(disk_spec, "dmmd:")) {
|
||||||
+ if (VIR_STRDUP(x_disk->script, "block-dmmd") < 0)
|
+ if (VIR_STRDUP(x_disk->script, "block-dmmd") < 0)
|
||||||
+ return -1;
|
+ 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:"
|
#define LIBXL_QEMU_DM_STR "Options specific to the Xen version:"
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -1108,6 +1124,7 @@ libxlMakeNetworkDiskSrc(virStorageSource
|
@@ -1108,6 +1127,7 @@ libxlMakeNetworkDiskSrc(virStorageSource
|
||||||
int
|
int
|
||||||
libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
|
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;
|
const char *driver;
|
||||||
int format;
|
int format;
|
||||||
int actual_type = virStorageSourceGetActualType(l_disk->src);
|
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)
|
if (libxlMakeNetworkDiskSrc(l_disk->src, &x_disk->pdev_path) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
@ -51,7 +54,7 @@ Index: libvirt-1.3.2/src/libxl/libxl_conf.c
|
|||||||
return -1;
|
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;
|
x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0;
|
||||||
if (libxlDiskSetDiscard(x_disk, l_disk->discard) < 0)
|
if (libxlDiskSetDiscard(x_disk, l_disk->discard) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user