提交 23e91367 编写于 作者: P Peter Krempa

virsh: change-media: Fix behavior with --update without a source

Docs state that it should behave like eject. Currently the code does not
do that. This is a regression since f4b5f530.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1229592
上级 b378c0f1
......@@ -12411,6 +12411,15 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd)
VSH_EXCLUSIVE_OPTIONS_VAR(eject, block);
if (vshCommandOptStringReq(ctl, cmd, "source", &source) < 0)
return false;
/* Docs state that update without source is eject */
if (update && !source) {
update = false;
eject = true;
}
if (eject) {
update_type = VSH_UPDATE_DISK_XML_EJECT;
action = "eject";
......@@ -12445,9 +12454,6 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd)
if (vshCommandOptStringReq(ctl, cmd, "path", &path) < 0)
goto cleanup;
if (vshCommandOptStringReq(ctl, cmd, "source", &source) < 0)
goto cleanup;
if (flags & VIR_DOMAIN_AFFECT_CONFIG)
doc = virDomainGetXMLDesc(dom, VIR_DOMAIN_XML_INACTIVE);
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册