[libvirt] [PATCH 3/3] qemu: set tap device online for type='ethernet'

Vasiliy Tolstov v.tolstov at selfip.ru
Thu Aug 25 21:43:32 UTC 2016


2016-08-25 8:58 GMT+03:00 Laine Stump <laine at laine.org>:
> When support for auto-creating tap devices was added to <interface
> type='ethernet'> in commit 9717d6, the code assumed that
> virNetDevTapCreate() would honor the *_CREATE_IFUP flag that is
> supported by virNetDevTapCreateInBridgePort(). That isn't the case -
> the latter function performs several operations, and one of them is
> setting the tap device online. But virNetDevTapCreate() *only* creates
> the tap device, and relies on the caller to do everything else, so
> qemuInterfaceEthernetConnect() needs to call virNetDevSetOnline()
> after the device is successfully created.
> ---
>  src/qemu/qemu_interface.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
> index e327133..455c2d0 100644
> --- a/src/qemu/qemu_interface.c
> +++ b/src/qemu/qemu_interface.c
> @@ -453,6 +453,9 @@ qemuInterfaceEthernetConnect(virDomainDefPtr def,
>      if (virNetDevSetMAC(net->ifname, &tapmac) < 0)
>          goto cleanup;
>
> +    if (virNetDevSetOnline(net->ifname, true) < 0)
> +        goto cleanup;
> +
>      if (net->script &&
>          virNetDevRunEthernetScript(net->ifname, net->script) < 0)
>          goto cleanup;
> --
> 2.7.4
>

ACK

-- 
Vasiliy Tolstov,
e-mail: v.tolstov at selfip.ru




More information about the libvir-list mailing list