qemu: don't reject interface update when switching to/from bridged network
qemu: don't reject interface update when switching to/from bridged network

If virDomainUpdateDeviceFlags() was used to update an <interface>, and
the interface type changed from type='network' where the network was
an unmanaged bridge (so actualType == bridge) to type='bridge'
(i.e. actualType *also* == bridge), the update would fail due to the
perceived change in type.

In practice it is okay to switch between any interface types that end
up using a tap device, since libvirt just needs to attach the device
to a new bridge. But in this case we were erroneously rejecting it due
to a conditional that was too restrictive. This is what the code was doing:

  if (old->type != new->type)
     [allow update]
  else
     if ((oldActual == bridge and newActual == network)
         || (oldActual == network and newActual == bridge)) {
         [allow update]
     else
         [error]

In the case described above though, old->type and new->type don't match,
but oldActual and newActual are both 'bridge', so we get an error.

This patch changes the inner conditional so that any combination of
'network' and 'bridge' for oldActual and newActual, since they both
use a tap device connected to a bridge.

Signed-off-by: Laine Stump <c23361c43fbf79fed83e8b76173707b083d6caf5@redhat.com>
Reviewed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

crobinso/libvirt,libvirt/libvirt,olafhering/libvirt,zippy2/libvirt,olafhering/libvirt,jfehlig/libvirt,jfehlig/libvirt,libvirt/libvirt,jardasgit/libvirt,zippy2/libvirt,nertpinx/libvirt,crobinso/libvirt,nertpinx/libvirt,jardasgit/libvirt,olafhering/libvirt,zippy2/libvirt,jardasgit/libvirt,libvirt/libvirt,nertpinx/libvirt,crobinso/libvirt,nertpinx/libvirt,jardasgit/libvirt,olafhering/libvirt,jfehlig/libvirt,jfehlig/libvirt,zippy2/libvirt,libvirt/libvirt,jardasgit/libvirt,crobinso/libvirt,nertpinx/libvirt