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 1358665 - [Q35] Disk which connected to pci bridge didn't be found in guest with q35 machine type
Summary: [Q35] Disk which connected to pci bridge didn't be found in guest with q35 ma...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Marcel Apfelbaum
QA Contact: jingzhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-21 08:43 UTC by jingzhao
Modified: 2016-08-14 13:54 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-14 13:54:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The seabios log (7.75 KB, text/plain)
2016-07-21 08:45 UTC, jingzhao
no flags Details
the dmesg log of guest (38.72 KB, text/plain)
2016-07-21 08:45 UTC, jingzhao
no flags Details

Description jingzhao 2016-07-21 08:43:07 UTC
Description of problem:
Disk which connected to pci bridge didn't be found in guest with q35 machine type

Version-Release number of selected component (if applicable):
host kernel:3.10.0-470.el7.x86_64
qemu-kvm-rhev-2.6.0-14.el7.x86_64
seabios-1.9.1-4.el7.x86_64

guest kernel:3.10.0-470.el7.x86_64

How reproducible:
3/3

Steps to Reproduce:
1. Boot guest with following cli:
/usr/libexec/qemu-kvm \
-M q35 \
-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 \
-serial unix:/tmp/serial0,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-chardev file,path=/home/seabios.log,id=seabios \
-device isa-debugcon,chardev=seabios,iobase=0x402 \
-qmp tcp::8887,server,nowait \
-vga qxl \
-spice port=5932,disable-ticketing \
-device ioh3420,id=root.0,slot=1 \
-drive file=/home/q35.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,bus=root.0,drive=drive-virtio-disk0,id=virtio-disk0,disable-legacy=on,disable-modern=off,bootindex=1 \
-device i82801b11-bridge,bus=pcie.0,id=bridge1 \
-device pci-bridge,bus=bridge1,id=bridge2,chassis_nr=1 \
-drive file=/home/pci-block1.qcow2,if=none,id=pci-block1,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,bus=bridge2,drive=pci-block1,id=pciblock1,addr=0x6.1 \
-device ioh3420,id=root.2,slot=3 \
-device virtio-net-pci,bus=root.2,netdev=tap10,mac=9a:6a:6b:6c:6d:6e,disable-legacy=on,disable-modern=off -netdev tap,id=tap10 \
-monitor stdio \

2. check the block info through hmp
(qemu) info pci
  Bus  0, device   0, function 0:
    Host bridge: PCI device 8086:29c0
      id ""
  Bus  0, device   1, function 0:
    VGA controller: PCI device 1b36:0100
      IRQ 10.
      BAR0: 32 bit memory at 0xf4000000 [0xf7ffffff].
      BAR1: 32 bit memory at 0xf8000000 [0xfbffffff].
      BAR2: 32 bit memory at 0xfc810000 [0xfc811fff].
      BAR3: I/O at 0xd040 [0xd05f].
      BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe].
      id ""
  Bus  0, device   2, function 0:
    PCI bridge: PCI device 8086:3420
      BUS 0.
      secondary bus 1.
      subordinate bus 1.
      IO range [0x1000, 0x1fff]
      memory range [0xfc600000, 0xfc7fffff]
      prefetchable memory range [0xfe000000, 0xfe7fffff]
      id "root.0"
  Bus  1, device   0, function 0:
    SCSI controller: PCI device 1af4:1042
      IRQ 11.
      BAR1: 32 bit memory at 0xfc600000 [0xfc600fff].
      BAR4: 64 bit prefetchable memory at 0xfe000000 [0xfe7fffff].
      id "virtio-disk0"
  Bus  0, device   3, function 0:
    PCI bridge: PCI device 8086:244e
      BUS 0.
      secondary bus 2.
      subordinate bus 3.
      IO range [0xc000, 0xcfff]
      memory range [0xfc000000, 0xfc3fffff]
      prefetchable memory range [0xfe800000, 0xfe9fffff]
      id "bridge1"
  Bus  2, device   0, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 11.
      BUS 2.
      secondary bus 3.
      subordinate bus 3.
      IO range [0xc000, 0xcfff]
      memory range [0xfc000000, 0xfc1fffff]
      prefetchable memory range [0xfe800000, 0xfe9fffff]
      BAR0: 64 bit memory at 0xfc200000 [0xfc2000ff].
      id "bridge2"
  Bus  3, device   6, function 1:
    SCSI controller: PCI device 1af4:1001
      IRQ 0.
      BAR0: I/O at 0xffffffffffffffff [0x003e].
      BAR1: 32 bit memory at 0xffffffffffffffff [0x00000ffe].
      id "pciblock1"
  Bus  0, device   4, function 0:
    PCI bridge: PCI device 8086:3420
      BUS 0.
      secondary bus 4.
      subordinate bus 4.
      IO range [0x2000, 0x2fff]
      memory range [0xfc400000, 0xfc5fffff]
      prefetchable memory range [0xfd800000, 0xfdffffff]
      id "root.2"
  Bus  4, device   0, function 0:
    Ethernet controller: PCI device 1af4:1041
      IRQ 10.
      BAR1: 32 bit memory at 0xfc440000 [0xfc440fff].
      BAR4: 64 bit prefetchable memory at 0xfd800000 [0xfdffffff].
      BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].
      id ""
  Bus  0, device  31, function 0:
    ISA bridge: PCI device 8086:2918
      id ""
  Bus  0, device  31, function 2:
    SATA controller: PCI device 8086:2922
      IRQ 10.
      BAR4: I/O at 0xd060 [0xd07f].
      BAR5: 32 bit memory at 0xfc812000 [0xfc812fff].
      id ""
  Bus  0, device  31, function 3:
    SMBus: PCI device 8086:2930
      IRQ 10.
      BAR4: I/O at 0x0700 [0x073f].
      id ""
