detach-interface success but domiflist still saw interface

Hello Commnunity, I saw an weird situation on a phytium machine (arm64 v8), after the following commands, I can still see the interface which should be successfully detached. virsh # detach-interface 4a365b06-2597-4c17-8b44-dbb6953f9ced bridge --mac fa:16:3e:c5:62:40 Interface detached successfully Future qmp commands shows, that a device hostnet23 exists but seems no front end device exists. So what could be the problem? Thank you very much. /# virsh domiflist --inactive 4a365b06-2597-4c17-8b44-dbb6953f9ced Interface Type Source Model MAC ------------------------------------------------------------------------ tap1eca5838-d5 bridge qbr1eca5838-d5 virtio fa:16:3e:9b:1c:fd tap20318b8b-b5 bridge qbr20318b8b-b5 virtio fa:16:3e:e1:bc:58 tap43bab93f-9a bridge qbr43bab93f-9a virtio fa:16:3e:8f:1e:23 tap2b059179-d9 bridge qbr2b059179-d9 virtio fa:16:3e:4e:f9:47 tap1ec7cd98-1d bridge qbr1ec7cd98-1d virtio fa:16:3e:21:5b:e0 tap46c2470d-08 bridge qbr46c2470d-08 virtio fa:16:3e:33:68:19 tap0a402f8f-05 bridge qbr0a402f8f-05 virtio fa:16:3e:89:dd:c4 tap4e737f62-e2 bridge qbr4e737f62-e2 virtio fa:16:3e:1d:2a:1c tap024ec465-22 bridge qbr024ec465-22 virtio fa:16:3e:16:1c:df tapd17d320e-a5 bridge qbrd17d320e-a5 virtio fa:16:3e:08:bf:9f tapcef35fc7-40 bridge qbrcef35fc7-40 virtio fa:16:3e:d6:5b:bf tap83de3d8e-b5 bridge qbr83de3d8e-b5 virtio fa:16:3e:69:21:90 tap660a3bb9-17 bridge qbr660a3bb9-17 virtio fa:16:3e:b7:33:d3 tap35d08903-93 bridge qbr35d08903-93 virtio fa:16:3e:15:ce:a3 tap8e63ed74-2a bridge qbr8e63ed74-2a virtio fa:16:3e:0a:3f:a8 tapb61b097d-e8 bridge qbrb61b097d-e8 virtio fa:16:3e:f0:f9:da tap189d75de-ee bridge qbr189d75de-ee virtio fa:16:3e:be:98:9d tap7108158a-fe bridge qbr7108158a-fe virtio fa:16:3e:a2:8b:e8 tap38015662-f2 bridge qbr38015662-f2 virtio fa:16:3e:d2:45:fe tapcc37cd83-fc bridge qbrcc37cd83-fc virtio fa:16:3e:64:26:f8 tapaf3ccc2a-0c bridge qbraf3ccc2a-0c virtio fa:16:3e:d2:0a:99 # virsh domiflist 4a365b06-2597-4c17-8b44-dbb6953f9ced Interface Type Source Model MAC ------------------------------------------------------------------------ tap1eca5838-d5 bridge qbr1eca5838-d5 virtio fa:16:3e:9b:1c:fd tap20318b8b-b5 bridge qbr20318b8b-b5 virtio fa:16:3e:e1:bc:58 tap43bab93f-9a bridge qbr43bab93f-9a virtio fa:16:3e:8f:1e:23 tap2b059179-d9 bridge qbr2b059179-d9 virtio fa:16:3e:4e:f9:47 tap1ec7cd98-1d bridge qbr1ec7cd98-1d virtio fa:16:3e:21:5b:e0 tap46c2470d-08 bridge qbr46c2470d-08 virtio fa:16:3e:33:68:19 tap0a402f8f-05 bridge qbr0a402f8f-05 virtio fa:16:3e:89:dd:c4 tap4e737f62-e2 bridge qbr4e737f62-e2 virtio fa:16:3e:1d:2a:1c tap024ec465-22 bridge qbr024ec465-22 virtio fa:16:3e:16:1c:df tapd17d320e-a5 bridge qbrd17d320e-a5 virtio fa:16:3e:08:bf:9f tapcef35fc7-40 bridge qbrcef35fc7-40 virtio fa:16:3e:d6:5b:bf tap7ceb7a77-4d bridge qbr7ceb7a77-4d virtio fa:16:3e:c5:62:40 tap83de3d8e-b5 bridge qbr83de3d8e-b5 virtio fa:16:3e:69:21:90 tap660a3bb9-17 bridge qbr660a3bb9-17 virtio fa:16:3e:b7:33:d3 tap35d08903-93 bridge qbr35d08903-93 virtio fa:16:3e:15:ce:a3 tap8e63ed74-2a bridge qbr8e63ed74-2a virtio fa:16:3e:0a:3f:a8 tapb61b097d-e8 bridge qbrb61b097d-e8 virtio fa:16:3e:f0:f9:da tap189d75de-ee bridge qbr189d75de-ee virtio fa:16:3e:be:98:9d tap7108158a-fe bridge qbr7108158a-fe virtio fa:16:3e:a2:8b:e8 tap38015662-f2 bridge qbr38015662-f2 virtio fa:16:3e:d2:45:fe tapcc37cd83-fc bridge qbrcc37cd83-fc virtio fa:16:3e:64:26:f8 tapaf3ccc2a-0c bridge qbraf3ccc2a-0c virtio fa:16:3e:d2:0a:99 virsh # qemu-monitor-command --hmp 4a365b06-2597-4c17-8b44-dbb6953f9ced info network net0: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:9b:1c:fd \ hostnet0: index=0,type=tap,fd=40 net1: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:e1:bc:58 \ hostnet1: index=0,type=tap,fd=42 net5: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:8f:1e:23 \ hostnet5: index=0,type=tap,fd=52 net9: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:4e:f9:47 \ hostnet9: index=0,type=tap,fd=58 net15: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:21:5b:e0 \ hostnet15: index=0,type=tap,fd=262 net16: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:33:68:19 \ hostnet16: index=0,type=tap,fd=94 net17: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:89:dd:c4 \ hostnet17: index=0,type=tap,fd=108 net18: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:1d:2a:1c \ hostnet18: index=0,type=tap,fd=218 net19: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:16:1c:df \ hostnet19: index=0,type=tap,fd=226 net20: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:08:bf:9f \ hostnet20: index=0,type=tap,fd=234 net21: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:d6:5b:bf \ hostnet21: index=0,type=tap,fd=242 hostnet23: index=0,type=tap,fd=273 net25: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:69:21:90 \ hostnet25: index=0,type=tap,fd=289 net26: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:b7:33:d3 \ hostnet26: index=0,type=tap,fd=44 net27: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:15:ce:a3 \ hostnet27: index=0,type=tap,fd=73 net28: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:0a:3f:a8 \ hostnet28: index=0,type=tap,fd=102 net29: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:f0:f9:da \ hostnet29: index=0,type=tap,fd=185 net30: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:be:98:9d \ hostnet30: index=0,type=tap,fd=201 net31: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:a2:8b:e8 \ hostnet31: index=0,type=tap,fd=255 net32: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:d2:45:fe \ hostnet32: index=0,type=tap,fd=279 net33: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:64:26:f8 \ hostnet33: index=0,type=tap,fd=287 net34: index=0,type=nic,model=virtio-net-pci,macaddr=fa:16:3e:d2:0a:99 \ hostnet34: index=0,type=tap,fd=303 -- Best Regards, Jiatong Shen

