Feature added with a series of upstream commits: dc675f3 link-state: virsh: Add wrapper commands for changing link state e0a07bb link-state: qemu: Add net intf modification to virUpdateDeviceFlags 8277c15 link-state: qemu: Add monitor handling for link state modification edd1295 link-state: conf: Add element to XML for controling link state c246b02 link-state: util: Add equality comparison functions for structures
Test with: libvirt-0.9.9-1.el6.x86_64 VIA XML: # virsh update-device kvm22 iface.xml Device updated successfully <interface type='network'> <mac address='52:54:00:43:ff:6b'/> <source network='default'/> <target dev='vnet1'/> <model type='virtio'/> <link state='up'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> the link state 'up' 'down' works well. On-the-fly: # virsh domif-setlink kvm22 52:54:00:43:ff:6b up Device updated successfully # virsh domif-setlink kvm22 52:54:00:43:ff:6b down Device updated successfully The guest interface is under control.
When update device to 'down' guest can't ping to other hosts When update device to 'up' guest can ping to other hosts
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Libvirt added a feature to control link state of the guest virtual network interfaces. This allows to perform testing and simulation as though the user would plug and unplug the network cable from the interface. This also allows isolation of the guest in case of problems.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1,3 @@ -Libvirt added a feature to control link state of the guest virtual network interfaces. This allows to perform testing and simulation as though the user would plug and unplug the network cable from the interface. This also allows isolation of the guest in case of problems.+Controlling up/down link states + +libvirt is now capable of controlling the state (up or down) of a link of the guest virtual network interfaces. This allows users to perform testing and simulation as though though plugging and unplugging the network cable from the interface. This feature also lets users isolate guests in case any issues arise.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0748.html