(qemu) info qtree
bus: main-system-bus
  type System
  dev: kvm-ioapic, id ""
    gpio-in "" 24
    gsi_base = 0 (0x0)
    mmio 00000000fec00000/0000000000001000
  dev: q35-pcihost, id ""
    MCFG = 2952790016 (0xb0000000)
    pci-hole64-size = 0 (0 B)
    short_root_bus = 0 (0x0)
    bus: pcie.0
      type PCIE
      dev: ioh3420, id "root.2"
        power_controller_present = true
        chassis = 0 (0x0)
        slot = 3 (0x3)
        port = 0 (0x0)
        aer_log_max = 8 (0x8)
        addr = 04.0
        romfile = ""
        rombar = 1 (0x1)
        multifunction = false
        command_serr_enable = true
        class PCI bridge, addr 00:04.0, pci id 8086:3420 (sub 0000:0000)
        bus: root.2
          type PCIE
          dev: virtio-net-pci, id ""
            ioeventfd = false
            vectors = 3 (0x3)
            virtio-pci-bus-master-bug-migration = false
            disable-legacy = true
            disable-modern = false
            migrate-extra = true
            modern-pio-notify = false
            x-disable-pcie = false
            addr = 00.0
            romfile = "pxe-virtio.rom"
            rombar = 1 (0x1)
            multifunction = false
            command_serr_enable = true
            class Ethernet controller, addr 04:00.0, pci id 1af4:1041 (sub 1af4:1100)
            bar 1: mem at 0xfc440000 [0xfc440fff]
            bar 4: mem at 0xfd800000 [0xfdffffff]
            bar 6: mem at 0xffffffffffffffff [0x3fffe]
            bus: virtio-bus
              type virtio-pci-bus
              dev: virtio-net-device, id ""
                csum = true
                guest_csum = true
                gso = true
                guest_tso4 = true
                guest_tso6 = true
                guest_ecn = true
                guest_ufo = true
                guest_announce = true
                host_tso4 = true
                host_tso6 = true
                host_ecn = true
                host_ufo = true
                mrg_rxbuf = true
                status = true
                ctrl_vq = true
                ctrl_rx = true
                ctrl_vlan = true
                ctrl_rx_extra = true
                ctrl_mac_addr = true
                ctrl_guest_offloads = true
                mq = false
                mac = "9a:6a:6b:6c:6d:6e"
                vlan = <null>
                netdev = "tap10"
                x-txtimer = 150000 (0x249f0)
                x-txburst = 256 (0x100)
                tx = ""
                indirect_desc = true
                event_idx = true
                notify_on_empty = true
                any_layout = true
      dev: i82801b11-bridge, id "bridge1"
        addr = 03.0
        romfile = ""
        rombar = 1 (0x1)
        multifunction = false
        command_serr_enable = true
        class PCI bridge, addr 00:03.0, pci id 8086:244e (sub 0000:0000)
        bus: bridge1
          type PCI
          dev: pci-bridge, id "bridge2"
            chassis_nr = 1 (0x1)
            msi = true
            shpc = true
            addr = 00.0
            romfile = ""
            rombar = 1 (0x1)
            multifunction = false
            command_serr_enable = true
            class PCI bridge, addr 02:00.0, pci id 1b36:0001 (sub 0000:0000)
            bar 0: mem at 0xfc200000 [0xfc2000ff]
            bus: bridge2
              type PCI
              dev: virtio-blk-pci, id "pciblock1"
                class = 0 (0x0)
                ioeventfd = true
                vectors = 2 (0x2)
                virtio-pci-bus-master-bug-migration = false
                disable-legacy = false
                disable-modern = true
                migrate-extra = true
                modern-pio-notify = false
                x-disable-pcie = false
                addr = 06.1
                romfile = ""
                rombar = 1 (0x1)
                multifunction = false
                command_serr_enable = true
                class SCSI controller, addr 03:06.1, pci id 1af4:1001 (sub 1af4:0002)
                bar 0: i/o at 0xffffffffffffffff [0x3e]
                bar 1: mem at 0xffffffffffffffff [0xffe]
                bus: virtio-bus
                  type virtio-pci-bus
                  dev: virtio-blk-device, id ""
                    drive = "pci-block1"
                    logical_block_size = 512 (0x200)
                    physical_block_size = 512 (0x200)
                    min_io_size = 0 (0x0)
                    opt_io_size = 0 (0x0)
                    discard_granularity = 4294967295 (0xffffffff)
                    cyls = 2080 (0x820)
                    heads = 16 (0x10)
                    secs = 63 (0x3f)
                    serial = ""
                    config-wce = true
                    scsi = false
                    request-merging = true
                    indirect_desc = true
                    event_idx = true
                    notify_on_empty = true
                    any_layout = false
      dev: ioh3420, id "root.0"
        power_controller_present = true
        chassis = 0 (0x0)
        slot = 1 (0x1)
        port = 0 (0x0)
        aer_log_max = 8 (0x8)
        addr = 02.0
        romfile = ""
        rombar = 1 (0x1)
        multifunction = false
        command_serr_enable = true
        class PCI bridge, addr 00:02.0, pci id 8086:3420 (sub 0000:0000)
        bus: root.0
          type PCIE
          dev: virtio-blk-pci, id "virtio-disk0"
            class = 0 (0x0)
            ioeventfd = true
            vectors = 2 (0x2)
            virtio-pci-bus-master-bug-migration = false
            disable-legacy = true
            disable-modern = false
            migrate-extra = true
            modern-pio-notify = false
            x-disable-pcie = false
            addr = 00.0
            romfile = ""
            rombar = 1 (0x1)
            multifunction = false
            command_serr_enable = true
            class SCSI controller, addr 01:00.0, pci id 1af4:1042 (sub 1af4:1100)
            bar 1: mem at 0xfc600000 [0xfc600fff]
            bar 4: mem at 0xfe000000 [0xfe7fffff]
            bus: virtio-bus
              type virtio-pci-bus
              dev: virtio-blk-device, id ""
                drive = "drive-virtio-disk0"
                logical_block_size = 512 (0x200)
                physical_block_size = 512 (0x200)
                min_io_size = 0 (0x0)
                opt_io_size = 0 (0x0)
                discard_granularity = 4294967295 (0xffffffff)
                cyls = 16383 (0x3fff)
                heads = 16 (0x10)
                secs = 63 (0x3f)
                serial = ""
                config-wce = true
                scsi = false
                request-merging = true
                indirect_desc = true
                event_idx = true
                notify_on_empty = true
                any_layout = true
      dev: qxl-vga, id ""
        ram_size = 67108864 (0x4000000)
        vram_size = 67108864 (0x4000000)
        revision = 4 (0x4)
        debug = 0 (0x0)
        guestdebug = 0 (0x0)
        cmdlog = 0 (0x0)
        ram_size_mb = 4294967295 (0xffffffff)
        vram_size_mb = 4294967295 (0xffffffff)
        vram64_size_mb = 4294967295 (0xffffffff)
        vgamem_mb = 16 (0x10)
        surfaces = 1024 (0x400)
        addr = 01.0
        romfile = "vgabios-qxl.bin"
        rombar = 1 (0x1)
        multifunction = false
        command_serr_enable = true
        class VGA controller, addr 00:01.0, pci id 1b36:0100 (sub 1af4:1100)
        bar 0: mem at 0xf4000000 [0xf7ffffff]
        bar 1: mem at 0xf8000000 [0xfbffffff]
        bar 2: mem at 0xfc810000 [0xfc811fff]
        bar 3: i/o at 0xd040 [0xd05f]
        bar 6: mem at 0xffffffffffffffff [0xfffe]
      dev: ICH9 SMB, id ""
        addr = 1f.3
        romfile = ""
        rombar = 1 (0x1)
        multifunction = true
        command_serr_enable = true
        class SMBus, addr 00:1f.3, pci id 8086:2930 (sub 1af4:1100)
        bar 4: i/o at 0x700 [0x73f]
        bus: i2c
          type i2c-bus
          dev: smbus-eeprom, id ""
            address = 87 (0x57)
          dev: smbus-eeprom, id ""
            address = 86 (0x56)
          dev: smbus-eeprom, id ""
            address = 85 (0x55)
          dev: smbus-eeprom, id ""
            address = 84 (0x54)
          dev: smbus-eeprom, id ""
            address = 83 (0x53)
          dev: smbus-eeprom, id ""
            address = 82 (0x52)
          dev: smbus-eeprom, id ""
            address = 81 (0x51)
          dev: smbus-eeprom, id ""
            address = 80 (0x50)
      dev: ich9-ahci, id ""
        addr = 1f.2
        romfile = ""
        rombar = 1 (0x1)
        multifunction = true
        command_serr_enable = true
        class SATA controller, addr 00:1f.2, pci id 8086:2922 (sub 1af4:1100)
        bar 4: i/o at 0xd060 [0xd07f]
        bar 5: mem at 0xfc812000 [0xfc812fff]
        bus: ide.5
          type IDE
        bus: ide.4
          type IDE
        bus: ide.3
          type IDE
        bus: ide.2
          type IDE
        bus: ide.1
          type IDE
        bus: ide.0
          type IDE
      dev: ICH9-LPC, id ""
        noreboot = true
        addr = 1f.0
        romfile = ""
        rombar = 1 (0x1)
        multifunction = true
        command_serr_enable = true
        class ISA bridge, addr 00:1f.0, pci id 8086:2918 (sub 1af4:1100)
        bus: isa.0
          type ISA
          dev: isa-debugcon, id ""
            iobase = 1026 (0x402)
            chardev = "seabios"
            readback = 233 (0xe9)
          dev: i8257, id ""
            base = 192 (0xc0)
            page-base = 136 (0x88)
            pageh-base = -1 (0xffffffffffffffff)
            dshift = 1 (0x1)
          dev: i8257, id ""
            base = 0 (0x0)
            page-base = 128 (0x80)
            pageh-base = -1 (0xffffffffffffffff)
            dshift = 0 (0x0)
          dev: port92, id ""
          dev: vmmouse, id ""
          dev: vmport, id ""
          dev: i8042, id ""
            isa irqs 1,12
          dev: isa-serial, id ""
            index = 0 (0x0)
            iobase = 1016 (0x3f8)
            irq = 4 (0x4)
            chardev = "serial0"
            wakeup = 0 (0x0)
            isa irq 4
          dev: isa-pcspk, id ""
            iobase = 97 (0x61)
          dev: kvm-pit, id ""
            gpio-in "" 1
            iobase = 64 (0x40)
            lost_tick_policy = "delay"
          dev: mc146818rtc, id ""
            base_year = 0 (0x0)
            lost_tick_policy = "discard"
            isa irq 8
          dev: kvm-i8259, id ""
            iobase = 160 (0xa0)
            elcr_addr = 1233 (0x4d1)
            elcr_mask = 222 (0xde)
            master = false
          dev: kvm-i8259, id ""
            iobase = 32 (0x20)
            elcr_addr = 1232 (0x4d0)
            elcr_mask = 248 (0xf8)
            master = true
      dev: mch, id ""
        addr = 00.0
        romfile = ""
        rombar = 1 (0x1)
        multifunction = false
        command_serr_enable = true
        class Host bridge, addr 00:00.0, pci id 8086:29c0 (sub 1af4:1100)
  dev: fw_cfg_io, id ""
    iobase = 1296 (0x510)
    dma_iobase = 1300 (0x514)
    dma_enabled = true
  dev: kvmclock, id ""
  dev: kvmvapic, id ""

