<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 08/25/2016 05:42 AM, Vasiliy Tolstov
      wrote:<br>
    </div>
    <blockquote
cite="mid:CACaajQv9d8Zqbn_Bg9TBh+ZSGyAgtXHLeU+YUBzteWPZEk1bLQ@mail.gmail.com"
      type="cite">
      <p dir="ltr">25 Авг 2016 г. 12:34 пользователь Vasiliy Tolstov
        <<a moz-do-not-send="true" href="mailto:v.tolstov@selfip.ru">v.tolstov@selfip.ru</a>>
        написал:<br>
        ><br>
        > 25 Авг 2016 г. 8:58 пользователь "Laine Stump" <<a
          moz-do-not-send="true" href="mailto:laine@laine.org">laine@laine.org</a>>
        написал:<br>
        > ><br>
        > > The linkstate setting of an <interface> is only
        meant to change the<br>
        > > online status reported to the guest system by the
        emulated network<br>
        > > device driver in qemu,<br>
        ><br>
        I need to set host side status of interface. Without this live
        migration with dinamic routing software (ospf with quagga or
        bird) bring packet drops. Because on dest interface in up state
        and kernel try to forward packets to it, but guest  CPU is not
        running.</p>
    </blockquote>
    <br>
    That shouldn't be a problem, since the IPInfo isn't added to the tap
    device until immediately before the guest CPU is started on the
    destination (that's the purpose of qemuInterfaceStartDevice()).<br>
    <br>
    <br>
    <blockquote
cite="mid:CACaajQv9d8Zqbn_Bg9TBh+ZSGyAgtXHLeU+YUBzteWPZEk1bLQ@mail.gmail.com"
      type="cite">
      <p dir="ltr"> Also host side status needed for easy blackhole
        traffic to guest ip.<br>
      </p>
    </blockquote>
    <br>
    Is this something you need to do while the guest is already running?
    If not, then I think we don't need anything extra.<br>
    <br>
    <br>
    <blockquote
cite="mid:CACaajQv9d8Zqbn_Bg9TBh+ZSGyAgtXHLeU+YUBzteWPZEk1bLQ@mail.gmail.com"
      type="cite">
      <p dir="ltr">May be create inside the source link state attribute
        for host side link status? So it consistent with ip and route
        elements?</p>
    </blockquote>
    <br>
    If necessary, that might be the right solution, although I still
    think it's better to not set the tap device offline, in case it's
    connected to a bridge - we wouldn't want to trigger an STP forward
    delay. Maybe just delete (and later re-add) the IPInfo would be less
    disruptive? (Or it might be *more* disruptive, we'd have to try
    both).<br>
    <br>
    <br>
    <blockquote
cite="mid:CACaajQv9d8Zqbn_Bg9TBh+ZSGyAgtXHLeU+YUBzteWPZEk1bLQ@mail.gmail.com"
      type="cite">
      <p dir="ltr">><br>
        > > but when support for auto-creating tap devices<br>
        > > for <interface type='ethernet'> was added in
        commit 9717d6, a chunk of<br>
        > > code was also added to qemuDomainChangeNetLinkState()
        that sets the<br>
        > > online status of the tap device (i.e. the *host* side
        of the<br>
        > > interface) for type='ethernet'. This was never done
        for tap devices<br>
        > > used in type='bridge' or type='network' interfaces,
        nor was it done in<br>
        > > the past for tap devices created by external scripts
        for<br>
        > > type='ethernet', so we shouldn't be doing it now.<br>
        > ><br>
        > > This patch removes the bit of code in
        qemuDomainChangeNetLinkState()<br>
        > > that modifies online status of the tap device.<br>
        > > ---<br>
        > >  src/qemu/qemu_hotplug.c | 15 ---------------<br>
        > >  1 file changed, 15 deletions(-)<br>
        > ><br>
        > > diff --git a/src/qemu/qemu_hotplug.c
        b/src/qemu/qemu_hotplug.c<br>
        > > index 00e4a75..5300bc1 100644<br>
        > > --- a/src/qemu/qemu_hotplug.c<br>
        > > +++ b/src/qemu/qemu_hotplug.c<br>
        > > @@ -2324,21 +2324,6 @@ int
        qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,<br>
        > >      if (ret < 0)<br>
        > >          goto cleanup;<br>
        > ><br>
        > > -    if (virDomainNetGetActualType(dev) ==
        VIR_DOMAIN_NET_TYPE_ETHERNET) {<br>
        > > -        switch (linkstate) {<br>
        > > -            case
        VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP:<br>
        > > -            case
        VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT:<br>
        > > -                if ((ret =
        virNetDevSetOnline(dev->ifname, true)) < 0)<br>
        > > -                    goto cleanup;<br>
        > > -                break;<br>
        > > -<br>
        > > -            case
        VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN:<br>
        > > -                if ((ret =
        virNetDevSetOnline(dev->ifname, false)) < 0)<br>
        > > -                    goto cleanup;<br>
        > > -                break;<br>
        > > -            }<br>
        > > -    }<br>
        > > -<br>
        > >      /* modify the device configuration */<br>
        > >      dev->linkstate = linkstate;<br>
        > ><br>
        > > --<br>
        > > 2.7.4<br>
        > ><br>
      </p>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>