]> git.ipfire.org Git - thirdparty/libvirt.git/commit
fix two bugs in bridge_driver.c
authorHu Tao <hutao@cn.fujitsu.com>
Fri, 11 Nov 2011 08:20:19 +0000 (16:20 +0800)
committerEric Blake <eblake@redhat.com>
Fri, 11 Nov 2011 23:31:54 +0000 (16:31 -0700)
commitd3da21d6562461bef3fcf0a9a40b84e6e2c0f80f
treef2c019bdb0f3400bbbf54a33b124cbfa026d5c9f
parente55ec69de6751bd6e2dc0c0c37e317298507919b
fix two bugs in bridge_driver.c

steps to reproduce:

1. having a network xml file(named default.xml) like this one:

<network>
  <name>default</name>
  <uuid>c5322c4c-81d0-4985-a363-ad6389780d89</uuid>
  <bridge name="virbr0" />
  <forward/>
  <ip address="192.168.122.1" netmask="255.255.255.0">
    <dhcp>
      <range start="192.168.122.2" end="192.168.122.254" />
    </dhcp>
  </ip>
</network>

in /etc/libvirt/qemu/networks/, and mark it as autostart:

$ ls -l /etc/libvirt/qemu/networks/autostart
total 0
lrwxrwxrwx 1 root root 14 Oct 12 14:02 default.xml -> ../default.xml

2. start libvirtd and the device virbr0 is not automatically up.

The reason is that the function virNetDevExists is now returns 1 if
the device exists, comparing to the former one returns 0 if the device
exists. But with only this fix will cause a segmentation fault(the same
steps as above)  that is fixed by the second chunk of code.
src/network/bridge_driver.c