Bug 840344
Summary: | Cannot remove specific NIC from guest through virsh command. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Geyang Kong <gkong> | ||||
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> | ||||
Status: | CLOSED DUPLICATE | QA Contact: | |||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | unspecified | CC: | acathrow, cwei, dallan, dyuan, mjenner, mzhan, ydu, zpeng | ||||
Target Milestone: | --- | Keywords: | Reopened | ||||
Target Release: | --- | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2013-10-16 08:48:59 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Geyang Kong
2012-07-16 03:28:31 UTC
Created attachment 598366 [details]
libvirtd's log file
you added a vNIC with type bridge, you should use command virsh detach-interface <domain> bridge --mac $macaddress rather than virsh detach-interface <domain> network --mac $macaddress I tried it, no such a problem, the virtual NIC could be detached successfully. (In reply to comment #3) > you added a vNIC with type bridge, you should use command > > virsh detach-interface <domain> bridge --mac $macaddress > rather than > virsh detach-interface <domain> network --mac $macaddress > > I tried it, no such a problem, the virtual NIC could be detached > successfully. Why do we require the user to specify the network type? That seems strange, shouldn't we just require the MAC, and if more than one interface with that MAC exists, either error or remove them all? Reopening to check if my suggestion in comment 4 is feasible. If not, please reclose. (In reply to Dave Allan from comment #4) > (In reply to comment #3) > > you added a vNIC with type bridge, you should use command > > > > virsh detach-interface <domain> bridge --mac $macaddress > > rather than > > virsh detach-interface <domain> network --mac $macaddress > > > > I tried it, no such a problem, the virtual NIC could be detached > > successfully. > > Why do we require the user to specify the network type? That seems strange, > shouldn't we just require the MAC, and if more than one interface with that > MAC exists, either error or remove them all? Because 'virsh detach-interface' is trying to be user friendly. I mean, libvirt doesn't have any API such as detachInterface. Just detachDevice (any device) from guest which requires whole device XML to be passed in as input. So what detach-interface does, is take all the required info from user (in this case domain, network type and mac), constructs a minimal XML and calls detachDevice. The last two parameters are required by detachDevice - prior starting a detach job, the corresponding device needs to be found. So while detach-interface violates documented requirement and gives bad example to others, it works because we know what piece of device XML is really required. But this may change in the future which will leave us with broken detach-interface. Having said all of that, I see two possibilities of resolving this bug: 1) CLOSED NOTABUG 2) CLOSED as DUPLICATE of 616721 = my normalization API bug. The reason for going with 1) is the report isn't using the virsh command properly. The reason for going with 2) is, after my normalization API patches are merged, we can do detach-interface much more wisely: 1) dump domain XML 2) search for the corresponding device in the domain XML based on the minimum info provided by user, e.g. if there's a single NIC in the domain, user should really just be able to 'virsh detach-interface $dom' as it is clear which interface does he want to detach 3) use the device XML from domain XML not the minimalistic one virsh has produced. Since I think virsh has a lot of catching to do in field of user friendliness, I am going with 2). *** This bug has been marked as a duplicate of bug 616721 *** |