tuqiang 21c55a45ef virNetDevOpenvswitchUpdateVlan: fix vlan tag update error
We try to update vlan tag by running virsh update-device command,
libvirtd will report ovs-vsctl arguments error. Vlan tag update
funtion does't consider the xml with no vlan configured circumstances.

The steps to reproduce the problem:
1 define and start domain with its vlan configured as:
    <interface type='bridge'>
      <mac address='52:54:00:9e:bb:ac'/>
      <source bridge='ovs-br0'/>
      <vlan>
        <tag id='10'/>
      </vlan>
      <virtualport type='openvswitch'>
      </virtualport>
      <target dev='vnet4.0'/>
      <model type='virtio'/>
      <driver name='vhost'/>
    </interface>
2 define and run virsh update-device command with no vlan configured as:
    <interface type='bridge'>
      <mac address='52:54:00:9e:bb:ac'/>
      <source bridge='ovs-br0'/>
      <virtualport type='openvswitch'>
      </virtualport>
      <target dev='vnet4.0'/>
      <model type='virtio'/>
      <driver name='vhost'/>
    </interface>
   #virsh update-device dom-id novlan.xml
3 virsh command returned error, and we got an error in libvirtd.log:
  error : virCommandWait:2584 : internal error: exit status 1: ovs-vsctl: 'set' command requires at least 3 arguments
  . Child process (ovs-vsctl --timeout=5 -- --if-exists clear Port vnet4.0 tag -- --if-exists clear Port vnet4.0 trunk
  -- --if-exists clear Port vnet4.0 vlan_mode -- --if-exists set Port vnet4.0) unexpected
  error : virNetDevOpenvswitchUpdateVlan:540 : internal error: Unable to set vlan configuration on port vnet4.0

Signed-off-by: Tu Qiang <tu.qiang35@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-02-10 13:02:10 +01:00
..
2021-10-21 17:34:04 +01:00
2022-02-08 08:42:07 +01:00
2022-02-02 10:07:15 +01:00
2021-11-08 14:32:32 +01:00
2021-12-13 14:44:01 +01:00
2022-02-08 08:42:07 +01:00
2022-02-08 08:42:07 +01:00
2022-02-08 08:42:07 +01:00
2021-03-02 09:50:19 +01:00
2022-02-08 08:42:07 +01:00
2022-02-08 08:42:07 +01:00
2021-12-13 14:44:01 +01:00
2022-02-08 08:42:07 +01:00
2021-04-13 17:00:38 +02:00
2021-03-02 09:50:19 +01:00
2022-02-01 19:01:49 +01:00
2021-12-01 13:53:12 +01:00
2022-02-08 08:42:07 +01:00
2022-02-08 08:42:07 +01:00
2022-02-08 08:42:07 +01:00
2022-02-01 19:01:49 +01:00
2022-02-08 08:42:07 +01:00
2021-10-21 17:34:04 +01:00
2021-11-23 12:51:09 +01:00
2021-05-13 11:07:13 +01:00
2021-05-13 11:07:13 +01:00
2022-02-08 08:42:07 +01:00
2022-02-08 08:42:07 +01:00
2022-02-08 08:42:07 +01:00
2021-12-01 13:53:12 +01:00
2022-02-01 17:19:23 +01:00
2021-12-01 14:36:29 +01:00
2022-02-08 08:42:07 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00