3. Check the info of disk in guest
[root@localhost home]# lsblk
NAME          MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda           252:0    0  30G  0 disk 
├─vda1        252:1    0   1G  0 part /boot
└─vda2        252:2    0  29G  0 part 
  ├─rhel-root 253:0    0  26G  0 lvm  /
  └─rhel-swap 253:1    0   3G  0 lvm  [SWAP]
[root@localhost home]# lspci 
00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
00:01.0 VGA compatible controller: Red Hat, Inc. QXL paravirtual graphic card (rev 04)
00:02.0 PCI bridge: Intel Corporation 7500/5520/5500/X58 I/O Hub PCI Express Root Port 0 (rev 02)
00:03.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 92)
00:04.0 PCI bridge: Intel Corporation 7500/5520/5500/X58 I/O Hub PCI Express Root Port 0 (rev 02)
00:1f.0 ISA bridge: Intel Corporation 82801IB (ICH9) LPC Interface Controller (rev 02)
00:1f.2 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] (rev 02)
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 02)
01:00.0 SCSI storage controller: Red Hat, Inc Virtio block device (rev 01)
02:00.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
04:00.0 Ethernet controller: Red Hat, Inc Virtio network device (rev 01)
[root@localhost home]# lspci -vvv -t
-[0000:00]-+-00.0  Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
           +-01.0  Red Hat, Inc. QXL paravirtual graphic card
           +-02.0-[01]----00.0  Red Hat, Inc Virtio block device
           +-03.0-[02-03]----00.0-[03]--
           +-04.0-[04]----00.0  Red Hat, Inc Virtio network device
           +-1f.0  Intel Corporation 82801IB (ICH9) LPC Interface Controller
           +-1f.2  Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
           \-1f.3  Intel Corporation 82801I (ICH9 Family) SMBus Controller


