Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1375508

Summary: Code10 error with virtio block device when hotplug device to the pci-bridge
Product: Red Hat Enterprise Linux 7 Reporter: jingzhao <jinzhao>
Component: qemu-kvm-rhevAssignee: Vadim Rozenfeld <vrozenfe>
Status: CLOSED CURRENTRELEASE QA Contact: yduan
Severity: high Docs Contact:
Priority: high    
Version: 7.3CC: ailan, chayang, jinzhao, juzhang, knoel, lijin, mtessun, virt-maint, vrozenfe, yduan
Target Milestone: rc   
Target Release: 7.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-28 02:45:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1401400, 1558351    
Attachments:
Description Flags
screenshot
none
setupapi.dev
none
setupapi.setup none

Description jingzhao 2016-09-13 09:31:58 UTC
Created attachment 1200427 [details]
screenshot

Description of problem:
Code10 error with virtio block device when hotplug device to the pci-bridge

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.6.0-23.el7.x86_64
host kernel:3.10.0-503.el7.x86_64
guest win10.64 bit
virtio-win:virtio-win-prewhql-0.1-126

How reproducible:
3/3

Steps to Reproduce:
1.Boot guest with following command:
/usr/libexec/qemu-kvm \
-M pc \
-cpu SandyBridge \
-nodefaults -rtc base=utc \
-m 4G \
-smp 2,sockets=2,cores=1,threads=1 \
-enable-kvm \
-name rhel7.3 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-nodefaults \
-serial unix:/tmp/serial0,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-chardev file,path=/home/pci-bridge/seabios.log,id=seabios \
-device isa-debugcon,chardev=seabios,iobase=0x402 \
-qmp tcp:0:6666,server,nowait \
-device pci-bridge,bus=pci.0,id=bridge0,chassis_nr=1 \
-drive file=/home/pci-bridge/win10.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,bus=bridge0,addr=0x1 \
-device virtio-net-pci,netdev=tap10,mac=9a:6a:6b:6c:6d:6e,bus=bridge0,addr=0x2 -netdev tap,id=tap10 \
-device VGA,id=video \
-vnc :2 \
-device pci-bridge,bus=pci.0,id=bridge1,chassis_nr=2 \
-device nec-usb-xhci,id=xhci0,bus=bridge1,addr=0x1 \
-device pci-bridge,bus=pci.0,id=bridge2,chassis_nr=3 \
-device pci-bridge,bus=pci.0,id=bridge3,chassis_nr=4 \
-device pci-bridge,bus=pci.0,id=bridge4,chassis_nr=5 \
-device pci-bridge,bus=pci.0,id=bridge5,chassis_nr=6 \
-device pci-bridge,bus=pci.0,id=bridge6,chassis_nr=6 \
-device pci-bridge,bus=pci.0,id=bridge7,chassis_nr=7 \
-monitor stdio \
/usr/libexec/qemu-kvm \
-M pc \
-cpu SandyBridge \
-nodefaults -rtc base=utc \
-m 4G \
-smp 2,sockets=2,cores=1,threads=1 \
-enable-kvm \
-name rhel7.3 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-nodefaults \
-serial unix:/tmp/serial0,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-chardev file,path=/home/pci-bridge/seabios.log,id=seabios \
-device isa-debugcon,chardev=seabios,iobase=0x402 \
-qmp tcp:0:6666,server,nowait \
-device pci-bridge,bus=pci.0,id=bridge0,chassis_nr=1 \
-drive file=/home/pci-bridge/win10.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,bus=bridge0,addr=0x1 \
-device virtio-net-pci,netdev=tap10,mac=9a:6a:6b:6c:6d:6e,bus=bridge0,addr=0x2 -netdev tap,id=tap10 \
-device VGA,id=video \
-vnc :2 \
-device pci-bridge,bus=pci.0,id=bridge1,chassis_nr=2 \
-device nec-usb-xhci,id=xhci0,bus=bridge1,addr=0x1 \
-device pci-bridge,bus=pci.0,id=bridge2,chassis_nr=3 \
-device pci-bridge,bus=pci.0,id=bridge3,chassis_nr=4 \
-device pci-bridge,bus=pci.0,id=bridge4,chassis_nr=5 \
-device pci-bridge,bus=pci.0,id=bridge5,chassis_nr=6 \
-device pci-bridge,bus=pci.0,id=bridge6,chassis_nr=6 \
-device pci-bridge,bus=pci.0,id=bridge7,chassis_nr=7 \
-monitor stdio \
-drive file=/home/virtio-win.iso,if=none,id=ide1,format=raw,media=cdrom \
-device ide-drive,bus=ide.0,unit=0,drive=ide1,id=ide1 \

