mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-09 21:21:28 +00: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:
parent
1645fc6aa7
commit
fb89cce883
@ -5367,6 +5367,16 @@ virDomainDiskDefPostParse(virDomainDiskDef *disk,
|
|||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
virDomainXMLOption *xmlopt)
|
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 &&
|
if (disk->src->type == VIR_STORAGE_TYPE_NETWORK &&
|
||||||
disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI) {
|
disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI) {
|
||||||
virDomainPostParseCheckISCSIPath(&disk->src->path);
|
virDomainPostParseCheckISCSIPath(&disk->src->path);
|
||||||
@ -9345,12 +9355,6 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt,
|
|||||||
return NULL;
|
return NULL;
|
||||||
removable = virXMLPropString(cur, "removable");
|
removable = virXMLPropString(cur, "removable");
|
||||||
rotation_rate = virXMLPropString(cur, "rotation_rate");
|
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 &&
|
} else if (!domain_name &&
|
||||||
virXMLNodeNameEqual(cur, "backenddomain")) {
|
virXMLNodeNameEqual(cur, "backenddomain")) {
|
||||||
domain_name = virXMLPropString(cur, "name");
|
domain_name = virXMLPropString(cur, "name");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user