[Kimchi-devel] Problems with virsh iface-undefine or network.undefine()

Aline Manera alinefm at linux.vnet.ibm.com
Tue Oct 27 15:23:18 UTC 2015


Hi Ramon,

I was checking the libvirt documentation and found that:

pydoc llibvirt.virInterface
  |  undefine(self)
  |      Undefine an interface, ie remove it from the config.
  |      This does not free the associated virInterfacePtr object.
  |
  |      Normally this change in the interface configuration is
  |      permanent/persistent, but if virInterfaceChangeBegin() has been
  |      previously called (i.e. if an interface config transaction is
  |      open), the removal of the interface definition will only become
  |      permanent if virInterfaceChangeCommit() is called prior to the next
  |      reboot of the system running libvirtd. Prior to that time, the
  |      definition can be explicitly restored using
  |      virInterfaceChangeRollback(), or will be automatically restored
  |      during the next reboot of the system running libvirtd.

Seems libvirt removes the network configuration file by default but you 
can change this behaviour as explained above.

Let me know if it works for you.

Regards,
Aline Manera

On 26/10/2015 13:46, Ramon Medeiros wrote:
> Hi,
>
> i was testing network remove with libvirt and found an issue for my 
> feature.
>
> By this scenario, i tried to remove the bridge network:
>
> Scenario:
>
> I have a eth0 interface. By that, i create a bridge called br0(libvirt 
> name test), based on this scenario. Now i have the files ifcfg-eth0 
> and ifcfg-br0 at /etc/sysconfig/network-scripts.
>
> When i use virsh iface-undefine test or network.undefine() to remove 
> the test network (that uses br0 bridge), libvirt remove both 
> ifcfg-eth0 and ifcfg-br0 at /etc/sysconfig/network-scripts.
>
> What is better: create a function to manually remove this files or 
> open a bug against libvirt?
>




More information about the Kimchi-devel mailing list