I used a recent version of the softwrae stack from Disco
- qemu 3.1
- libvirt 5.0
- openvswitch 2.11

With that I had a guest with an OVS device like that:
    <interface type='bridge'>
      <mac address='52:54:00:22:57:fd'/>
      <source network='ovsbr0' bridge='ovsbr0'/>
      <virtualport type='openvswitch'>
        <parameters interfaceid='f44ac4e9-fe46-48b8-920c-7ba13dd024ba'/>
      </virtualport>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <driver name='vhost' queues='4'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' 
function='0x0'/>
    </interface>

Not too different to your's I'd think.
The OVS is trivial just having this interface atm.

$ sudo ovs-vsctl show
596674ef-e4cd-471f-9708-9caa5737961c
    Bridge "ovsbr0"
        Port "eno49"
            Interface "eno49"
        Port "ovsbr0"
            Interface "ovsbr0"
                type: internal
        Port "vnet1"
            Interface "vnet1"
    ovs_version: "2.11.0"

$ ip link show dev vnet1
93: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master 
ovs-system state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether fe:54:00:22:57:fd brd ff:ff:ff:ff:ff:ff

I have a started a second guest on the same vswitch (to check traffic
from the first guest later on).

Now lets delete that port:
$ sudo ovs-vsctl del-port ovsbr0 vnet1
$ sudo ovs-vsctl show
596674ef-e4cd-471f-9708-9caa5737961c
    Bridge "ovsbr0"
        Port "vnet3"
            Interface "vnet3"
        Port "eno49"
            Interface "eno49"
        Port "ovsbr0"
            Interface "ovsbr0"
                type: internal
    ovs_version: "2.11.0"

Ok the OVS device is gone.
Obviously traffic on that interface is dead now, but the guest is still alive 
and happy.

The host dev is still there:
$ ip link show dev vnet1
93: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN 
mode DEFAULT group default qlen 1000
    link/ether fe:54:00:22:57:fd brd ff:ff:ff:ff:ff:ff
Removing that as well as suggested


$ sudo ip link del vnet1
$ ip link show dev vnet1
Device "vnet1" does not exist.

The guest still is up and running, while traffic still won't work for obvious 
reasons.
Now lets trigger the hot-unplug of the device.

$ virsh detach-device guest-openvswitch-1 net.xml 
Device detached successfully

The guest is still happy and alive.
It lost the device (since we detached it) but that is ok and intentional.

** Bug watch added: Red Hat Bugzilla #1242383
   https://bugzilla.redhat.com/show_bug.cgi?id=1242383

** Bug watch added: Red Hat Bugzilla #1151306
   https://bugzilla.redhat.com/show_bug.cgi?id=1151306

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1812822

Title:
  Guest crashed when detaching the ovs interface device

Status in Ubuntu on IBM z Systems:
  New
Status in linux package in Ubuntu:
  Incomplete
Status in qemu package in Ubuntu:
  Incomplete

Bug description:
  
   When detaching one openvswitch interface device with virsh detach-device, if 
the port has been deleted from the ovs and the interface device has been 
deleted. The virsh detach-device will fail with "error: Unable to read from 
monitor: Connection reset by peer", the qemu is terminated and the log shows " 
UNSETVNETLE ioctl() failed, File descriptor in bad state".  

  
  [Background] This error is originally found from the openstack KVM CI tempest 
test.  By investigating I found it's introduced by one ovs-vif patch, which 
deletes the ovs port and delete the interface before detaching the device.  You 
can find the commit from https://bugs.launchpad.net/os-vif/+bug/1801072

  
  Reproduced:

  
     root@xxxx:~#  ovs-vsctl del-port br0 tap9273235a-dd
     root@xxxx:~#  ip link del tap9273235a-dd

  
  The interface device tap9273235a-dd has been removed from the host(ifconfg, 
ovs-vsctl show)  and can be found in the guest.(logon the guest, ip a  it's in 
down state)

  
  root@xxxx:~# virsh detach-device kvm net.xml
  error: Failed to detach device from net.xml
  error: Unable to read from monitor: Connection reset by peer

  
  The qemu has terminated and the log in /var/log/libvirt/qemu/kvm.log
  TUNSETVNETLE ioctl() failed: File descriptor in bad state.
  2019-01-18 08:16:11.304+0000: shutting down, reason=crashed

  
  It seems the qemu tried to handle this interface, but in fact it has been 
deleted. qemu couldn't read the file and give the error.
  But I don't think the guest should be crashed directly for the file 
descriptor error. 



  
  Environment:
  Ubuntu 16.04.5 LTS
  Linux (EC12) 4.4.0-141-generic
  QEMU emulator version 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.5~cloud0)
  libvirtd (libvirt) 4.0.0


  
  net.xml

  
       <interface type='bridge'>
      <mac address='52:54:00:fb:5c:46'/>
      <source bridge='br0'/>
      <virtualport type='openvswitch'>
        <parameters  interfaceid='9273234d-9ad4-4ecf-8869-d63ac17a0e6d'/>
      </virtualport>
      <target dev='tap9273235a-dd'/>
        <model type='virtio'/>
        <mtu size='1450'/>
        <alias name='net1'/>
        <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0005'/>
    </interface>


  
  kvm.xml

  
  <domain type='kvm' id='31'>
    <name>kvm</name>
    <uuid>59f71b47-16e4-401d-9d33-30bc1605a84a</uuid>
    <memory unit='KiB'>524288</memory>
    <currentMemory unit='KiB'>524288</currentMemory>
    <vcpu placement='static'>1</vcpu>
    <resource>
      <partition>/machine</partition>
    </resource>
    <os>
      <type arch='s390x' machine='s390-ccw-virtio-bionic'>hvm</type>
      <boot dev='hd'/>
    </os>
    <cpu>
      <topology sockets='1' cores='1' threads='1'/>
    </cpu>
    <clock offset='utc'/>
    <on_poweroff>destroy</on_poweroff>
    <on_reboot>restart</on_reboot>
    <on_crash>destroy</on_crash>
    <devices>
      <emulator>/usr/bin/qemu-system-s390x</emulator>
      <disk type='file' device='disk'>
        <driver name='qemu' type='qcow2' cache='none'/>
        <source file='/root/xenial-minimal.qcow2'/>
        <backingStore/>
        <target dev='vda' bus='virtio'/>
        <alias name='virtio-disk0'/>
        <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
      </disk>
      <console type='pty' tty='/dev/pts/2'>
        <source path='/dev/pts/2'/>
        <target type='sclp' port='0'/>
        <alias name='console0'/>
      </console>
      <memballoon model='virtio'>
        <alias name='balloon0'/>
        <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
      </memballoon>
      <panic model='s390'/>
    </devices>
    <seclabel type='dynamic' model='apparmor' relabel='yes'>
      <label>libvirt-59f71b47-16e4-401d-9d33-30bc1605a84a</label>
      <imagelabel>libvirt-59f71b47-16e4-401d-9d33-30bc1605a84a</imagelabel>
    </seclabel>
    <seclabel type='dynamic' model='dac' relabel='yes'>
      <label>+0:+0</label>
      <imagelabel>+0:+0</imagelabel>
    </seclabel>
  </domain>

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1812822/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to