Laine Stump 4bbe1029f2 qemu: fix ifindex array reported to systemd
Commit f7afeddc added code to report to systemd an array of interface
indexes for all tap devices used by a guest. Unfortunately it not only
didn't add code to report the ifindexes for macvtap interfaces
(interface type='direct') or the tap devices used by type='ethernet',
it ended up sending "-1" as the ifindex for each macvtap or hostdev
interface. This resulted in a failure to start any domain that had a
macvtap or hostdev interface (or actually any type other than
"network" or "bridge").

This patch does the following with the nicindexes array:

1) Modify qemuBuildInterfaceCommandLine() to only fill in the
nicindexes array if given a non-NULL pointer to an array (and modifies
the test jig calls to the function to send NULL). This is because
there are tests in the test suite that have type='ethernet' and still
have an ifname specified, but that device of course doesn't actually
exist on the test system, so attempts to call virNetDevGetIndex() will
fail.

2) Even then, only add an entry to the nicindexes array for
appropriate types, and to do so for all appropriate types ("network",
"bridge", and "direct"), but only if the ifname is known (since that
is required to call virNetDevGetIndex().
2015-02-25 13:11:14 -05:00
..
2014-09-03 09:36:13 -06:00
2015-01-16 14:07:46 +01:00
2014-01-01 16:34:13 +00:00
2015-01-04 11:10:14 -07:00
2014-09-03 09:36:13 -06:00
2014-12-09 10:02:20 -05:00
2014-09-04 15:18:43 -06:00
2014-08-18 20:36:24 -06:00
2013-07-29 13:09:39 -06:00
2015-02-20 16:17:19 +01:00
2014-11-25 08:47:12 -07:00
2013-10-14 10:31:01 +01:00
2014-04-08 11:15:55 +01:00