mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
virsh: Use inactive definition when removing disk from config
https://bugzilla.redhat.com/show_bug.cgi?id=1049529 The 'detach-disk' command in virsh used the active XML definition of a domain even when attempting to remove a disk from the config only. If the disk was only in the inactive definition the operation failed. Fix this by using the inactive XML in case that only the config is affected.
This commit is contained in:
parent
0bb64df1fc
commit
f9d06ebcef
@ -10175,7 +10175,12 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
|
||||
if (vshCommandOptStringReq(ctl, cmd, "target", &target) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(doc = virDomainGetXMLDesc(dom, 0)))
|
||||
if (flags == VIR_DOMAIN_AFFECT_CONFIG)
|
||||
doc = virDomainGetXMLDesc(dom, VIR_DOMAIN_XML_INACTIVE);
|
||||
else
|
||||
doc = virDomainGetXMLDesc(dom, 0);
|
||||
|
||||
if (!doc)
|
||||
goto cleanup;
|
||||
|
||||
if (persistent &&
|
||||
|
Loading…
Reference in New Issue
Block a user