live attached disk cannot be found in the guest VM sometimes

2012-10-08 Thread Wangpan
Hi all,
I got a issue when attach disk to a qemu-kvm guest(kernel version: Linux debian 
3.2.0-3-amd64 #1 SMP Thu Jun 28 09:07:26 UTC 2012 x86_64 GNU/Linux)
The steps are:
1. using libvirt API start a guest
2. 'ping' the IP address of the guest once each time
3. when 'ping' return OK, I attach a ISCSI LVM disk into the guest by libvirt 
API, and the disk appears in the guest
this works successfully most of the time,
BUT sometimes I cannot see the disk in the guest(by 'fdisk -l') evenif the 
libvirt API return OK and I can see the disk is in the XML configuration dumped 
by 'virsh dumpxml'.

I check the syslog of the guest, and guess the reason may be that, the attach 
operation is before the kernel module loaded(pci_hotplug/acpiphp), so the 
attached disk doesn't appear in the guest. Is this right?
Log messages:
qemu log: 2012-10-08 09:47:31.753+: starting up(guest starts time, UTC 
should +8 to CST)
libvirt API call log: 2012-10-08 17:47:36,931 INFO Attach volume 1449 into 
virtual machine device 11606f9e-98ee-4857-99ea-14a576037bfc begin...
2012-10-08 17:47:37,757 INFO Successfully attach volume 1449 into 
11606f9e-98ee-4857-99ea-14a576037bfc, virtual machine device: /dev/ebs/xdey
syslog: Oct 8 17:47:42 debian kernel: imklog 5.8.11, log source = /proc/kmsg 
started

Any suggestion is welcome, thanks in advance.
Wangpan

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: live attached disk cannot be found in the guest VM sometimes

2012-10-08 Thread Wangpan
Another thing should be concerned:
when I attach another disk after a disk attached but cannot found in guest,
the TWO disks all appear in guest!

Oct  9 10:45:24 debian kernel: [61068.049509] pci :00:11.0: [1af4:1001] 
type 0 class 0x000100
Oct  9 10:45:24 debian kernel: [61068.049715] pci :00:11.0: reg 10: [io  
0x-0x003f]
Oct  9 10:45:24 debian kernel: [61068.049813] pci :00:11.0: reg 14: [mem 
0x-0x0fff]
Oct  9 10:45:24 debian kernel: [61068.051544] pci :00:11.0: BAR 1: assigned 
[mem 0xe000-0xefff]
Oct  9 10:45:24 debian kernel: [61068.051584] pci :00:11.0: BAR 1: set to 
[mem 0xe000-0xefff] (PCI address [0xe000-0xefff])
Oct  9 10:45:24 debian kernel: [61068.051591] pci :00:11.0: BAR 0: assigned 
[io  0x1000-0x103f]
Oct  9 10:45:24 debian kernel: [61068.051623] pci :00:11.0: BAR 0: set to 
[io  0x1000-0x103f] (PCI address [0x1000-0x103f])
Oct  9 10:45:24 debian kernel: [61068.051633] pci :00:00.0: no hotplug 
settings from platform
Oct  9 10:45:24 debian kernel: [61068.051636] pci :00:00.0: using default 
PCI settings
Oct  9 10:45:24 debian kernel: [61068.051695] pci :00:01.0: no hotplug 
settings from platform
Oct  9 10:45:24 debian kernel: [61068.051698] pci :00:01.0: using default 
PCI settings
Oct  9 10:45:24 debian kernel: [61068.051756] ata_piix :00:01.1: no hotplug 
settings from platform
Oct  9 10:45:24 debian kernel: [61068.051759] ata_piix :00:01.1: using 
default PCI settings
Oct  9 10:45:24 debian kernel: [61068.051818] uhci_hcd :00:01.2: no hotplug 
settings from platform
Oct  9 10:45:24 debian kernel: [61068.051820] uhci_hcd :00:01.2: using 
default PCI settings
Oct  9 10:45:24 debian kernel: [61068.051878] piix4_smbus :00:01.3: no 
hotplug settings from platform
Oct  9 10:45:24 debian kernel: [61068.051880] piix4_smbus :00:01.3: using 
default PCI settings
Oct  9 10:45:24 debian kernel: [61068.051938] pci :00:02.0: no hotplug 
settings from platform
Oct  9 10:45:24 debian kernel: [61068.051941] pci :00:02.0: using default 
PCI settings
Oct  9 10:45:24 debian kernel: [61068.052021] virtio-pci :00:03.0: no 
hotplug settings from platform
Oct  9 10:45:24 debian kernel: [61068.052021] virtio-pci :00:03.0: using 
default PCI settings
Oct  9 10:45:24 debian kernel: [61068.052146] virtio-pci :00:04.0: no 
hotplug settings from platform
Oct  9 10:45:24 debian kernel: [61068.052146] virtio-pci :00:04.0: using 
default PCI settings
Oct  9 10:45:24 debian kernel: [61068.052173] virtio-pci :00:05.0: no 
hotplug settings from platform
Oct  9 10:45:24 debian kernel: [61068.052175] virtio-pci :00:05.0: using 
default PCI settings
Oct  9 10:45:24 debian kernel: [61068.052311] virtio-pci :00:06.0: no 
hotplug settings from platform
Oct  9 10:45:24 debian kernel: [61068.052316] virtio-pci :00:06.0: using 
default PCI settings
Oct  9 10:45:24 debian kernel: [61068.052337] pci :00:11.0: no hotplug 
settings from platform
Oct  9 10:45:24 debian kernel: [61068.052337] pci :00:11.0: using default 
PCI settings
Oct  9 10:45:24 debian kernel: [61068.052939] virtio-pci :00:11.0: enabling 
device ( - 0003)   the new attached disk//
Oct  9 10:45:24 debian kernel: [61068.053982] virtio-pci :00:11.0: PCI INT 
A - Link[LNKA] - GSI 10 (level, high) - IRQ 10
Oct  9 10:45:24 debian kernel: [61068.054199] virtio-pci :00:11.0: setting 
latency timer to 64
Oct  9 10:45:24 debian kernel: [61068.054930] virtio-pci :00:11.0: irq 47 
for MSI/MSI-X
Oct  9 10:45:24 debian kernel: [61068.054964] virtio-pci :00:11.0: irq 48 
for MSI/MSI-X
Oct  9 10:45:25 debian kernel: [61068.219537]  vdc: unknown partition table  
/the new attached disk/
Oct  9 10:45:25 debian kernel: [61068.221828] pci :00:10.0: [1af4:1001] 
type 0 class 0x000100
Oct  9 10:45:25 debian kernel: [61068.222047] pci :00:10.0: reg 10: [io  
0x-0x003f]
Oct  9 10:45:25 debian kernel: [61068.222145] pci :00:10.0: reg 14: [mem 
0x-0x0fff]
Oct  9 10:45:25 debian kernel: [61068.223162] pci :00:10.0: BAR 1: assigned 
[mem 0xe0001000-0xe0001fff]
Oct  9 10:45:25 debian kernel: [61068.223223] pci :00:10.0: BAR 1: set to 
[mem 0xe0001000-0xe0001fff] (PCI address [0xe0001000-0xe0001fff])
Oct  9 10:45:25 debian kernel: [61068.223223] pci :00:10.0: BAR 0: assigned 
[io  0x1040-0x107f]
Oct  9 10:45:25 debian kernel: [61068.223260] pci :00:10.0: BAR 0: set to 
[io  0x1040-0x107f] (PCI address [0x1040-0x107f])
Oct  9 10:45:25 debian kernel: [61068.223427] pci :00:00.0: no hotplug 
settings from platform
Oct  9 10:45:25 debian kernel: [61068.223430] pci :00:00.0: using default 
PCI settings
Oct  9 10:45:25 debian kernel: [61068.223495] pci :00:01.0: no hotplug 
settings from platform
Oct  9 10:45:25 debian kernel: [61068.223497] pci :00:01.0: using default 
PCI settings
Oct