提交 cee47aac 编写于 作者: M Michal Privoznik 提交者: Eric Blake

virsh: require --mac to avoid detach-interface ambiguity

bugfix for https://bugzilla.redhat.com/show_bug.cgi?id=671050

virsh simply refutes to detach-interface in case when multiple
interfaces are attached and --mac is not specified.
上级 75da8b85
...@@ -23,7 +23,7 @@ The primary maintainers and people with commit access rights: ...@@ -23,7 +23,7 @@ The primary maintainers and people with commit access rights:
Guido Günther <agx@sigxcpu.org> Guido Günther <agx@sigxcpu.org>
John Levon <john.levon@sun.com> John Levon <john.levon@sun.com>
Matthias Bolte <matthias.bolte@googlemail.com> Matthias Bolte <matthias.bolte@googlemail.com>
Jiri Denemark <jdenemar@redhat.com> Jiří Denemark <jdenemar@redhat.com>
Dave Allan <dallan@redhat.com> Dave Allan <dallan@redhat.com>
Laine Stump <laine@redhat.com> Laine Stump <laine@redhat.com>
Stefan Berger <stefanb@us.ibm.com> Stefan Berger <stefanb@us.ibm.com>
...@@ -144,6 +144,7 @@ Patches have also been contributed by: ...@@ -144,6 +144,7 @@ Patches have also been contributed by:
Paweł Krześniak <pawel.krzesniak@gmail.com> Paweł Krześniak <pawel.krzesniak@gmail.com>
Kay Schubert <kayegypt@web.de> Kay Schubert <kayegypt@web.de>
Marc-André Lureau <marcandre.lureau@redhat.com> Marc-André Lureau <marcandre.lureau@redhat.com>
Michal Prívozník <mprivozn@redhat.com>
[....send patches to get your name here....] [....send patches to get your name here....]
......
...@@ -8557,6 +8557,12 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd) ...@@ -8557,6 +8557,12 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
goto cleanup; goto cleanup;
} }
if ((!mac) && (obj->nodesetval->nodeNr > 1)) {
vshError(ctl, _("Domain has %d interfaces. Please specify which one "
"to detach using --mac"), obj->nodesetval->nodeNr);
goto cleanup;
}
if (!mac) if (!mac)
goto hit; goto hit;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册