From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Bareiro Subject: Re: Hot-adding disk on VM Date: Sun, 11 Oct 2009 18:51:47 -0300 Message-ID: <20091011215147.GD22687@defiant.freesoftware.org> References: <20090822135947.GB7505@defiant.freesoftware.org> Reply-To: dbareiro@gmx.net Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ghzN8eJ9Qlbqn3iT" To: KVM General Return-path: Received: from mail.gmx.net ([213.165.64.20]:34641 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752111AbZJKVwj (ORCPT ); Sun, 11 Oct 2009 17:52:39 -0400 Received: from defiant (defiant.freesoftware.org [10.1.0.65]) by hermes.freesoftware.org (Postfix) with ESMTP id 660164A8 for ; Sun, 11 Oct 2009 18:51:37 -0300 (ART) Content-Disposition: inline In-Reply-To: <20090822135947.GB7505@defiant.freesoftware.org> Sender: kvm-owner@vger.kernel.org List-ID: --ghzN8eJ9Qlbqn3iT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, all! On Saturday, 22 August 2009 10:59:47 -0300, Daniel Bareiro wrote: > According to I see in this document [1], is necessary that is loaded > two modules in the guest: acpiphp and pci_hotplug. >=20 > The pci_hotplug module is loaded. Nevertheless, in spite of existing > the acpiphp module, cannot be loaded: >=20 > chandra:~# lsmod|grep pci_hotplug > pci_hotplug 23460 0 >=20 > chandra:~# modprobe acpiphp > FATAL: Error inserting acpiphp > (/lib/modules/2.6.26-2-686/kernel/drivers/pci/hotplug/acpiphp.ko): No suc= h device >=20 > chandra:~# locate acpiphp | grep 686 > /lib/modules/2.6.26-2-686/kernel/drivers/pci/hotplug/acpiphp.ko > /lib/modules/2.6.26-2-686/kernel/drivers/pci/hotplug/acpiphp_ibm.ko >=20 >=20 > Which could be being the problem? I was doing other tests this time with Linux 2.6.31.2 compiled by myself =66rom the sources of kernel.org. This time with loading the acpiphp module, the pci_hotplug module was loaded automatically without I get some type of error message. central:~# lsmod | grep acpiphp central:~# central:~# modprobe acpiphp central:~# central:~# lsmod | grep acpiphp acpiphp 22140 0 pci_hotplug 29024 1 acpiphp Then, I tried to add a disk of the following way in host: (qemu) pci_add auto storage file=3D/dev/vm/central-test,if=3Dvirtio OK domain 0, bus 0, slot 5, function 0 In the guest: Oct 11 18:09:01 central kernel: [ 833.403875] pci 0000:00:02.0: BAR 6: bog= us alignment [0x0-0x0] flags 0x2 Oct 11 18:09:01 central kernel: [ 833.406337] decode_hpp: Could not get ho= tplug parameters. Use defaults Oct 11 18:09:01 central kernel: [ 833.430492] virtio-pci 0000:00:05.0: ena= bling device (0000 -> 0001) Oct 11 18:09:01 central kernel: [ 833.452268] ACPI: PCI Interrupt Link [LN= KA] enabled at IRQ 10 Oct 11 18:09:01 central kernel: [ 833.454668] virtio-pci 0000:00:05.0: PCI= INT A -> Link[LNKA] -> GSI 10 (level, high) -> IRQ 10 Oct 11 18:09:01 central kernel: [ 833.500051] Clocksource tsc unstable (de= lta =3D -148257950 ns) Oct 11 18:09:01 central kernel: [ 833.566755] vda: vda1 Then I attempt to remove the device assuring previously that it is not being used in guest: (qemu) pci_del 5 In the guest: Oct 11 18:13:32 central kernel: [ 1104.144179] virtio-pci 0000:00:05.0: PCI= INT A disabled But if I want to add the device again, I get a segmentation fault of the process that handles this virtual machine: (qemu) pci_add auto storage file=3D/dev/vm/central-test,if=3Dvirtio Connection closed by foreign host. root@ubuntu:~# tail -f /var/log/messages [...] Oct 11 18:21:29 ubuntu kernel: [692002.207026] qemu-system-x86[3481]: segfa= ult at 8d0 ip 000000000041a183 sp 00007fff848ef9f0 error 6 in qemu-system-x= 86_64[400000+219000] Oct 11 18:21:29 ubuntu kernel: [692002.291714] br0: port 4(tap2) entering d= isabled state Oct 11 18:21:29 ubuntu kernel: [692002.330875] br0: port 4(tap2) entering d= isabled state Also I was testing using if=3Dscsi and when I trying to remove the device, can be seen a 'tainted' in guest. In host: (qemu) pci_add auto storage file=3D/dev/vm/central-test,if=3Dscsi In guest: Oct 11 18:35:51 central kernel: [ 199.375026] pci 0000:00:02.0: BAR 6: bog= us alignment [0x0-0x0] flags 0x2 Oct 11 18:35:51 central kernel: [ 199.377801] decode_hpp: Could not get ho= tplug parameters. Use defaults Oct 11 18:35:51 central kernel: [ 199.484410] sym53c8xx 0000:00:05.0: enab= ling device (0000 -> 0003) Oct 11 18:35:51 central kernel: [ 199.495739] ACPI: PCI Interrupt Link [LN= KA] enabled at IRQ 10 Oct 11 18:35:51 central kernel: [ 199.498165] sym53c8xx 0000:00:05.0: PCI = INT A -> Link[LNKA] -> GSI 10 (level, high) -> IRQ 10 Oct 11 18:35:51 central kernel: [ 199.503886] sym0: <895a> rev 0x0 at pci = 0000:00:05.0 irq 10 Oct 11 18:35:51 central kernel: [ 199.508711] sym0: No NVRAM, ID 7, Fast-4= 0, LVD, parity checking Oct 11 18:35:51 central kernel: [ 199.512023] sym0: SCSI BUS has been rese= t. Oct 11 18:35:51 central kernel: [ 199.530575] scsi2 : sym-2.2.3 Oct 11 18:35:54 central kernel: [ 202.512229] scsi 2:0:0:0: Direct-Access = QEMU QEMU HARDDISK 0.10 PQ: 0 ANSI: 3 Oct 11 18:35:54 central kernel: [ 202.515687] target2:0:0: tagged command= queuing enabled, command queue depth 16. Oct 11 18:35:54 central kernel: [ 202.519013] target2:0:0: Beginning Doma= in Validation Oct 11 18:35:54 central kernel: [ 202.521737] target2:0:0: Domain Validat= ion skipping write tests Oct 11 18:35:54 central kernel: [ 202.524167] target2:0:0: Ending Domain = Validation Oct 11 18:35:54 central kernel: [ 202.530816] sd 2:0:0:0: Attached scsi ge= neric sg3 type 0 Oct 11 18:35:54 central kernel: [ 202.533321] sd 2:0:0:0: [sdc] 10485760 5= 12-byte logical blocks: (5.36 GB/5.00 GiB) Oct 11 18:35:54 central kernel: [ 202.536661] sd 2:0:0:0: [sdc] Write Prot= ect is off Oct 11 18:35:54 central kernel: [ 202.538825] sd 2:0:0:0: [sdc] Write cach= e: enabled, read cache: enabled, doesn't support DPO or FUA Oct 11 18:35:54 central kernel: [ 202.543108] sdc: sdc1 Oct 11 18:35:54 central kernel: [ 202.557622] sd 2:0:0:0: [sdc] Attached S= CSI disk Then I attempt to remove the device assuring previously that it is not being used in guest: (qemu) pci_del 5 In the guest: Oct 11 18:35:54 central kernel: [ 202.557622] sd 2:0:0:0: [sdc] Attached S= CSI disk =20 Oct 11 18:38:11 central kernel: [ 338.629461] sd 2:0:0:0: [sdc] Synchroniz= ing SCSI cache =20 Oct 11 18:38:11 central kernel: [ 338.631863] sym0: detaching ... = =20 Oct 11 18:38:11 central kernel: [ 338.633432] sym0: resetting chip = =20 Oct 11 18:38:11 central kernel: [ 338.635014] ------------[] cut here ]---= --------- =20 Oct 11 18:38:11 central kernel: [ 338.636999] WARNING: at /space/src/linux= -2.6.31.2/arch/x86/include/asm/dma-mapping.h:132 ___free_dma_mem_cluster+0x= 78/0xd4 [sym53c8xx]() = =20 Oct 11 18:38:11 central kernel: [ 338.637414] Hardware name: = =20 Oct 11 18:38:11 central kernel: [ 338.637414] Modules linked in: sym53c8xx= scsi_transport_spi acpiphp pci_hotplug loop serio_raw psmouse snd_pcsp par= port_pc parport snd_pcm snd_timer virtio_net virtio_balloon snd soundcore snd_page_alloc button processor i2c_piix4 i2c_= core evdev ext3 jbd mbcache sg sr_mod cdrom sd_mod piix ide_pci_generic ide= _core ata_piix ata_generic libata virtio_pci virtio_ring virtio scsi_mod thermal fan thermal_sys [last unloaded: scsi_wa= it_scan] =20 Oct 11 18:38:11 central kernel: [ 338.637414] Pid: 75, comm: kacpi_notify = Not tainted 2.6.31.2-dgb #1 =20 Oct 11 18:38:11 central kernel: [ 338.637414] Call Trace: = =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? ___f= ree_dma_mem_cluster+0x78/0xd4 [sym53c8xx] =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? ___f= ree_dma_mem_cluster+0x78/0xd4 [sym53c8xx] =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? warn= _slowpath_common+0x77/0xa3 =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? acpi= _os_execute_deferred+0x0/0x2c =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? ___f= ree_dma_mem_cluster+0x78/0xd4 [sym53c8xx] =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? __sy= m_mfree_dma+0x9d/0xc2 [sym53c8xx] =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? acpi= _os_execute_deferred+0x0/0x2c =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? sym_= hcb_free+0x79/0x1af [sym53c8xx] =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? sym_= free_resources+0x52/0x71 [sym53c8xx] =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? sym_= detach+0x9e/0xb5 [sym53c8xx] =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? sym2= _remove+0x24/0x40 [sym53c8xx] =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? pci_= device_remove+0x24/0x47 =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? __de= vice_release_driver+0x77/0xbf =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? devi= ce_release_driver+0x1e/0x2a =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? bus_= remove_device+0x9f/0xbe =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? devi= ce_del+0x130/0x16e =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? devi= ce_unregister+0x9/0x12 =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? pci_= stop_bus_device+0x53/0x5f =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? acpi= php_disable_slot+0x95/0x1af [acpiphp] =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? up+0= xe/0x36 =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? acpi= _os_execute_deferred+0x0/0x2c =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? hand= le_hotplug_event_func+0x10c/0x13e [acpiphp] =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? acpi= _bus_get_device+0x1d/0x2e =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? acpi= _bus_notify+0x43/0x79 =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? acpi= _ev_notify_dispatch+0x57/0x61 =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? acpi= _os_execute_deferred+0x23/0x2c =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? work= er_thread+0x173/0x20f =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? auto= remove_wake_function+0x0/0x2e =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? work= er_thread+0x0/0x20f =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? kthr= ead+0x8b/0x93 =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? chil= d_rip+0xa/0x20 =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? kthr= ead+0x0/0x93 =20 Oct 11 18:38:11 central kernel: [ 338.637414] [] ? chil= d_rip+0x0/0x20 =20 Oct 11 18:38:11 central kernel: [ 338.637414] ---[] end trace 446c5343fa73= 22b8 ]--- =20 Oct 11 18:38:11 central kernel: [ 338.755839] ------------[] cut here ]---= --------- [ ... This error appears four times followed in log ... ] Oct 11 18:38:11 central kernel: [ 339.333405] sym53c8xx 0000:00:05.0: PCI = INT A disabled I try to add the disk again: (qemu) pci_add auto storage file=3D/dev/vm/central-test,if=3Dscsi OK domain 0, bus 0, slot 5, function 0 But this time in guest is not finished making the detection: Oct 11 18:43:17 central kernel: [ 645.159958] pci 0000:00:02.0: BAR 6: bog= us alignment [0x0-0x0] flags 0x2 Oct 11 18:43:17 central kernel: [ 645.162594] decode_hpp: Could not get ho= tplug parameters. Use defaults Oct 11 18:43:17 central kernel: [ 645.172372] sym53c8xx 0000:00:05.0: enab= ling device (0000 -> 0003) Oct 11 18:43:17 central kernel: [ 645.174952] sym53c8xx 0000:00:05.0: PCI = INT A -> Link[LNKA] -> GSI 10 (level, high) -> IRQ 10 Oct 11 18:43:17 central kernel: [ 645.180729] sym0: <895a> rev 0x0 at pci = 0000:00:05.0 irq 10 Oct 11 18:43:17 central kernel: [ 645.202337] sym0: No NVRAM, ID 7, Fast-4= 0, LVD, parity checking Oct 11 18:43:17 central kernel: [ 645.208610] sym0: SCSI BUS has been rese= t. Oct 11 18:43:17 central kernel: [ 645.224164] scsi3 : sym-2.2.3 And from this moment I'm not able to remove the disk. Which can now be the problem? Thanks in advance for your reply. Regards, Daniel --=20 Fingerprint: BFB3 08D6 B4D1 31B2 72B9 29CE 6696 BF1B 14E6 1D37 Powered by Debian GNU/Linux Squeeze - Linux user #188.598 --ghzN8eJ9Qlbqn3iT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkrSU3MACgkQZpa/GxTmHTeUSQCcC8KsU5rCRVRoQ1CI9AgTBd/O o9AAn3aDHnUEZSmwgQsRYsP9JliGpn65 =iF/v -----END PGP SIGNATURE----- --ghzN8eJ9Qlbqn3iT--