提交 c490b469 编写于 作者: P Philipp Hahn 提交者: Eric Blake

xen: Return tap2 for tap2 disks

For some versions of Xen the difference between "tap" and "tap2" is
important. When converting back from xen-sxpr to libvirt-xml, that
information is lost, which breaks re-defining the domain using that
data.

Explicitly return "tap2" for disks defined as "device/tap2".
Signed-off-by: NPhilipp Hahn <hahn@univention.de>
上级 c2969ec7
...@@ -397,14 +397,20 @@ xenParseSxprDisks(virDomainDefPtr def, ...@@ -397,14 +397,20 @@ xenParseSxprDisks(virDomainDefPtr def,
goto error; goto error;
} }
if (VIR_ALLOC_N(disk->driverName, (offset-src)+1) < 0) if (sexpr_lookup(node, "device/tap2") &&
goto no_memory; STRPREFIX(src, "tap:")) {
if (virStrncpy(disk->driverName, src, offset-src, if (!(disk->driverName = strdup("tap2")))
(offset-src)+1) == NULL) { goto no_memory;
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR, } else {
_("Driver name %s too big for destination"), if (VIR_ALLOC_N(disk->driverName, (offset-src)+1) < 0)
src); goto no_memory;
goto error; if (virStrncpy(disk->driverName, src, offset-src,
(offset-src)+1) == NULL) {
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Driver name %s too big for destination"),
src);
goto error;
}
} }
src = offset + 1; src = offset + 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册