broken "pci_add auto storage"

Bug #591666 reported by Eran Rom on 2010-06-09
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

(qemu) pci_add auto storage file=/dev/ram0,if=virtio
Results in:
OK domain 0, bus 0, slot 5, function 0

However no device is actually added to the guest.
QEMU: Latest git code (June 9) from git://
(seems to be broken from
KVM: Compiled from git://
checked out (refs/remotes/origin/stable-2.6.32)

Both guest and host are Ubuntu 9.10 with 2.6.32 kernel.
Guest kernel has ACPI enabled (specifically, the PCI slot detection driver)

Guest executed with the following parameters:
 -boot c -drive file=/home/eranr/kvm_images/ubuntu-9.10-2.6.32-perf.img,if=ide,boot=on -m 4096 -net nic,model=virtio -net tap,ifname=qtap0,script=no -vnc :0 -smp 1,cores=1,threads=0 -monitor tcp:localhost:6001,server,nowait

Pierce Liu (atlarge80) wrote :

Hi Eran,

Could you lauch "lspci" command on guestOS to see whether there is a new pci device hot-plug in?

On the other hand, the guestOS need to be configured with "CONFIG_VIRTIO_PCI", otherwise it can not
contain the driver to monitor the virtio-pci device.


Pierce Liu (atlarge80) wrote :

If configure guest kernel correctly, it seems that virtio for block is OK!
Could you help or send me your configure file to have a second check


======== version info ===============
QEMU 0.14.50 monitor
host kernel: 2.6.39
guest kernel: 2.6.32

======== config file for kernel info ===================
See attachment

=========Doing on qemu monitor ================
QEMU 0.14.50 monitor - type 'help' for more information
(qemu) pci_add auto storage file=/dev/ram0,if=virtio
OK domain 0, bus 0, slot 3, function 0

=========Doing on guest console ===============
1. ---see the disk on guest
root@qemux86-64:~# dmesg | grep 'vda'
[ 245.440217] vda: unknown partition table
root@qemux86-64:~# fdisk -l

Disk /dev/sda: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sda doesn't contain a valid partition table

Disk /dev/vda: 16 MB, 16777216 bytes
16 heads, 63 sectors/track, 32 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Disk /dev/vda doesn't contain a valid partition table

2. --- write content to virtio disk

root@qemux86-64:~# echo 'helloHypervisor' > /dev/vda
root@qemux86-64:~# head /dev/vda

=========Doing on host console =============

[root@oc8440477808 linux-2.6.39]# head /dev/ram0

========= conclusion ====================
Host get the data which is passed through virtio device on guest. The data is "helloHpervisor"

So, the kernel version 2.6.32 can support virtio block device with correct
config, especially the following must be choosen:


Pierce Liu (atlarge80) wrote :
Pierce Liu (atlarge80) wrote :

Did you remember to load PCI hotplug modules into the guest?
sudo modprobe acpiphp
sudo modprobe pci_hotplug

vikas pandey (linuxporting) wrote :

this is vikas pandey,

1:would u please give me ur kernel and initrd source to me also trying to add pci and usb device in guest os ..

i am using qemu and i am abe to run some of kernel image and initrd which is available on qemu site for testing purpose.
now my ami is to connect the host usb and access the content after running iso image or specifing kernel and initrd image on qemu .

for this task i have followed some procedure which is inlined....

cat /etc/lsb-release
Host pc discription :
==>uname -a
Linux vikas-ThinkCentre-A70 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux

QEMU emulator version 1.0,1, Copyright (c) 2003-2008 Fabrice Bellard

fist i have checked with iso images
step 1:
dd of=ubuntuimage bs=1024 seek=10485760 count=0
step 2:
qemu -hda ubuntuimage -cdrom m1040_wifi.iso -usbdevice host:1e3d:2093 -m 192 -boot d
usb_create: no bus specified, using "usb.0" for "usb-host"
(it is a problem which is not permitting guest os to access completly even media will be detected on console while booting on qemu and we can add usb in qemu but in qemue gues os shelll it is not detecting any where )
husb: open device 1.6
husb: config #1 need -1
husb: 1 interfaces claimed for configuration 1
husb: grabbed usb device 1.6
husb: config #1 need 1
husb: 1 interfaces claimed for configuration 1
husb: config #1 need 1
husb: 1 interfaces claimed for configuration 1
=========>2nd i have used kernel and initrd image
step >qemu-system-arm -kernel zImage.integrator -initrd arm_root.img -hda ubuntuimage -usb -usbdevice host:1e3d:2093 -m 128
segmantation fault
please suggest me as soon as possible ,and please tell me that is it compulsary that use kvm and libvirt with qemu for using host usb or not..
because i have also tried alot with libvirt but every time it is having some different -2 error currently error related with libvirt is ..
==>virsh -c qemu:///system list

virsh: /usr/lib/ version `LIBVIRT_0.9.3' not found (required by virsh)
virsh: /usr/lib/ version `LIBVIRT_0.9.0' not found (required by virsh)
virsh: /usr/lib/ version `LIBVIRT_PRIVATE_0.9.3' not found (required by virsh)
virsh: /usr/lib/ version `LIBVIRT_0.9.2' not found (required by virsh

plese tell me now what should ido...
thanks& regards

Thomas Huth (th-huth) wrote :

The "pci_add" command has been removed since QEMU 2.3.0, so I guess we can close this bug ... if you still can reproduce the problem with the latest version, please feel free to open this ticket again.

Changed in qemu:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers