[libvirt] [PATCH] bugfix for https://bugzilla.redhat.com/show_bug.cgi?id=671050

Michal Privoznik mprivozn at redhat.com
Tue Jan 25 17:31:00 UTC 2011


virsh simply refutes to detach-interface in case when multiple interfaces are attached and --mac is not specified.
---
 tools/virsh.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index aba7945..f965fc0 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -8557,6 +8557,11 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
     }
 
+    if ((!mac) && (obj->nodesetval->nodeNr > 1)) {
+        vshError(ctl, _("Domain has %d interfaces. Please specify which one you want to detach using --mac"), obj->nodesetval->nodeNr);
+        goto cleanup;
+    }
+
     if (!mac)
         goto hit;
 
-- 
1.7.3.5




More information about the libvir-list mailing list