Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1518527 - Disk with pci-bridge disappear after hotplug
Summary: Disk with pci-bridge disappear after hotplug
Keywords:
Status: CLOSED DUPLICATE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.5
Hardware: ppc64le
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-29 07:01 UTC by Junxiang Li
Modified: 2017-12-04 11:24 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-04 11:24:08 UTC


Attachments (Terms of Use)
log about attach (deleted)
2017-12-01 03:03 UTC, Junxiang Li
no flags Details

Description Junxiang Li 2017-11-29 07:01:07 UTC
Description of problem:
Disk with pci-bridge disappear after hotplug

Version-Release number of selected component (if applicable):
# rpm -q qemu-kvm-rhev libvirt kernel
qemu-kvm-rhev-2.10.0-8.el7.ppc64le
libvirt-3.9.0-3.virtcov.el7.ppc64le
kernel-3.10.0-796.el7.ppc64le

How reproducible:
100%

Steps to Reproduce:
1. Prepare
(1) create a raw type disk as following:
qemu-img create -f raw /var/tmp/libvirt-ci/runtest/avocado-vt/avocado-vt/shared/disk1.raw 1.0G
(2) prepare a guest xml:
************************
<domain type="kvm" id="2">
<name>avocado-vt-vm1</name>
<uuid>224f889b-a087-4118-a15f-b9d0a26c2f94</uuid>
<memory unit="KiB">1048576</memory>
<currentMemory unit="KiB">1048576</currentMemory>
<vcpu placement="static">2</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch="ppc64le" machine="pseries-rhel7.5.0">hvm</type>
<boot dev="hd"/>
</os>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/var/lib/avocado/data/avocado-vt/images/jeos-25-64.qcow2"/>
<backingStore/>
<target dev="vda" bus="virtio"/>
<alias name="virtio-disk0"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
</disk>
<controller type="usb" index="0" model="qemu-xhci">
<alias name="usb"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
</controller>
<controller type="virtio-serial" index="0">
<alias name="virtio-serial0"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/>
</controller>
<controller type="pci" index="1" model="pci-bridge">
<model name="pci-bridge"/>
<target chassisNr="1"/>
<alias name="pci.1"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x0a" function="0x0"/>
</controller>
<controller type="pci" index="0" model="pci-root">
<model name="spapr-pci-host-bridge"/>
<target index="0"/>
<alias name="pci.0"/>
</controller>
<interface type="bridge">
<mac address="52:54:00:3f:30:8a"/>
<source bridge="virbr0"/>
<target dev="vnet0"/>
<model type="virtio"/>
<alias name="net0"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</interface>
<serial type="pty">
<source path="/dev/pts/2"/>
<target port="0"/>
<alias name="serial0"/>
<address type="spapr-vio" reg="0x30000000"/>
</serial>
<console type="pty" tty="/dev/pts/2">
<source path="/dev/pts/2"/>
<target type="serial" port="0"/>
<alias name="serial0"/>
<address type="spapr-vio" reg="0x30000000"/>
</console>
<channel type="unix">
<source mode="bind" path="/var/lib/libvirt/qemu/channel/target/domain-2-avocado-vt-vm1/org.qemu.guest_agent.0"/>
<target type="virtio" name="org.qemu.guest_agent.0" state="connected"/>
<alias name="channel0"/>
<address type="virtio-serial" controller="0" bus="0" port="1"/>
</channel>
<input type="keyboard" bus="usb">
<alias name="input0"/>
<address type="usb" bus="0" port="1"/>
</input>
<input type="mouse" bus="usb">
<alias name="input1"/>
<address type="usb" bus="0" port="2"/>
</input>
<graphics type="vnc" port="5900" autoport="yes" listen="127.0.0.1">
<listen type="address" address="127.0.0.1"/>
</graphics>
<video>
<model type="vga" vram="16384" heads="1" primary="yes"/>
<alias name="video0"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x0"/>
</video>
<memballoon model="virtio">
<alias name="balloon0"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0"/>
</memballoon>
<panic model="pseries"/>
</devices>
<seclabel type="dynamic" model="selinux" relabel="yes">
<label>system_u:system_r:svirt_t:s0:c195,c524</label>
<imagelabel>system_u:object_r:svirt_image_t:s0:c195,c524</imagelabel>
</seclabel>
<seclabel type="dynamic" model="dac" relabel="yes">
<label>+107:+107</label>
<imagelabel>+107:+107</imagelabel>
</seclabel>
</domain>
************************
(3) prepare a disk xml:

<disk device="disk" type="file">
<source file="/var/tmp/libvirt-ci/runtest/avocado-vt/avocado-vt/shared/disk1.raw"/>
<target bus="virtio" dev="vdb"/>
<driver name="qemu"/>
<address bus="0x01" domain="0x0000" function="0x0" slot="0x0a" type="pci"/>
</disk>

2. Define and start the guest
3. Attach the disk to guest as following:
# virsh attach-device avocado-vt-vm1 hhhh.xml
4. The attach result is:
Device attached successfully

5. Then you must very *quickly* to run:
# virsh dumpxml avocado-vt-vm1
6. The disk appear in xml like following:

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/tmp/libvirt-ci/runtest/avocado-vt/avocado-vt/shared/disk1.raw'/>
      <backingStore/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x0a' function='0x0'/>
    </disk>

7. But after running the dumpxml several times

Actual results:
The disk still exist in the xml.

Expected results:
The disk disappear.

Additional info:

Comment 2 Peter Krempa 2017-11-29 08:33:37 UTC
Are the "actual" and "Expected" results swapped?

Comment 3 Qunfang Zhang 2017-11-29 08:43:15 UTC
There's also some qemu-kvm-rhev issue as:

Bug 1436549 - [ppc64le] Cannot hotplug PCI devices under P2P bridges
Bug 1432891 - The device hot pluged to pci-bridge doesn't show up

Comment 4 Peter Krempa 2017-11-29 09:14:10 UTC
Also, could you please attach debug logs from the libvirt-qemu interaction?

Comment 5 Junxiang Li 2017-11-29 09:22:11 UTC
(In reply to Peter Krempa from comment #4)
> Also, could you please attach debug logs from the libvirt-qemu interaction?

It looks like due to bug 1436549, so do you still need logs or close this bug as as a duplicate of bug1436549

Comment 6 Peter Krempa 2017-11-29 13:02:59 UTC
Just check please wheteher qemu delivered a DEVICE_DELETED event to libvirt after the hotplug, which would trigger the removal of the device from the XML.

In such case it's not really a libvirt bug.

Comment 7 Junxiang Li 2017-12-01 03:03:44 UTC
Created attachment 1361397 [details]
log about attach

As your said, qemu delivered the DEVICE_DELETED event.

Comment 8 Jaroslav Suchanek 2017-12-04 11:24:08 UTC
Closing as dup of bug 1436549, per comment 5 and comment 7.

*** This bug has been marked as a duplicate of bug 1436549 ***


Note You need to log in before you can comment on or make changes to this bug.