]> xenbits.xensource.com Git - libvirt.git/commit
util: properly save/restore original vlan tag for VFs
authorLaine Stump <laine@laine.org>
Thu, 16 Aug 2012 04:06:39 +0000 (00:06 -0400)
committerLaine Stump <laine@laine.org>
Thu, 16 Aug 2012 14:14:05 +0000 (10:14 -0400)
commite979226ba2e14ea09ee5d70f5f9f40324e5d7472
treeb557516e2ccbe1dd2fced6d9375a211c25768480
parent29d8ed7a61a9bf5d971a3111b226474384384bfc
util: properly save/restore original vlan tag for VFs

When a network device that is a VF of an SR-IOV card was assigned to a
guest using <interface type='hostdev'>, only the MAC address was being
saved/restored, but the VLAN tag was left untouched. Up to now we
haven't actually used vlan tags on SR-IOV devices, so the guest would
have used whatever was set, and left it the same at the end.

The patch following this one will hook up the <vlan> element from the
interface config, so save/restore of the device state needs to also
include the vlan tag.

MAC address is being saved as a simple ASCII string in a file named
for the device under /var/run.  The VLAN tag is now just added at the
end of that file, after a newline. It might be nicer if the file was
XML (in case it ever gets more complicated) but at the moment there's
nothing else on the horizon, and this makes backward compatibility
easier.
src/util/virnetdev.c