From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tokarev Subject: a few words about drive/pci add/remove Date: Wed, 17 Jun 2009 17:44:15 +0400 Message-ID: <4A38F32F.1040404@msgid.tls.msk.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: kvm-devel Return-path: Received: from isrv.corpit.ru ([81.13.33.159]:43924 "EHLO isrv.corpit.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754841AbZFQNoR (ORCPT ); Wed, 17 Jun 2009 09:44:17 -0400 Sender: kvm-owner@vger.kernel.org List-ID: I tried drive hot add/remove today. And immediately had a few.. issues. qemu-kvm-0.10.5. First of all, there are several "definitions" of drive_add and several others in `help' monitor command output: This one appears to be real: drive_add pci_addr=[[:]:] [file=file][,if=type][,bus=n] [,unit=m][,media=d][index=i] [,cyls=c,heads=h,secs=s[,trans=t]] [snapshot=on|off][,cache=on|off] -- add drive to PCI storage controller And this, a few lines below it, is "fake": drive_add pcibus pcidevfn [file=file][,if=type][,bus=n] [,unit=m][,media=d][index=i] [,cyls=c,heads=h,secs=s[,trans=t]] Note also the "cache" argument is not the same as it is for -drive command-line argument. Ok, so trying the first option (after looking at the source and after noticing the first correct form), I realized it does not work. Or at least I can't get it to work. It either says the PCI slot mentioned is in use (when specifying pci_addr= which is present in the guest), or that the given slot does not exists. Ok, so I discovered also pci_add. That one worked, and I've got new pci device in guest which recognized it nicely. Now, after realizing I added the wrong file ;), I tried to remove it -- and got an instant warning in the guest: WARNING: at drivers/base/core.c:122 device_release+0x5f/0x70() Device 'virtio8' does not have a release() function, it is broken and must be fixed. Modules linked in: acpiphp dock pci_hotplug xfs e1000 button ext3 jbd mbcache virtio_blk virtio_net virtio_pci virtio_ring virtio Pid: 39, comm: kacpi_notify Tainted: G S 2.6.27-i686smp #2.6.27.25 [] warn_slowpath+0x6f/0xa0 [] generic_set_mtrr+0x50/0x110 [] __wake_up+0x3e/0x60 [] release_sysfs_dirent+0x45/0xb0 [] sysfs_addrm_finish+0x1b1/0x1f0 [] remove_dir+0x27/0x40 [] sysfs_remove_dir+0x5f/0x70 ... [] virtio_pci_remove+0x11/0x4c [virtio_pci] ... When trying to re-add another (right this time) drive the same way (using pci_addr=auto), the guest crashed. JFYI for now. Thanks. /mjt