- xenconfig: fix conversion of <driver> to backendtype

e33cd67a-xenconfig-backendtype-fix.patch
  bsc#984798

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=542
This commit is contained in:
James Fehlig 2016-06-16 18:45:02 +00:00 committed by Git OBS Bridge
parent e45054c955
commit 0c7f3cbbe1
3 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,60 @@
commit e33cd67a9b51e8fcb4e084f40f500057b30b2786
Author: Jim Fehlig <jfehlig@suse.com>
Date: Wed Jun 15 23:09:36 2016 -0600
xenconfig: fix conversion of <driver> to backendtype
When converting domXML to xen xl.cfg, backendtype should
not be emitted if <driver> is not specified. Moreover,
<driver name='file'/> should be converted to backendtype
qdisk, similar to handling of <driver> in libxlMakeDisk()
in libxl_conf.c.
Prior to this change, connectDomainXMLToNative would
produce incorrect xl.cfg when the input domXML contained
<driver name='file'/>
domXML:
<disk type="file" device="disk">
<driver name="file"/>
<source file="/image/file/path"/>
<target dev="xvda" bus="xen"/>
</disk>
virsh domxml-to-native xen-xl domXML
disk = [ "format=raw,vdev=xvda,access=rw,backendtype=target=/image/file/path" ]
xl create xl.cfg
config parsing error in disk specification: unknown value
for backendtype: near `target=/image/file/path' in
`format=raw,vdev=xvda,access=rw,backendtype=target=/image/file/path'
Index: libvirt-1.3.5/src/xenconfig/xen_xl.c
===================================================================
--- libvirt-1.3.5.orig/src/xenconfig/xen_xl.c
+++ libvirt-1.3.5/src/xenconfig/xen_xl.c
@@ -752,13 +752,15 @@ xenFormatXLDisk(virConfValuePtr list, vi
}
/* backendtype */
- virBufferAddLit(&buf, "backendtype=");
- if (STREQ_NULLABLE(driver, "qemu"))
- virBufferAddLit(&buf, "qdisk,");
- else if (STREQ_NULLABLE(driver, "tap"))
- virBufferAddLit(&buf, "tap,");
- else if (STREQ_NULLABLE(driver, "phy"))
- virBufferAddLit(&buf, "phy,");
+ if (driver) {
+ virBufferAddLit(&buf, "backendtype=");
+ if (STREQ(driver, "qemu") || STREQ(driver, "file"))
+ virBufferAddLit(&buf, "qdisk,");
+ else if (STREQ(driver, "tap"))
+ virBufferAddLit(&buf, "tap,");
+ else if (STREQ(driver, "phy"))
+ virBufferAddLit(&buf, "phy,");
+ }
/* devtype */
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jun 16 18:39:54 UTC 2016 - jfehlig@suse.com
- xenconfig: fix conversion of <driver> to backendtype
e33cd67a-xenconfig-backendtype-fix.patch
bsc#984798
-------------------------------------------------------------------
Wed Jun 15 18:51:29 UTC 2016 - jfehlig@suse.com

View File

@ -257,6 +257,7 @@ Source4: libvirtd-relocation-server.fw
Source99: baselibs.conf
Source100: %{name}-rpmlintrc
# Upstream patches
Patch0: e33cd67a-xenconfig-backendtype-fix.patch
# Patches pending upstream review
Patch100: apparmor-dont-scrub-environment-of-virtlogd-process.patch
# Need to go upstream
@ -706,6 +707,7 @@ libvirt plugin for NSS for translating domain names into IP addresses.
%prep
%setup -q
%patch0 -p1
%patch100 -p1
%patch150 -p1
%patch151 -p1