[libvirt] [PATCH] xen: Also add sub-type for driver=tap2 in xen-xm
Jim Fehlig
jfehlig at suse.com
Wed Apr 13 20:00:06 UTC 2016
On 03/30/2016 03:42 AM, Philipp Hahn wrote:
> 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 | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
This seems fine, but could you also include an xmconfigtest for tap2?
Regards,
Jim
>
> diff --git a/src/xenconfig/xen_xm.c b/src/xenconfig/xen_xm.c
> index e09d97e..6556886 100644
> --- a/src/xenconfig/xen_xm.c
> +++ b/src/xenconfig/xen_xm.c
> @@ -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, ':')))
> @@ -298,7 +299,7 @@ xenFormatXMDisk(virConfValuePtr list,
> else
> type = virStorageFileFormatTypeToString(format);
> virBufferAsprintf(&buf, "%s:", driver);
> - if (STREQ(driver, "tap"))
> + if (STREQ(driver, "tap") || STREQ(driver, "tap2"))
> virBufferAsprintf(&buf, "%s:", type);
> } else {
> switch (virDomainDiskGetType(disk)) {
More information about the libvir-list
mailing list