]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
hostdev: fix net config restore error
authorHuanle Han <hanxueluo@gmail.com>
Wed, 15 Apr 2015 17:29:43 +0000 (01:29 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 24 Apr 2015 16:28:59 +0000 (12:28 -0400)
commitd45dadae6cf476f4a8d99ab14621984564f7fba7
tree9b92c57a8f85a9438046da486acdef402761bba3
parent7ec3f8051f737c17cf92b73ab4cea977ec5e4eaa
hostdev: fix net config restore error

Fix for such a case:
1. Domain A and B xml contain the same SRIOV net hostdev(<interface
type='hostdev' /> with same pci address).
2. virsh start A (Successfully, and configure the SRIOV net with
custom mac)
3. virsh start B (Fail because of the hostdev used by domain A or other
reason.)
In step 3, 'virHostdevNetConfigRestore' is called for the hostdev
which is still used by domain A. It makes the mac/vlan of the SRIOV net
change.

Code Change in this fix:
1. As the pci used by other domain have been removed from
'pcidevs' in previous loop, we only restore the nic config for
the hostdev still in 'pcidevs'(used by this domain)
2. update the comments to make it more clear

Signed-off-by: Huanle Han <hanxueluo@gmail.com>
src/util/virhostdev.c