On Thu, Nov 24, 2022 at 16:47:48 +0800, Jiatong Shen wrote:
Hello Commnunity,
I saw an weird situation on a phytium machine (arm64 v8), after the following commands, I can still see the interface which should be successfully detached.
virsh # detach-interface 4a365b06-2597-4c17-8b44-dbb6953f9ced bridge --mac fa:16:3e:c5:62:40 Interface detached successfully
Future qmp commands shows, that a device hostnet23 exists but seems no front end device exists.
So what could be the problem? Thank you very much.
The man page for virsh states for the 'detach-interface' command: "Please see documentation for detach-device for known quirks." And the 'quirks' part of 'detach-device': Quirk: Device unplug is asynchronous in most cases and requires guest cooperation. This means that it's up to the discretion of the guest to disallow or delay the unplug arbitrarily. As the libvirt API used in this command was designed as synchronous it returns success after some timeout even if the device was not unplugged yet to allow further in‐ teractions with the domain e.g. if the guest is unresponsive. Callers which need to make sure that the device was unplugged can use libvirt events (see virsh event) to be notified when the device is removed. Note that the event may arrive before the command returns.

Thank you very much for the reply. But the interesting thing is that qemu monitoring command info blocks returns the specified device has been detached while virsh domblklist still displays the device. So does this imply qemu does not reply to libvirt when the device is detached? Best, Jiatong Shen On Thu, Nov 24, 2022 at 10:58 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Thu, Nov 24, 2022 at 16:47:48 +0800, Jiatong Shen wrote:
Hello Commnunity,
I saw an weird situation on a phytium machine (arm64 v8), after the following commands, I can still see the interface which should be successfully detached.
virsh # detach-interface 4a365b06-2597-4c17-8b44-dbb6953f9ced bridge --mac fa:16:3e:c5:62:40 Interface detached successfully
Future qmp commands shows, that a device hostnet23 exists but seems no front end device exists.
So what could be the problem? Thank you very much.
The man page for virsh states for the 'detach-interface' command:
"Please see documentation for detach-device for known quirks."
And the 'quirks' part of 'detach-device':
Quirk: Device unplug is asynchronous in most cases and requires guest cooperation. This means that it's up to the discretion of the guest to disallow or delay the unplug arbitrarily. As the libvirt API used in this command was designed as synchronous it returns success after some timeout even if the device was not unplugged yet to allow further in‐ teractions with the domain e.g. if the guest is unresponsive. Callers which need to make sure that the device was unplugged can use libvirt events (see virsh event) to be notified when the device is removed. Note that the event may arrive before the command returns.
-- Best Regards, Jiatong Shen

