From 3a0ff50e79917a5e481beeae0f5c7ad7bd176673 Mon Sep 17 00:00:00 2001 From: Vlastimil Holer Date: Thu, 25 May 2017 22:51:00 +0200 Subject: [PATCH] B #5171: Check if NIC is really absent after detach on KVM --- src/vmm_mad/remotes/kvm/detach_nic | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vmm_mad/remotes/kvm/detach_nic b/src/vmm_mad/remotes/kvm/detach_nic index 58c4b93c53..21016f698f 100755 --- a/src/vmm_mad/remotes/kvm/detach_nic +++ b/src/vmm_mad/remotes/kvm/detach_nic @@ -26,3 +26,10 @@ DETACH_ARGS="--domain $DOMAIN --type bridge --mac $MAC" exec_and_log "virsh --connect $LIBVIRT_URI detach-interface $DETACH_ARGS" \ "Could not detach NIC ($MAC) from $DOMAIN" + +virsh --connect $LIBVIRT_URI domiflist $DOMAIN | grep $MAC > /dev/null 2>&1 + +if [ $? -eq 0 ] ; then + error_message "Could not detach NIC ($MAC) from $DOMAIN" + exit -1 +fi