Actual results:
Disk didn't be found in guest, but can be found through "info qtree" on hmp

Expected results:
Disk can be found in guest and can be work well

Additional info:
The seabios log and the dmesg log of guest please check the attachment 

Also try another two connected method and failed
1)
-device ioh3420,id=root.3,slot=4 \
-device pci-bridge,bus=root.3,id=bridge3,chassis_nr=2 \
-drive file=/home/pci-block3.qcow2,if=none,id=pci-block3,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,bus=bridge3,drive=pci-block3,id=pciblock3,addr=0x7.1 \
-device virtio-scsi,bus=bridge3,id=scsi2,addr=0x7.2 \
-drive file=/home/pci-block4.raw,if=none,id=pci-block4,format=raw,cache=none,werror=stop,rerror=stop \
-device scsi-disk,bus=scsi2.0,drive=pci-block4,id=pciblock4 \

2)
-device ioh3420,id=root.4,slot=5 \
-device x3130-upstream,bus=root.4,id=upstream2 \
-device xio3130-downstream,bus=upstream2,id=downstream3,chassis=4 \
-device pci-bridge,bus=root.3,id=bridge4,chassis_nr=3 \
-drive file=/home/pci-block5.qcow2,if=none,id=pci-block5,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,bus=bridge4,drive=pci-block5,id=pciblock5,addr=0x8.1 \
-device virtio-scsi,bus=bridge4,id=scsi3,addr=0x8.2 \
-drive file=/home/pci-block6.raw,if=none,id=pci-block6,format=raw,cache=none,werror=stop,rerror=stop \
-device scsi-disk,bus=scsi3.0,drive=pci-block6,id=pciblock6 \

