1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-27 07:22:07 +03:00

conf: Move disk target 'ioemu:' stripping to virDomainDiskDefPostParse

Modifications of the data such as this one don't belong into the parser.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2021-04-14 09:59:22 +02:00
parent 1645fc6aa7
commit fb89cce883

View File

@ -5367,6 +5367,16 @@ virDomainDiskDefPostParse(virDomainDiskDef *disk,
const virDomainDef *def,
virDomainXMLOption *xmlopt)
{
if (disk->dst) {
char *newdst;
/* Work around for compat with Xen driver in previous libvirt releases */
if ((newdst = g_strdup(STRSKIP(disk->dst, "ioemu:")))) {
g_free(disk->dst);
disk->dst = newdst;
}
}
if (disk->src->type == VIR_STORAGE_TYPE_NETWORK &&
disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI) {
virDomainPostParseCheckISCSIPath(&disk->src->path);
@ -9345,12 +9355,6 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt,
return NULL;
removable = virXMLPropString(cur, "removable");
rotation_rate = virXMLPropString(cur, "rotation_rate");
/* HACK: Work around for compat with Xen
* driver in previous libvirt releases */
if (target &&
STRPREFIX(target, "ioemu:"))
memmove(target, target+6, strlen(target)-5);
} else if (!domain_name &&
virXMLNodeNameEqual(cur, "backenddomain")) {
domain_name = virXMLPropString(cur, "name");