]> xenbits.xensource.com Git - libvirt.git/commitdiff
xen: Also add sub-type for driver=tap2 in xen-xm
authorPhilipp Hahn <hahn@univention.de>
Thu, 19 May 2016 06:24:55 +0000 (08:24 +0200)
committerJim Fehlig <jfehlig@suse.com>
Tue, 7 Jun 2016 19:59:58 +0000 (13:59 -0600)
tap2 only handles 'aio', but not 'raw', which must be explicitly given:

| $ virsh domxml-to-native yyy.xml > yyy.xm
| $ xm new yyy.xm
| Error: tap:/srv/xen/xxx.img not a valid disk type
| $ sed -i -e 's/tap2:/&aio:/' yyy.xm
| $ xm new yyy.xm

Fix reading and writing "xen-xm" format for "tap2" by handling it the
same as "tap".

src/xenconfig/xen_xm.c

index 3658c59797fc0d462ea8ccb37499f10ded4001ba..1023ed2649921580988a80bd2404b9b57971f931 100644 (file)
@@ -196,7 +196,8 @@ xenParseXMDisk(virConfPtr conf, virDomainDefPtr def)
                 }
 
                 /* And the sub-type for tap:XXX: type */
-                if (STREQ_NULLABLE(virDomainDiskGetDriver(disk), "tap")) {
+                if (STREQ_NULLABLE(virDomainDiskGetDriver(disk), "tap") ||
+                    STREQ_NULLABLE(virDomainDiskGetDriver(disk), "tap2")) {
                     char *driverType;
 
                     if (!(tmp = strchr(src, ':')))
@@ -300,7 +301,7 @@ xenFormatXMDisk(virConfValuePtr list,
 
             if (driver) {
                 virBufferAsprintf(&buf, "%s:", driver);
-                if (STREQ(driver, "tap"))
+                if (STREQ(driver, "tap") || STREQ(driver, "tap2"))
                     virBufferAsprintf(&buf, "%s:", type);
             }
         } else {