Comment 1 jingzhao 2016-07-21 08:45:09 UTC
Created attachment 1182400 [details]
The seabios log

Comment 2 jingzhao 2016-07-21 08:45:34 UTC
Created attachment 1182401 [details]
the dmesg log of guest

Comment 4 Laszlo Ersek 2016-08-04 09:26:33 UTC
As reported, this BZ is NOTABUG. The QEMU command line is incorrect.

Namely, in all of the failing cases, we have a nonzero PCI function number for the virtio-blk-pci device:

#0
-device virtio-blk-pci,bus=bridge2,drive=pci-block1,id=pciblock1,addr=0x6.1 \

#1
-device virtio-blk-pci,bus=bridge3,drive=pci-block3,id=pciblock3,addr=0x7.1 \

#2
-device virtio-blk-pci,bus=bridge4,drive=pci-block5,id=pciblock5,addr=0x8.1 \

However, a nonzero PCI function number can only be used if:
- function 0 of the same PCI device also exists, and
- the multifunction capability is advertised by function 0.

In practical terms, it means that

  -device virtio-blk-pci,...,addr=0x6.1

will only work if some other

  -device FOOBAR,...,addr=0x6.0,multifunction=on
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^

option exists.

Multifunction is sometimes used to group 8 virtio-blk-pci devices into a single PCI device (using different function numbers). This allows for better density, but prevents independent hot-(un)plug.