Hello community, Sorry to bring this up again. I have found qemu monitor command qom-list returned and compare it with live configuration under /var/run (attached at the end). qom-list returns only one disk while current xml got two. I tried to restart libvirt container because I hope reconnect which calls qemuProcessUpdateDevices could fix current xml. But it does not. So my question is 1) should qemuProcessUpdateDevices remove gone devices from current configuration? 2) what could I do without reboot virtual machine? Thank you, Best, Jiatong Shen virsh # qemu-monitor-command instance-00000138 '{"execute": "qom-list", "arguments": {"path": "/machine/peripheral"}}' --pretty { "return": [ { "name": "virtio-serial0", "type": "child<virtio-serial-pci>" }, { "name": "type", "type": "string" }, { "name": "input0", "type": "child<usb-tablet>" }, { "name": "virtio-disk0", "type": "child<virtio-blk-pci>" }, { "name": "balloon0", "type": "child<virtio-balloon-pci>" }, { "name": "net1", "type": "child<virtio-net-pci>" }, { "name": "net0", "type": "child<virtio-net-pci>" }, { "name": "usb", "type": "child<piix3-usb-uhci>" }, { "name": "serial0", "type": "child<isa-serial>" }, { "name": "channel0", "type": "child<virtserialport>" }, { "name": "video0", "type": "child<cirrus-vga>" } ], "id": "libvirt-255" } <domstatus state='running' reason='booted' pid='2613967'> <taint flag='custom-monitor'/> <taint flag='custom-ga-command'/> <monitor path='/var/lib/libvirt/qemu/domain-111-instance-00000138/monitor.sock' type='unix'/> <vcpus> <vcpu id='0' pid='2614006'/> <vcpu id='1' pid='2614008'/> <vcpu id='2' pid='2614009'/> <vcpu id='3' pid='2614010'/> <vcpu id='4' pid='2614011'/> <vcpu id='5' pid='2614012'/> <vcpu id='6' pid='2614013'/> <vcpu id='7' pid='2614014'/> <vcpu id='8' pid='2614015'/> <vcpu id='9' pid='2614016'/> <vcpu id='10' pid='2614017'/> <vcpu id='11' pid='2614018'/> </vcpus> <qemuCaps> <flag name='kvm'/> <flag name='mem-path'/> <flag name='drive-serial'/> <flag name='monitor-json'/> <flag name='sdl'/> <flag name='netdev'/> <flag name='rtc'/> <flag name='vhost-net'/> <flag name='no-hpet'/> <flag name='no-kvm-pit'/> <flag name='nodefconfig'/> <flag name='boot-menu'/> <flag name='fsdev'/> <flag name='name-process'/> <flag name='smbios-type'/> <flag name='spice'/> <flag name='vga-none'/> <flag name='boot-index'/> <flag name='hda-duplex'/> <flag name='drive-aio'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> <flag name='chardev-spicevmc'/> <flag name='virtio-tx-alg'/> <flag name='pci-multifunction'/> <flag name='virtio-blk-pci.ioeventfd'/> <flag name='sga'/> <flag name='virtio-blk-pci.event_idx'/> <flag name='virtio-net-pci.event_idx'/> <flag name='cache-directsync'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> <flag name='ich9-usb-ehci1'/> <flag name='vt82c686b-usb-uhci'/> <flag name='pci-ohci'/> <flag name='usb-redir'/> <flag name='usb-hub'/> <flag name='no-shutdown'/> <flag name='cache-unsafe'/> <flag name='ich9-ahci'/> <flag name='no-acpi'/> <flag name='fsdev-readonly'/> <flag name='virtio-blk-pci.scsi'/> <flag name='drive-copy-on-read'/> <flag name='fsdev-writeout'/> <flag name='drive-iotune'/> <flag name='system_wakeup'/> <flag name='scsi-disk.channel'/> <flag name='scsi-block'/> <flag name='transaction'/> <flag name='block-job-async'/> <flag name='scsi-cd'/> <flag name='ide-cd'/> <flag name='no-user-config'/> <flag name='hda-micro'/> <flag name='dump-guest-memory'/> <flag name='nec-usb-xhci'/> <flag name='balloon-event'/> <flag name='bridge'/> <flag name='lsi'/> <flag name='virtio-scsi-pci'/> <flag name='blockio'/> <flag name='disable-s3'/> <flag name='disable-s4'/> <flag name='usb-redir.filter'/> <flag name='ide-drive.wwn'/> <flag name='scsi-disk.wwn'/> <flag name='seccomp-sandbox'/> <flag name='reboot-timeout'/> <flag name='dump-guest-core'/> <flag name='seamless-migration'/> <flag name='block-commit'/> <flag name='vnc'/> <flag name='drive-mirror'/> <flag name='usb-redir.bootindex'/> <flag name='usb-host.bootindex'/> <flag name='blockdev-snapshot-sync'/> <flag name='qxl'/> <flag name='VGA'/> <flag name='cirrus-vga'/> <flag name='vmware-svga'/> <flag name='device-video-primary'/> <flag name='usb-serial'/> <flag name='usb-net'/> <flag name='add-fd'/> <flag name='nbd-server'/> <flag name='virtio-rng'/> <flag name='rng-random'/> <flag name='rng-egd'/> <flag name='dtb'/> <flag name='megasas'/> <flag name='ipv6-migration'/> <flag name='machine-opt'/> <flag name='machine-usb-opt'/> <flag name='tpm-passthrough'/> <flag name='tpm-tis'/> <flag name='pci-bridge'/> <flag name='vfio-pci'/> <flag name='vfio-pci.bootindex'/> <flag name='scsi-generic'/> <flag name='scsi-generic.bootindex'/> <flag name='mem-merge'/> <flag name='vnc-websocket'/> <flag name='drive-discard'/> <flag name='mlock'/> <flag name='vnc-share-policy'/> <flag name='device-del-event'/> <flag name='dmi-to-pci-bridge'/> <flag name='i440fx-pci-hole64-size'/> <flag name='q35-pci-hole64-size'/> <flag name='usb-storage'/> <flag name='usb-storage.removable'/> <flag name='virtio-mmio'/> <flag name='ich9-intel-hda'/> <flag name='kvm-pit-lost-tick-policy'/> <flag name='boot-strict'/> <flag name='pvpanic'/> <flag name='spice-file-xfer-disable'/> <flag name='spiceport'/> <flag name='usb-kbd'/> <flag name='host-pci-multidomain'/> <flag name='msg-timestamp'/> <flag name='active-commit'/> <flag name='change-backing-file'/> <flag name='memory-backend-ram'/> <flag name='numa'/> <flag name='memory-backend-file'/> <flag name='usb-audio'/> <flag name='rtc-reset-reinjection'/> <flag name='splash-timeout'/> <flag name='iothread'/> <flag name='migrate-rdma'/> <flag name='ivshmem'/> <flag name='drive-iotune-max'/> <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='qxl.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='aes-key-wrap'/> <flag name='dea-key-wrap'/> <flag name='pci-serial'/> <flag name='vhost-user-multiqueue'/> <flag name='migration-event'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> <flag name='rtl8139'/> <flag name='e1000'/> <flag name='virtio-net'/> <flag name='gic-version'/> <flag name='incoming-defer'/> <flag name='virtio-gpu'/> <flag name='virtio-keyboard'/> <flag name='virtio-mouse'/> <flag name='virtio-tablet'/> <flag name='virtio-input-host'/> <flag name='chardev-file-append'/> <flag name='ich9-disable-s3'/> <flag name='ich9-disable-s4'/> <flag name='vserport-change-event'/> <flag name='virtio-balloon-pci.deflate-on-oom'/> <flag name='mptsas1068'/> <flag name='qxl.vram64_size_mb'/> <flag name='chardev-logfile'/> <flag name='debug-threads'/> <flag name='secret'/> <flag name='pxb'/> <flag name='pxb-pcie'/> <flag name='device-tray-moved-event'/> <flag name='nec-usb-xhci-ports'/> <flag name='virtio-scsi-pci.iothread'/> <flag name='name-guest'/> <flag name='qxl.max_outputs'/> <flag name='spice-unix'/> <flag name='drive-detect-zeroes'/> <flag name='tls-creds-x509'/> <flag name='display'/> <flag name='intel-iommu'/> <flag name='smm'/> <flag name='virtio-pci-disable-legacy'/> <flag name='query-hotpluggable-cpus'/> <flag name='virtio-net.rx_queue_size'/> <flag name='virtio-vga'/> <flag name='drive-iotune-max-length'/> <flag name='ivshmem-plain'/> <flag name='ivshmem-doorbell'/> <flag name='query-qmp-schema'/> <flag name='gluster.debug_level'/> <flag name='vhost-scsi'/> <flag name='drive-iotune-group'/> <flag name='query-cpu-model-expansion'/> <flag name='virtio-net.host_mtu'/> <flag name='nvdimm'/> <flag name='pcie-root-port'/> <flag name='query-cpu-definitions'/> <flag name='block-write-threshold'/> <flag name='query-named-block-nodes'/> <flag name='cpu-cache'/> <flag name='qemu-xhci'/> <flag name='kernel-irqchip'/> <flag name='kernel-irqchip.split'/> <flag name='intel-iommu.intremap'/> <flag name='intel-iommu.caching-mode'/> <flag name='intel-iommu.eim'/> <flag name='intel-iommu.device-iotlb'/> <flag name='virtio.iommu_platform'/> <flag name='virtio.ats'/> <flag name='loadparm'/> <flag name='vnc-multi-servers'/> <flag name='virtio-net.tx_queue_size'/> <flag name='chardev-reconnect'/> <flag name='virtio-gpu.max_outputs'/> <flag name='vxhs'/> <flag name='virtio-blk.num-queues'/> <flag name='vmcoreinfo'/> <flag name='numa.dist'/> <flag name='disk-share-rw'/> <flag name='iscsi.password-secret'/> <flag name='isa-serial'/> </qemuCaps> <devices> <device alias='virtio-serial0'/> <device alias='input0'/> <device alias='virtio-disk0'/> <device alias='balloon0'/> <device alias='net1'/> <device alias='net0'/> <device alias='usb'/> <device alias='serial0'/> <device alias='channel0'/> <device alias='video0'/> </devices> <libDir path='/var/lib/libvirt/qemu/domain-111-instance-00000138'/> <channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-111-instance-00000138'/> <allowReboot value='yes'/> <blockjobs active='no'/> <agentTimeout>-2</agentTimeout> <domain type='kvm' id='111'> <name>instance-00000138</name> <uuid>0b985bed-ebdd-4334-9477-19a5dab70eb1</uuid> <metadata> <nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0 "> <nova:package version="18.2.3"/> <nova:name>VSA</nova:name> <nova:creationTime>2020-09-08 01:12:58</nova:creationTime> <nova:flavor name="ecs_12C64G200G"> <nova:memory>65536</nova:memory> <nova:disk>200</nova:disk> <nova:swap>0</nova:swap> <nova:ephemeral>0</nova:ephemeral> <nova:vcpus>12</nova:vcpus> </nova:flavor> <nova:owner> <nova:user uuid="9ec899ea3a4144dcbc6dccacc1e36645">admin</nova:user> <nova:project uuid="f689fa41de3641cb8e4a98046268aa48">HBS</nova:project> </nova:owner> </nova:instance> </metadata> <memory unit='KiB'>67108864</memory> <currentMemory unit='KiB'>67108864</currentMemory> <vcpu placement='static'>12</vcpu> <cputune> <shares>12288</shares> </cputune> <resource> <partition>/machine</partition> </resource> <sysinfo type='smbios'> <system> <entry name='manufacturer'>OpenStack Foundation</entry> <entry name='product'>OpenStack Nova</entry> <entry name='version'>18.2.3</entry> <entry name='uuid'>0b985bed-ebdd-4334-9477-19a5dab70eb1</entry> <entry name='family'>Virtual Machine</entry> </system> </sysinfo> <os> <type arch='x86_64' machine='pc-i440fx-bionic'>hvm</type> <boot dev='hd'/> <smbios mode='sysinfo'/> </os> <features> <acpi/> <apic/> <hyperv> <relaxed state='on'/> <vapic state='on'/> <spinlocks state='on' retries='8191'/> </hyperv> </features> <cpu mode='custom' match='exact' check='full'> <model fallback='forbid'>Skylake-Client-IBRS</model> <vendor>Intel</vendor> <topology sockets='12' cores='1' threads='1'/> <feature policy='require' name='ss'/> <feature policy='require' name='hypervisor'/> <feature policy='require' name='tsc_adjust'/> <feature policy='require' name='md-clear'/> <feature policy='require' name='ssbd'/> <feature policy='require' name='pdpe1gb'/> <feature policy='disable' name='mpx'/> <feature policy='disable' name='xsavec'/> <feature policy='disable' name='xgetbv1'/> </cpu> <clock offset='localtime'> <timer name='pit' tickpolicy='delay'/> <timer name='rtc' tickpolicy='catchup'/> <timer name='hpet' present='no'/> <timer name='hypervclock' present='yes'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <disk type='network' device='disk'> <driver name='qemu' type='raw' cache='writeback' discard='unmap'/> <auth username='cinder_eafdd9d8-8fe3-40d1-8fbe-fc81f96f1fd6'> <secret type='ceph' uuid='eafdd9d8-8fe3-40d1-8fbe-fc81f96f1fd6'/> </auth> <source protocol='rbd' name='' tlsFromConfig='0'> <privateData> <nodenames> <nodename type='storage' name='#block034'/> <nodename type='format' name='#block104'/> </nodenames> <objects> <secret type='auth' alias='virtio-disk0-secret0'/> </objects> </privateData> </source> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <disk type='network' device='disk'> <driver name='qemu' type='raw' cache='writeback' discard='unmap'/> <auth username='cinder_eafdd9d8-8fe3-40d1-8fbe-fc81f96f1fd6'> <secret type='ceph' uuid='eafdd9d8-8fe3-40d1-8fbe-fc81f96f1fd6'/> </auth> <source protocol='rbd' name='cinder.volumes' tlsFromConfig='0'> <privateData> <objects> <secret type='auth' alias='virtio-disk7-secret0'/> </objects> </privateData> </source> <target dev='vdh' bus='virtio'/> <alias name='virtio-disk7'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/> </disk> <controller type='usb' index='0' model='piix3-uhci'> <alias name='usb'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <controller type='pci' index='0' model='pci-root'> <alias name='pci.0'/> </controller> <controller type='virtio-serial' index='0'> <alias name='virtio-serial0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </controller> <interface type='bridge'> <mac address='fa:16:3e:40:1a:19'/> <source bridge='qbrfbca49dd-ad'/> <target dev='tapfbca49dd-ad'/> <model type='virtio'/> <mtu size='1550'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <interface type='bridge'> <mac address='fa:16:3e:11:ee:66'/> <source bridge='qbrdb246b9f-79'/> <target dev='tapdb246b9f-79'/> <model type='virtio'/> <mtu size='1500'/> <alias name='net1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </interface> <serial type='pty'> <source path='/dev/pts/11'/> <log file='/var/lib/nova/instances/0b985bed-ebdd-4334-9477-19a5dab70eb1/console.log' append='off'/> <target type='isa-serial' port='0'> <model name='isa-serial'/> </target> <alias name='serial0'/> </serial> <console type='pty' tty='/dev/pts/11'> <source path='/dev/pts/11'/> <log file='/var/lib/nova/instances/0b985bed-ebdd-4334-9477-19a5dab70eb1/console.log' append='off'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/org.qemu.guest_agent.0.instance-00000138.sock'/> <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/> <alias name='channel0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> <input type='tablet' bus='usb'> <alias name='input0'/> <address type='usb' bus='0' port='1'/> </input> <input type='mouse' bus='ps2'> <alias name='input1'/> </input> <input type='keyboard' bus='ps2'> <alias name='input2'/> </input> <graphics type='vnc' port='5911' autoport='yes' websocketGenerated='no' listen='0.0.0.0'> <listen type='address' address='0.0.0.0' fromConfig='0' autoGenerated='no'/> </graphics> <video> <model type='cirrus' vram='16384' heads='1' primary='yes'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <stats period='10'/> <alias name='balloon0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </memballoon> </devices> <seclabel type='dynamic' model='dac' relabel='yes'> <label>+42424:+104</label> <imagelabel>+42424:+104</imagelabel> </seclabel> </domain> </domstatus> On Mon, Nov 28, 2022 at 4:43 PM Jiatong Shen <yshxxsjt715@gmail.com> wrote:
Thank you very much for the reply. But the interesting thing is that qemu monitoring command info blocks returns the specified device has been detached while virsh domblklist still displays the device. So does this imply qemu does not reply to libvirt when the device is detached?
Best, Jiatong Shen
On Thu, Nov 24, 2022 at 10:58 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Thu, Nov 24, 2022 at 16:47:48 +0800, Jiatong Shen wrote:
Hello Commnunity,
I saw an weird situation on a phytium machine (arm64 v8), after the following commands, I can still see the interface which should be successfully detached.
virsh # detach-interface 4a365b06-2597-4c17-8b44-dbb6953f9ced bridge --mac fa:16:3e:c5:62:40 Interface detached successfully
Future qmp commands shows, that a device hostnet23 exists but seems no front end device exists.
So what could be the problem? Thank you very much.
The man page for virsh states for the 'detach-interface' command:
"Please see documentation for detach-device for known quirks."
And the 'quirks' part of 'detach-device':
Quirk: Device unplug is asynchronous in most cases and requires guest cooperation. This means that it's up to the discretion of the guest to disallow or delay the unplug arbitrarily. As the libvirt API used in this command was designed as synchronous it returns success after some timeout even if the device was not unplugged yet to allow further in‐ teractions with the domain e.g. if the guest is unresponsive. Callers which need to make sure that the device was unplugged can use libvirt events (see virsh event) to be notified when the device is removed. Note that the event may arrive before the command returns.
--
Best Regards,
Jiatong Shen
-- Best Regards, Jiatong Shen
participants (2)
-
Jiatong Shen
-
Peter Krempa