2.Hot plug virtio block disk to pci bridge
{"execute":"__com.redhat_drive_add", "arguments": {"file":"/home/pci-bridge/block1.qcow2","format":"qcow2","id":"test1"}}
{"return": {}}
{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"test1","id":"test1","bus":"bridge3","addr":"0x1"}}
{"return": {}}

(qemu) info block
drive-virtio-disk0 (#block190): /home/pci-bridge/win10.qcow2 (qcow2)
    Cache mode:       writeback, direct

ide1 (#block396): /home/virtio-win.iso (raw, read-only)
    Removable device: not locked, tray closed
    Cache mode:       writeback

test1 (#block567): /home/pci-bridge/block1.qcow2 (qcow2)
    Cache mode:       writeback

3. Then stop and cont guest on hmp
(qemu) stop
(qemu) info status
VM status: paused
(qemu) cont

4. Then hot plug another disk to pci-bridge

{"execute":"__com.redhat_drive_add", "arguments": {"file":"/home/pci-bridge/test.raw","format":"raw","id":"drive_datadisk0"}}
{"return": {}}
{"execute":"device_add","arguments":{"driver":"virtio-scsi-pci","id":"scsi1","bus":"bridge2","addr":"0x1"}}
{"return": {}}
{"execute":"device_add","arguments":{"driver":"scsi-hd","drive":"drive_datadisk0","id":"device_datadisk0","bus":"scsi1.0"}}
{"return": {}}

check the info on hmp:
(qemu) info block
drive-virtio-disk0 (#block151): /home/pci-bridge/win10.qcow2 (qcow2)
    Cache mode:       writeback, direct

ide1 (#block384): /home/virtio-win.iso (raw, read-only)
    Removable device: not locked, tray closed
    Cache mode:       writeback

test1 (#block566): /home/pci-bridge/block1.qcow2 (qcow2)
    Cache mode:       writeback

drive_datadisk0 (#block773): /home/pci-bridge/test.raw (raw)
    Cache mode:       writeback


Actual results:
Guest didn't be found in the guest and found the code 10 error on the vritio block disk driver, please check the screenshot 

Expected results:
No code 10 error and disk can be found in the guest


Additional info:
Didn't reproduce on qemu-kvm-rhev-2.6.0-23.el7.x86_64 + virtio-win-1.8.0-4.el7_2.1
Didn't reproduce on qemu-kvm-rhev-2.3.0-31.el7_2.21.x86_64 + virtio-win-prewhql-0.1-126

Comment 1 jingzhao 2016-09-13 09:48:38 UTC
Add "Regression" keyword, but I am not sure it's the virtio-win driver issue or qemu issue

Comment 3 Vadim Rozenfeld 2016-09-14 01:31:53 UTC
Can you please dump pci data with qemu monitor command "info pci" after steps 1,2,3, and 4 respectively, as well as provide contents of setupapi.dev.log file?

Thanks,
Vadim.

Comment 4 jingzhao 2016-09-14 05:09:06 UTC
(In reply to Vadim Rozenfeld from comment #3)
> Can you please dump pci data with qemu monitor command "info pci" after
> steps 1,2,3, and 4 respectively, as well as provide contents of
> setupapi.dev.log file?
> 
> Thanks,
> Vadim.

Update the info:
After step1:
(qemu) info pci
  Bus  0, device   0, function 0:
    Host bridge: PCI device 8086:1237
      id ""
  Bus  0, device   1, function 0:
    ISA bridge: PCI device 8086:7000
      id ""
  Bus  0, device   1, function 1:
    IDE controller: PCI device 8086:7010
      BAR4: I/O at 0x9000 [0x900f].
      id ""
  Bus  0, device   1, function 3:
    Bridge: PCI device 8086:7113
      IRQ 9.
      id ""
  Bus  0, device   2, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 1.
      subordinate bus 1.
      IO range [0x8000, 0x8fff]
      memory range [0xfe800000, 0xfe9fffff]
      prefetchable memory range [0xfb000000, 0xfbffffff]
      BAR0: 64 bit memory at 0xfea10000 [0xfea100ff].
      id "bridge0"
  Bus  1, device   1, function 0:
    SCSI controller: PCI device 1af4:1001
      IRQ 0.
      BAR0: I/O at 0x8000 [0x803f].
      BAR1: 32 bit memory at 0xfe840000 [0xfe840fff].
      BAR4: 64 bit prefetchable memory at 0xfb000000 [0xfb7fffff].
      id "virtio-disk0"
  Bus  1, device   2, function 0:
    Ethernet controller: PCI device 1af4:1000
      IRQ 0.
      BAR0: I/O at 0x8040 [0x805f].
      BAR1: 32 bit memory at 0xfe841000 [0xfe841fff].
      BAR4: 64 bit prefetchable memory at 0xfb800000 [0xfbffffff].
      BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].
      id ""
  Bus  0, device   3, function 0:
    VGA controller: PCI device 1234:1111
      BAR0: 32 bit prefetchable memory at 0xfa000000 [0xfaffffff].
      BAR2: 32 bit memory at 0xfea11000 [0xfea11fff].
      BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe].
      id "video"
  Bus  0, device   4, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 11.
      BUS 0.
      secondary bus 2.
      subordinate bus 2.
      IO range [0x7000, 0x7fff]
      memory range [0xfe600000, 0xfe7fffff]
      prefetchable memory range [0xfcc00000, 0xfcdfffff]
      BAR0: 64 bit memory at 0xfea12000 [0xfea120ff].
      id "bridge1"
  Bus  2, device   1, function 0:
    USB controller: PCI device 1033:0194
      IRQ 0.
      BAR0: 64 bit memory at 0xfe600000 [0xfe603fff].
      id "xhci0"
  Bus  0, device   5, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 3.
      subordinate bus 3.
      IO range [0x6000, 0x6fff]
      memory range [0xfe400000, 0xfe5fffff]
      prefetchable memory range [0xfca00000, 0xfcbfffff]
      BAR0: 64 bit memory at 0xfea13000 [0xfea130ff].
      id "bridge2"
  Bus  0, device   6, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 4.
      subordinate bus 4.
      IO range [0x5000, 0x5fff]
      memory range [0xfe200000, 0xfe3fffff]
      prefetchable memory range [0xfc800000, 0xfc9fffff]
      BAR0: 64 bit memory at 0xfea14000 [0xfea140ff].
      id "bridge3"
  Bus  0, device   7, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 11.
      BUS 0.
      secondary bus 5.
      subordinate bus 5.
      IO range [0x4000, 0x4fff]
      memory range [0xfe000000, 0xfe1fffff]
      prefetchable memory range [0xfc600000, 0xfc7fffff]
      BAR0: 64 bit memory at 0xfea15000 [0xfea150ff].
      id "bridge4"
  Bus  0, device   8, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 11.
      BUS 0.
      secondary bus 6.
      subordinate bus 6.
      IO range [0x3000, 0x3fff]
      memory range [0xfde00000, 0xfdffffff]
      prefetchable memory range [0xfc400000, 0xfc5fffff]
      BAR0: 64 bit memory at 0xfea16000 [0xfea160ff].
      id "bridge5"
  Bus  0, device   9, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 7.
      subordinate bus 7.
      IO range [0x2000, 0x2fff]
      memory range [0xfdc00000, 0xfddfffff]
      prefetchable memory range [0xfc200000, 0xfc3fffff]
      BAR0: 64 bit memory at 0xfea17000 [0xfea170ff].
      id "bridge6"
  Bus  0, device  10, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 8.
      subordinate bus 8.
      IO range [0x1000, 0x1fff]
      memory range [0xfda00000, 0xfdbfffff]
      prefetchable memory range [0xfc000000, 0xfc1fffff]
      BAR0: 64 bit memory at 0xfea18000 [0xfea180ff].
      id "bridge7"
After step2:
(qemu) info block
drive-virtio-disk0 (#block160): /home/pci-bridge/win10-1.qcow2 (qcow2)
    Cache mode:       writeback, direct

ide1 (#block349): /home/virtio-win.iso (raw, read-only)
    Removable device: not locked, tray closed
    Cache mode:       writeback

test1 (#block584): /home/pci-bridge/block1.qcow2 (qcow2)
    Cache mode:       writeback
(qemu) info pci
  Bus  0, device   0, function 0:
    Host bridge: PCI device 8086:1237
      id ""
  Bus  0, device   1, function 0:
    ISA bridge: PCI device 8086:7000
      id ""
  Bus  0, device   1, function 1:
    IDE controller: PCI device 8086:7010
      BAR4: I/O at 0x9000 [0x900f].
      id ""
  Bus  0, device   1, function 3:
    Bridge: PCI device 8086:7113
      IRQ 9.
      id ""
  Bus  0, device   2, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 1.
      subordinate bus 1.
      IO range [0x8000, 0x8fff]
      memory range [0xfe800000, 0xfe9fffff]
      prefetchable memory range [0xfb000000, 0xfbffffff]
      BAR0: 64 bit memory at 0xfea10000 [0xfea100ff].
      id "bridge0"
  Bus  1, device   1, function 0:
    SCSI controller: PCI device 1af4:1001
      IRQ 0.
      BAR0: I/O at 0x8000 [0x803f].
      BAR1: 32 bit memory at 0xfe840000 [0xfe840fff].
      BAR4: 64 bit prefetchable memory at 0xfb000000 [0xfb7fffff].
      id "virtio-disk0"
  Bus  1, device   2, function 0:
    Ethernet controller: PCI device 1af4:1000
      IRQ 0.
      BAR0: I/O at 0x8040 [0x805f].
      BAR1: 32 bit memory at 0xfe841000 [0xfe841fff].
      BAR4: 64 bit prefetchable memory at 0xfb800000 [0xfbffffff].
      BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].
      id ""
  Bus  0, device   3, function 0:
    VGA controller: PCI device 1234:1111
      BAR0: 32 bit prefetchable memory at 0xfa000000 [0xfaffffff].
      BAR2: 32 bit memory at 0xfea11000 [0xfea11fff].
      BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe].
      id "video"
  Bus  0, device   4, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 11.
      BUS 0.
      secondary bus 2.
      subordinate bus 2.
      IO range [0x7000, 0x7fff]
      memory range [0xfe600000, 0xfe7fffff]
      prefetchable memory range [0xfcc00000, 0xfcdfffff]
      BAR0: 64 bit memory at 0xfea12000 [0xfea120ff].
      id "bridge1"
  Bus  2, device   1, function 0:
    USB controller: PCI device 1033:0194
      IRQ 0.
      BAR0: 64 bit memory at 0xfe600000 [0xfe603fff].
      id "xhci0"
  Bus  0, device   5, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 3.
      subordinate bus 3.
      IO range [0x6000, 0x6fff]
      memory range [0xfe400000, 0xfe5fffff]
      prefetchable memory range [0xfca00000, 0xfcbfffff]
      BAR0: 64 bit memory at 0xfea13000 [0xfea130ff].
      id "bridge2"
  Bus  0, device   6, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 4.
      subordinate bus 4.
      IO range [0x5000, 0x5fff]
      memory range [0xfe200000, 0xfe3fffff]
      prefetchable memory range [0xfd000000, 0xfd7fffff]
      BAR0: 64 bit memory at 0xfea14000 [0xfea140ff].
      id "bridge3"
  Bus  4, device   1, function 0:
    SCSI controller: PCI device 1af4:1001
      IRQ 0.
      BAR0: I/O at 0x5fc0 [0x5fff].
      BAR1: 32 bit memory at 0xfe3ff000 [0xfe3fffff].
      BAR4: 64 bit prefetchable memory at 0xfd000000 [0xfd7fffff].
      id "test1"
  Bus  0, device   7, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 11.
      BUS 0.
      secondary bus 5.
      subordinate bus 5.
      IO range [0x4000, 0x4fff]
      memory range [0xfe000000, 0xfe1fffff]
      prefetchable memory range [0xfc600000, 0xfc7fffff]
      BAR0: 64 bit memory at 0xfea15000 [0xfea150ff].
      id "bridge4"
  Bus  0, device   8, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 11.
      BUS 0.
      secondary bus 6.
      subordinate bus 6.
      IO range [0x3000, 0x3fff]
      memory range [0xfde00000, 0xfdffffff]
      prefetchable memory range [0xfc400000, 0xfc5fffff]
      BAR0: 64 bit memory at 0xfea16000 [0xfea160ff].
      id "bridge5"
  Bus  0, device   9, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 7.
      subordinate bus 7.
      IO range [0x2000, 0x2fff]
      memory range [0xfdc00000, 0xfddfffff]
      prefetchable memory range [0xfc200000, 0xfc3fffff]
      BAR0: 64 bit memory at 0xfea17000 [0xfea170ff].
      id "bridge6"
  Bus  0, device  10, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 8.
      subordinate bus 8.
      IO range [0x1000, 0x1fff]
      memory range [0xfda00000, 0xfdbfffff]
      prefetchable memory range [0xfc000000, 0xfc1fffff]
      BAR0: 64 bit memory at 0xfea18000 [0xfea180ff].
      id "bridge7"
(qemu) stop
(qemu) info status
VM status: paused
(qemu) cont
(qemu) info status
VM status: running

After step4:
(qemu) info pci
  Bus  0, device   0, function 0:
    Host bridge: PCI device 8086:1237
      id ""
  Bus  0, device   1, function 0:
    ISA bridge: PCI device 8086:7000
      id ""
  Bus  0, device   1, function 1:
    IDE controller: PCI device 8086:7010
      BAR4: I/O at 0x9000 [0x900f].
      id ""
  Bus  0, device   1, function 3:
    Bridge: PCI device 8086:7113
      IRQ 9.
      id ""
  Bus  0, device   2, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 1.
      subordinate bus 1.
      IO range [0x8000, 0x8fff]
      memory range [0xfe800000, 0xfe9fffff]
      prefetchable memory range [0xfb000000, 0xfbffffff]
      BAR0: 64 bit memory at 0xfea10000 [0xfea100ff].
      id "bridge0"
  Bus  1, device   1, function 0:
    SCSI controller: PCI device 1af4:1001
      IRQ 0.
      BAR0: I/O at 0x8000 [0x803f].
      BAR1: 32 bit memory at 0xfe840000 [0xfe840fff].
      BAR4: 64 bit prefetchable memory at 0xfb000000 [0xfb7fffff].
      id "virtio-disk0"
  Bus  1, device   2, function 0:
    Ethernet controller: PCI device 1af4:1000
      IRQ 0.
      BAR0: I/O at 0x8040 [0x805f].
      BAR1: 32 bit memory at 0xfe841000 [0xfe841fff].
      BAR4: 64 bit prefetchable memory at 0xfb800000 [0xfbffffff].
      BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].
      id ""
  Bus  0, device   3, function 0:
    VGA controller: PCI device 1234:1111
      BAR0: 32 bit prefetchable memory at 0xfa000000 [0xfaffffff].
      BAR2: 32 bit memory at 0xfea11000 [0xfea11fff].
      BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe].
      id "video"
  Bus  0, device   4, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 11.
      BUS 0.
      secondary bus 2.
      subordinate bus 2.
      IO range [0x7000, 0x7fff]
      memory range [0xfe600000, 0xfe7fffff]
      prefetchable memory range [0xfd800000, 0xfd9fffff]
      BAR0: 64 bit memory at 0xfea12000 [0xfea120ff].
      id "bridge1"
  Bus  2, device   1, function 0:
    USB controller: PCI device 1033:0194
      IRQ 0.
      BAR0: 64 bit memory at 0xfe600000 [0xfe603fff].
      id "xhci0"
  Bus  0, device   5, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 3.
      subordinate bus 3.
      IO range [0x6000, 0x6fff]
      memory range [0xfe400000, 0xfe5fffff]
      prefetchable memory range [0xfd000000, 0xfd7fffff]
      BAR0: 64 bit memory at 0xfea13000 [0xfea130ff].
      id "bridge2"
  Bus  3, device   1, function 0:
    SCSI controller: PCI device 1af4:1004
      IRQ 0.
      BAR0: I/O at 0x6fc0 [0x6fff].
      BAR1: 32 bit memory at 0xfe5ff000 [0xfe5fffff].
      BAR4: 64 bit prefetchable memory at 0xfd000000 [0xfd7fffff].
      id "scsi1"
  Bus  0, device   6, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 4.
      subordinate bus 4.
      IO range [0x5000, 0x5fff]
      memory range [0xfe200000, 0xfe3fffff]
      prefetchable memory range [0xfc800000, 0xfcffffff]
      BAR0: 64 bit memory at 0xfea14000 [0xfea140ff].
      id "bridge3"
  Bus  4, device   1, function 0:
    SCSI controller: PCI device 1af4:1001
      IRQ 0.
      BAR0: I/O at 0xffffffffffffffff [0x003e].
      BAR1: 32 bit memory at 0xffffffffffffffff [0x00000ffe].
      BAR4: 64 bit prefetchable memory at 0xffffffffffffffff [0x007ffffe].
      id "test1"
  Bus  0, device   7, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 11.
      BUS 0.
      secondary bus 5.
      subordinate bus 5.
      IO range [0x4000, 0x4fff]
      memory range [0xfe000000, 0xfe1fffff]
      prefetchable memory range [0xfc600000, 0xfc7fffff]
      BAR0: 64 bit memory at 0xfea15000 [0xfea150ff].
      id "bridge4"
  Bus  0, device   8, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 11.
      BUS 0.
      secondary bus 6.
      subordinate bus 6.
      IO range [0x3000, 0x3fff]
      memory range [0xfde00000, 0xfdffffff]
      prefetchable memory range [0xfc400000, 0xfc5fffff]
      BAR0: 64 bit memory at 0xfea16000 [0xfea160ff].
      id "bridge5"
  Bus  0, device   9, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 7.
      subordinate bus 7.
      IO range [0x2000, 0x2fff]
      memory range [0xfdc00000, 0xfddfffff]
      prefetchable memory range [0xfc200000, 0xfc3fffff]
      BAR0: 64 bit memory at 0xfea17000 [0xfea170ff].
      id "bridge6"
  Bus  0, device  10, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 8.
      subordinate bus 8.
      IO range [0x1000, 0x1fff]
      memory range [0xfda00000, 0xfdbfffff]
      prefetchable memory range [0xfc000000, 0xfc1fffff]
      BAR0: 64 bit memory at 0xfea18000 [0xfea180ff].
      id "bridge7"

(qemu) info block
drive-virtio-disk0 (#block160): /home/pci-bridge/win10-1.qcow2 (qcow2)
    Cache mode:       writeback, direct

ide1 (#block349): /home/virtio-win.iso (raw, read-only)
    Removable device: not locked, tray closed
    Cache mode:       writeback

test1 (#block584): /home/pci-bridge/block1.qcow2 (qcow2)
    Cache mode:       writeback

drive_datadisk0 (#block755): /home/pci-bridge/test.raw (raw)
    Cache mode:       writeback

About the log file, please check the attachment

Thanks
Jing Zhao

Comment 5 jingzhao 2016-09-14 05:10:20 UTC
Created attachment 1200724 [details]
setupapi.dev

Comment 6 jingzhao 2016-09-14 05:10:52 UTC
Created attachment 1200725 [details]
setupapi.setup

Comment 7 Vadim Rozenfeld 2016-09-14 09:10:55 UTC
(In reply to jingzhao from comment #4)
> (In reply to Vadim Rozenfeld from comment #3)
> > Can you please dump pci data with qemu monitor command "info pci" after
> > steps 1,2,3, and 4 respectively, as well as provide contents of
> > setupapi.dev.log file?
> > 
> > Thanks,
> > Vadim.
> 
> Update the info:
> After step1:
............................................
............................................
>       BAR0: 64 bit memory at 0xfea18000 [0xfea180ff].
>       id "bridge7"
> After step2:
> (qemu) info block
> drive-virtio-disk0 (#block160): /home/pci-bridge/win10-1.qcow2 (qcow2)
............................................
............................................
>       BAR0: 64 bit memory at 0xfea14000 [0xfea140ff].
>       id "bridge3"
>   Bus  4, device   1, function 0:
>     SCSI controller: PCI device 1af4:1001
>       IRQ 0.
>       BAR0: I/O at 0x5fc0 [0x5fff].
>       BAR1: 32 bit memory at 0xfe3ff000 [0xfe3fffff].
>       BAR4: 64 bit prefetchable memory at 0xfd000000 [0xfd7fffff].
>       id "test1"
>   Bus  0, device   7, function 0:
>     PCI bridge: PCI device 1b36:0001
>       IRQ 11.
............................................
............................................
>       BAR0: 64 bit memory at 0xfea18000 [0xfea180ff].
>       id "bridge7"
> (qemu) stop
> (qemu) info status
> VM status: paused
> (qemu) cont
> (qemu) info status
> VM status: running
> 
> After step4:
> (qemu) info pci
>   Bus  0, device   0, function 0:
>       id "bridge3"
............................................
............................................
>   Bus  4, device   1, function 0:
>     SCSI controller: PCI device 1af4:1001
>       IRQ 0.
>       BAR0: I/O at 0xffffffffffffffff [0x003e].
                     ^^^^^^^^^^^^^^^^^^ (*)
>       BAR1: 32 bit memory at 0xffffffffffffffff [0x00000ffe].
                               ^^^^^^^^^^^^^^^^^^ (**)
>       BAR4: 64 bit prefetchable memory at 0xffffffffffffffff [0x007ffffe].
                                            ^^^^^^^^^^^^^^^^^^ (***)
>       id "test1"

*,**,and *** look as a pci resources allocation problem from the QEMU side. Just wondering if you see the same result stopping and resuming between steps 3 and 4?

Thanks,
Vadim.

Comment 8 Vadim Rozenfeld 2016-09-14 09:12:43 UTC
(In reply to Vadim Rozenfeld from comment #7)
> (In reply to jingzhao from comment #4)
> > (In reply to Vadim Rozenfeld from comment #3)
> > > Can you please dump pci data with qemu monitor command "info pci" after
> > > steps 1,2,3, and 4 respectively, as well as provide contents of
> > > setupapi.dev.log file?
> > > 
> > > Thanks,
> > > Vadim.
> > 
> > Update the info:
> > After step1:
> ............................................
> ............................................
> >       BAR0: 64 bit memory at 0xfea18000 [0xfea180ff].
> >       id "bridge7"
> > After step2:
> > (qemu) info block
> > drive-virtio-disk0 (#block160): /home/pci-bridge/win10-1.qcow2 (qcow2)
> ............................................
> ............................................
> >       BAR0: 64 bit memory at 0xfea14000 [0xfea140ff].
> >       id "bridge3"
> >   Bus  4, device   1, function 0:
> >     SCSI controller: PCI device 1af4:1001
> >       IRQ 0.
> >       BAR0: I/O at 0x5fc0 [0x5fff].
> >       BAR1: 32 bit memory at 0xfe3ff000 [0xfe3fffff].
> >       BAR4: 64 bit prefetchable memory at 0xfd000000 [0xfd7fffff].
> >       id "test1"
> >   Bus  0, device   7, function 0:
> >     PCI bridge: PCI device 1b36:0001
> >       IRQ 11.
> ............................................
> ............................................
> >       BAR0: 64 bit memory at 0xfea18000 [0xfea180ff].
> >       id "bridge7"
> > (qemu) stop
> > (qemu) info status
> > VM status: paused
> > (qemu) cont
> > (qemu) info status
> > VM status: running
> > 
> > After step4:
> > (qemu) info pci
> >   Bus  0, device   0, function 0:
> >       id "bridge3"
> ............................................
> ............................................
> >   Bus  4, device   1, function 0:
> >     SCSI controller: PCI device 1af4:1001
> >       IRQ 0.
> >       BAR0: I/O at 0xffffffffffffffff [0x003e].
>                      ^^^^^^^^^^^^^^^^^^ (*)
> >       BAR1: 32 bit memory at 0xffffffffffffffff [0x00000ffe].
>                                ^^^^^^^^^^^^^^^^^^ (**)
> >       BAR4: 64 bit prefetchable memory at 0xffffffffffffffff [0x007ffffe].
>                                             ^^^^^^^^^^^^^^^^^^ (***)
> >       id "test1"
> 
> *,**,and *** look as a pci resources allocation problem from the QEMU side.
> Just wondering if you see the same result stopping and resuming between
> steps 3 and 4?
> 

I mean "without  stopping and resuming between steps 3 and 4"

> Thanks,
> Vadim.

Comment 9 jingzhao 2016-09-14 10:12:52 UTC
(In reply to Vadim Rozenfeld from comment #7)
> (In reply to jingzhao from comment #4)
> > (In reply to Vadim Rozenfeld from comment #3)
> > > Can you please dump pci data with qemu monitor command "info pci" after
> > > steps 1,2,3, and 4 respectively, as well as provide contents of
> > > setupapi.dev.log file?
> > > 
> > > Thanks,
> > > Vadim.
> > 
> > Update the info:
> > After step1:
> ............................................
> ............................................
> >       BAR0: 64 bit memory at 0xfea18000 [0xfea180ff].
> >       id "bridge7"
> > After step2:
> > (qemu) info block
> > drive-virtio-disk0 (#block160): /home/pci-bridge/win10-1.qcow2 (qcow2)
> ............................................
> ............................................
> >       BAR0: 64 bit memory at 0xfea14000 [0xfea140ff].
> >       id "bridge3"
> >   Bus  4, device   1, function 0:
> >     SCSI controller: PCI device 1af4:1001
> >       IRQ 0.
> >       BAR0: I/O at 0x5fc0 [0x5fff].
> >       BAR1: 32 bit memory at 0xfe3ff000 [0xfe3fffff].
> >       BAR4: 64 bit prefetchable memory at 0xfd000000 [0xfd7fffff].
> >       id "test1"
> >   Bus  0, device   7, function 0:
> >     PCI bridge: PCI device 1b36:0001
> >       IRQ 11.
> ............................................
> ............................................
> >       BAR0: 64 bit memory at 0xfea18000 [0xfea180ff].
> >       id "bridge7"
> > (qemu) stop
> > (qemu) info status
> > VM status: paused
> > (qemu) cont
> > (qemu) info status
> > VM status: running
> > 
> > After step4:
> > (qemu) info pci
> >   Bus  0, device   0, function 0:
> >       id "bridge3"
> ............................................
> ............................................
> >   Bus  4, device   1, function 0:
> >     SCSI controller: PCI device 1af4:1001
> >       IRQ 0.
> >       BAR0: I/O at 0xffffffffffffffff [0x003e].
>                      ^^^^^^^^^^^^^^^^^^ (*)
> >       BAR1: 32 bit memory at 0xffffffffffffffff [0x00000ffe].
>                                ^^^^^^^^^^^^^^^^^^ (**)
> >       BAR4: 64 bit prefetchable memory at 0xffffffffffffffff [0x007ffffe].
>                                             ^^^^^^^^^^^^^^^^^^ (***)
> >       id "test1"
> 
> *,**,and *** look as a pci resources allocation problem from the QEMU side.
> Just wondering if you see the same result stopping and resuming between
> steps 3 and 4?
> 
> Thanks,
> Vadim.

Seemly not same, following is the details
before stop:
Bus  4, device   1, function 0:
    SCSI controller: PCI device 1af4:1001
      IRQ 0.
      BAR0: I/O at 0x5fc0 [0x5fff].
      BAR1: 32 bit memory at 0xfe3ff000 [0xfe3fffff].
      BAR4: 64 bit prefetchable memory at 0xfd000000 [0xfd7fffff].
      id "test1"

After resume:

  Bus  4, device   1, function 0:
    SCSI controller: PCI device 1af4:1001
      IRQ 0.
      BAR0: I/O at 0x5fc0 [0x5fff].
      BAR1: 32 bit memory at 0xfe3ff000 [0xfe3fffff].
      BAR4: 64 bit prefetchable memory at 0xfd000000 [0xfd7fffff].
      id "test1"

Thanks
Jing Zhao

Comment 12 Vadim Rozenfeld 2018-08-02 06:04:38 UTC
Wonder to know if the problem is still reproducible on rhel7.6 with the latest virtio-win drivers?

Thanks,
Vadim.