Please repeat the original test either with "addr=0x6.0" (that is, changing the function number to 0), or with "addr=0x6.1" entirely removed. Thanks.

Comment 5 jingzhao 2016-08-10 05:39:47 UTC
(In reply to Laszlo Ersek from comment #4)
> As reported, this BZ is NOTABUG. The QEMU command line is incorrect.
> 
> Namely, in all of the failing cases, we have a nonzero PCI function number
> for the virtio-blk-pci device:
> 
> #0
> -device virtio-blk-pci,bus=bridge2,drive=pci-block1,id=pciblock1,addr=0x6.1 \
> 
> #1
> -device virtio-blk-pci,bus=bridge3,drive=pci-block3,id=pciblock3,addr=0x7.1 \
> 
> #2
> -device virtio-blk-pci,bus=bridge4,drive=pci-block5,id=pciblock5,addr=0x8.1 \
> 
> However, a nonzero PCI function number can only be used if:
> - function 0 of the same PCI device also exists, and
> - the multifunction capability is advertised by function 0.
> 
> In practical terms, it means that
> 
>   -device virtio-blk-pci,...,addr=0x6.1
> 
> will only work if some other
> 
>   -device FOOBAR,...,addr=0x6.0,multifunction=on
>                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> option exists.
> 
> Multifunction is sometimes used to group 8 virtio-blk-pci devices into a
> single PCI device (using different function numbers). This allows for better
> density, but prevents independent hot-(un)plug.
> 
> Please repeat the original test either with "addr=0x6.0" (that is, changing
> the function number to 0), or with "addr=0x6.1" entirely removed. Thanks.

As above metioned, I tried it with following command and it works
1) with "addr=0x6.0"
/usr/libexec/qemu-kvm \
-M q35 \
-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 \
-serial unix:/tmp/serial0,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-chardev file,path=/home/seabios.log,id=seabios \
-device isa-debugcon,chardev=seabios,iobase=0x402 \
-qmp tcp::8887,server,nowait \
-vga qxl \
-spice port=5932,disable-ticketing \
-device ioh3420,id=root.0,slot=1 \
-drive file=/home/q35-seabios.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,bus=root.0,drive=drive-virtio-disk0,id=virtio-disk0,disable-legacy=on,disable-modern=off,bootindex=1 \
-device i82801b11-bridge,bus=pcie.0,id=bridge1 \
-device pci-bridge,bus=bridge1,id=bridge2,chassis_nr=1 \
-drive file=/home/pci-block1.qcow2,if=none,id=pci-block1,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,bus=bridge2,drive=pci-block1,id=pciblock1 \
-device ioh3420,id=root.2,slot=3 \
-device virtio-net-pci,bus=root.2,netdev=tap10,mac=9a:6a:6b:6c:6d:6e,disable-legacy=on,disable-modern=off -netdev tap,id=tap10 \
-monitor stdio \

2)with "addr=0x6.1" entirely removed, it didn't work
QEMU 2.6.0 monitor - type 'help' for more information
(qemu) qemu-kvm: -device virtio-blk-pci,bus=bridge2,drive=pci-block1,id=pciblock1: Unsupported PCI slot 0 for standard hotplug controller. Valid slots are between 1 and 31.

So I think we can close bz 

Thanks
Jing Zhao

Comment 6 Marcel Apfelbaum 2016-08-14 13:54:07 UTC
Laszlo and Jing, Thanks for all the help!
Marcel


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