--- Begin Message ---
Package: qemu-kvm
Version: 1.1.2+dfsg-6+deb7u6
Severity: normal
Dear Maintainer,
* What led up to the situation?
Tried to add a new disk to a running kvm guest
* What exactly did you do (or not do) that was effective (or
ineffective)?
Using the virsh attach-device command I tried to add a new disk
* What was the outcome of this action?
# virsh attach-device cedric.CalvaEDI.COM zz.xml
error: Failed to attach device from zz.xml
error: internal error unable to execute QEMU command 'device_add': Bus 'pci.0'
does not support hotplugging
* What outcome did you expect instead?
Happiness.
The running vm looks like:
/usr/bin/kvm -S -M pc-1.1 -enable-kvm -m 8192 -smp
1,sockets=1,cores=1,threads=1 -name cedric.CalvaEDI.COM -uuid
99cfca83-cf28-ce9b-86a4-947debc202b5 -nographic -no-user-config -nodefaults
-chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/cedric.CalvaEDI.COM.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown
-no-acpi -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive
file=/dev/disk/by-id/md-name-cedric:root,if=none,id=drive-virtio-disk0,format=raw,cache=none
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-drive
file=/dev/disk/by-id/md-name-belgic:archive,if=none,id=drive-virtio-disk1,format=raw
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk1,id=virtio-disk1
-drive
file=/dev/disk/by-id/md-name-belgic:backups,if=none,id=drive-virtio-disk2,format=raw
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk2,id=vir!
tio-disk2 -netdev tap,fd=20,id=hostnet0,vhost=on,vhostfd=21 -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=00:16:3e:65:2d:8e,bus=pci.0,addr=0x3
-chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7
Or, in libvirt xml format:
<domain type='kvm' id='3'>
<name>cedric.CalvaEDI.COM</name>
<uuid>99cfca83-cf28-ce9b-86a4-947debc202b5</uuid>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-1.1'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc' adjustment='reset'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source dev='/dev/disk/by-id/md-name-cedric:root'/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04'
function='0x0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/disk/by-id/md-name-belgic:archive'/>
<target dev='vdb' bus='virtio'/>
<alias name='virtio-disk1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/disk/by-id/md-name-belgic:backups'/>
<target dev='vdc' bus='virtio'/>
<alias name='virtio-disk2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06'
function='0x0'/>
</disk>
<controller type='usb' index='0'>
<alias name='usb0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x2'/>
</controller>
<interface type='bridge'>
<mac address='00:16:3e:65:2d:8e'/>
<source bridge='calvaedi'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/0'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/0'>
<source path='/dev/pts/0'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07'
function='0x0'/>
</memballoon>
</devices>
<seclabel type='none'/>
</domain>
The device I tried to add looks like:
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source dev='/dev/disk/by-id/md-name-cedric:new'/>
<target dev='vdd' bus='virtio'/>
</disk>
The error in libvirtd.log is:
2014-12-16 13:22:50.831+0000: 5305: error : qemuMonitorJSONCheckError:342 :
internal error unable to execute QEMU command 'device_add': Bus 'pci.0' does
not support hotplugging
2014-12-16 13:22:50.832+0000: 5305: warning : qemuDomainAttachPciDiskDevice:255
: qemuMonitorAddDevice failed on
file=/dev/disk/by-id/md-name-cedric:new,if=none,id=drive-virtio-disk3,format=raw,cache=none
(virtio-blk-pci,scsi=off,bus=pci.0,addr=0xb,drive=drive-virtio-disk3,id=virtio-disk3)
>From strace it seems that the commands that are being sent to kvm are:
5302 write(21,
"{\"execute\":\"drive_add\",\"arguments\":{\"pci_addr\":\"dummy\",\"opts\":\"file=/dev/disk/by-id/md-name-cedric:new,if=none,id=drive-virtio-disk3,format=raw,cache=none\"},\"id\":\"libvirt-31\"}\r\n",
177) = 177
which gets
5302 read(21, "{\"id\": \"libvirt-31\", \"error\": {\"class\":
\"CommandNotFound\", \"desc\": \"The command drive_add has not been found\",
\"data\": {\"name\": \"drive_add\"}}}\r\n", 1023) = 144
So it tries
5302 write(21,
"{\"execute\":\"human-monitor-command\",\"arguments\":{\"command-line\":\"drive_add
dummy
file=/dev/disk/by-id/md-name-cedric:new,if=none,id=drive-virtio-disk3,format=raw,cache=none\"},\"id\":\"libvirt-32\"}\r\n",
194) = 194
reply:
5302 read(21, "{\"return\": \"Duplicate ID 'drive-virtio-disk3' for
drive\\r\\n\", \"id\": \"libvirt-32\"}\r\n", 1023) = 83
Then:
5302 write(21,
"{\"execute\":\"device_add\",\"arguments\":{\"driver\":\"virtio-blk-pci\",\"scsi\":\"off\",\"bus\":\"pci.0\",\"addr\":\"0xd\",\"drive\":\"drive-virtio-disk3\",\"id\":\"virtio-disk3\"},\"id\":\"libvirt-33\"}\r\n",
173) = 173
which gets:
5302 read(21, "{\"id\": \"libvirt-33\", \"error\": {\"class\":
\"BusNoHotplug\", \"desc\": \"Bus 'pci.0' does not support hotplugging\",
\"data\": {\"bus\": \"pci.0\"}}}\r\n", 1023) = 136
Game over.
-- Package-specific info:
/proc/cpuinfo:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Xeon(R) CPU 3050 @ 2.13GHz
stepping : 2
microcode : 0x51
cpu MHz : 2133.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm
constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor
ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm dtherm tpr_shadow
bogomips : 4266.83
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Xeon(R) CPU 3050 @ 2.13GHz
stepping : 2
microcode : 0x51
cpu MHz : 1600.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm
constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor
ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm dtherm tpr_shadow
bogomips : 4266.83
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
-- System Information:
Debian Release: 7.7
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.16-0.bpo.2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages qemu-kvm depends on:
ii adduser 3.113+nmu3
ii ipxe-qemu 1.0.0+git-20120202.f6840ba-3
ii libaio1 0.3.109-3
ii libasound2 1.0.25-4
ii libbluetooth3 4.99-2
ii libbrlapi0.5 4.4-10+deb7u1
ii libc6 2.13-38+deb7u6
ii libcurl3-gnutls 7.26.0-1+wheezy11
ii libglib2.0-0 2.33.12+really2.32.4-5
ii libgnutls26 2.12.20-8+deb7u2
ii libiscsi1 1.4.0-3
ii libjpeg8 8d-1+deb7u1
ii libncurses5 5.9-10
ii libpng12-0 1.2.49-1
ii libpulse0 2.0-6.1
ii libsasl2-2 2.1.25.dfsg1-6+deb7u1
ii libsdl1.2debian 1.2.15-5
ii libspice-server1 0.11.0-1+deb7u1
ii libtinfo5 5.9-10
ii libusbredirparser0 0.4.3-2
ii libuuid1 2.20.1-5.3
ii libvdeplug2 2.3.2-4
ii libx11-6 2:1.5.0-1+deb7u1
ii python 2.7.3-4+deb7u1
ii qemu-keymaps 1.1.2+dfsg-6a+deb7u6
ii qemu-utils 1.1.2+dfsg-6a+deb7u6
ii seabios 1.7.0-1
ii vgabios 0.7a-3
ii zlib1g 1:1.2.7.dfsg-13
Versions of packages qemu-kvm recommends:
ii bridge-utils 1.5-6
ii iproute 20120521-3+b3
Versions of packages qemu-kvm suggests:
ii debootstrap 1.0.48+deb7u1
pn samba <none>
pn vde2 <none>
-- no debconf information
--- End Message ---