[qemu-kvm] unable to execute QEMU command 'device_add': Duplicate ID 'virtio-disk4' for device

2012-12-04 Thread Wangpan
Hi all, 
I am using qemu-kvm recantly, version info:
# kvm --version
QEMU emulator version 1.1.2 (qemu-kvm-1.1.2+dfsg-2, Debian), Copyright (c) 
2003-2008 Fabrice Bellard 
 
# virsh version 
Compiled against library: libvir 0.9.12 
Using library: libvir 0.9.12 
Using API: QEMU 0.9.12 
Running hypervisor: QEMU 1.1.2 

# uname -a (both the host and guest)
Linux Debian 3.2.0-3-amd64 #1 SMP Thu Jun 28 09:07:26 UTC 2012 x86_64 GNU/Linux
#  cat /etc/issue (both the host and guest)
Debian GNU/Linux wheezy/sid
 
and I get into trouble when I attach detach a disk to a guest, libvirt give me 
this error message: unable to execute QEMU command 'device_add': Duplicate ID 
'virtio-disk4' for device 
the steps I did:
1) attach a disk to a guest by virsh attach-device
2) wait for 1s
3) detach the disk by virsh detach-device
4) wait for 1s
5) repeat step 1~4
after doing these steps about 12hours, the Duplicate ID error occurs,
if I don't run step 24, the error occurs at a short time.

anyone can give me some clues?
Thanks in advance!

Best Regards
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


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
  9 10:45:25 debian kernel: [61068.223555] ata_piix :00:01.1: no hotplug 
settings from platform
Oct  9 10:45:25 debian kernel: [61068.223558] ata_piix :00:01.1: using 
default PCI settings
Oct  9 10:45:25 debian kernel: [61068.223616] uhci_hcd :00:01.2: no hotplug 
settings from platform
Oct  9 10:45:25 debian kernel: [61068.223618] uhci_hcd :00:01.2: using 
default PCI settings
Oct  9 10:45:25 debian kernel: [61068.223676] piix4_smbus :00:01.3: no 
hotplug settings from platform
Oct  9 10:45:25 debian kernel: [61068.223679] piix4_smbus :00:01.3: using 
default PCI settings
Oct  9 10:45:25 debian kernel: [61068.223736] pci :00:02.0: no hotplug 
settings from platform
Oct  9 10:45:25 debian kernel: [61068.223738] pci :00:02.0: using default 
PCI settings
Oct  9 10:45:25 debian kernel: [61068.223843] virtio-pci :00:03.0: no 
hotplug settings from platform
Oct  9 10:45:25 debian kernel: [61068.223843] virtio-pci :00:03.0: using 
default PCI settings
Oct  9 10:45:25 debian kernel: [61068.223856] virtio-pci :00:04.0: no 
hotplug settings from platform
Oct  9 10:45:25 debian kernel: [61068.223868] virtio-pci :00:04.0: using 
default PCI settings
Oct  9 10:45:25 debian kernel: [61068.223926] virtio-pci :00:05.0: no 
hotplug settings from platform
Oct  9 10:45:25 debian kernel: [61068.223929] virtio-pci :00:05.0: using 
default PCI settings
Oct  9 10:45:25 debian kernel: [61068.224024] virtio-pci :00:06.0: no 
hotplug settings from platform
Oct  9 10:45:25 debian kernel: [61068.224068] virtio-pci :00:06.0: using 
default PCI settings
Oct  9 10:45:25 debian kernel: [61068.224169] virtio-pci :00:11.0: no 
hotplug settings from platform
Oct  9 10:45:25 debian kernel: [61068.224169] virtio-pci :00:11.0: using 
default PCI settings
Oct  9 10:45:25 debian kernel: [61068.224274] pci :00:10.0: no hotplug 
settings from platform
Oct  9 10:45:25 debian kernel: [61068.224274] pci :00:10.0: using default 
PCI settings
Oct  9 10:45:25 debian kernel: [61068.225727] virtio-pci :00:10.0: enabling 
device ( - 0003)  ///the disk attached 
yesterday//
Oct  9 10:45:25 debian kernel: [61068.226669] virtio-pci :00:10.0: PCI INT 
A - Link[LNKD] - GSI 11 (level, high) - IRQ 11
Oct  9 10:45:25 debian kernel: [61068.226753] virtio-pci :00:10.0: setting 
latency timer to 64
Oct  9 10:45:25 debian kernel: [61068.228194] virtio-pci :00:10.0: irq 49 
for MSI/MSI-X
Oct  9 10:45:25 debian kernel: [61068.228225] virtio-pci :00:10.0: irq 50 
for MSI/MSI-X
Oct  9 10:45:25 debian kernel: [61068.352200]  vdd: unknown partition table  
the disk attached yesterday///

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: Re: [qemu-kvm] source code compile error: No rule to make target `../libhw64/virtio-console.o', needed by `qemu-system-x86_64'

2012-09-06 Thread Wangpan
On 08/23/2012 03:07 PM, Wangpan wrote: 
 Hi all, 
 I got this error when I compile the source tarball qemu-kvm-1.1.1.tar.gz 
 and qemu-kvm-1.1.0.tar.gz and as well as codes clone from 
 git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git, 
 the compile command I used is ./configure  make. 
 I google this error but find nothing, I have no idea now. 
 anybody can give me some clue? thanks very much! 
  

Strange, do you have hw/virtio-console.c? 

Thanks Avi first
I have known the reason now, it is because someone else set the env 
$GREP_COLOR, so the output of 'grep' cmd is corrupted by the color messages.
When I clear this 'GREP_COLOR' env, the compile procedure is very smoothly.

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


[qemu-kvm] source code compile error: No rule to make target `../libhw64/virtio-console.o', needed by `qemu-system-x86_64'

2012-08-23 Thread Wangpan
Hi all,
I got this error when I compile the source tarball qemu-kvm-1.1.1.tar.gz and 
qemu-kvm-1.1.0.tar.gz and as well as codes clone from 
git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git,
the compile command I used is ./configure  make.
I google this error but find nothing, I have no idea now.
anybody can give me some clue? thanks very much!

2012-08-23
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: Re: How to get the real device in guest os after attached a disk?

2012-07-17 Thread Wangpan
Thanks Stefan,
But how can I get the serial info in the guest os?
I have tried 'hdparm', 'sdparm', 'lshw', 'smartctl' and failed finally.
for example, 
root@debian:~# hdparm -i /dev/vdc

/dev/vdb:
 HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device

The XML be attached is: 
disk type='block' device='disk'
  driver name='qemu' type='raw' cache='none'/
  source dev='/dev/nbd1'/
  target dev='vdc' bus='virtio'/
  serialWD-WMAP9A966149/serial
  alias name='virtio-disk2'/
  address type='pci' domain='0x' bus='0x00' slot='0x0c' 
function='0x0'/
/disk

The kernel info:
root@debian:~# uname -a
Linux debian 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64 GNU/Linux


On Tue, Jul 17, 2012 at 4:40 AM, Wangpan hzwang...@corp.netease.com wrote: 
 I have a question as the subject above, the reason I want to know this is 
 that, if I attach some disks on the guest, 
 for example, I specified /dev/vdc/dev/vdd(target device) at the cmd line by 
 using 'virsh attach-disk', but they may be /dev/vdb/dev/vdc in the guest 
 os, 
 so if the guest user want to detach the /dev/vdb(guest device), he\she will 
 be confused with the two target devices /dev/vdb/dev/vdc, 
 because he\she doesn't know the corresponding relation of the guest device 
 and target device, 
 he\she may detach an error device /dev/vdd(target device) which 
 corresponding to /dev/vdc(guest device). 
 
 Could anyone give me some idea? 

You can use the virtio-blk serial or file system/volume labels to 
distinguish them. 

For libvirt disk serial information, see the Domain XML documentation: 
http://libvirt.org/formatdomain.html#elementsDisks 

Stefan 

--
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


How to get the real device in guest os after attached a disk?

2012-07-16 Thread Wangpan
Hi all,
I have a question as the subject above, the reason I want to know this is that, 
if I attach some disks on the guest,
for example, I specified /dev/vdc/dev/vdd(target device) at the cmd line by 
using 'virsh attach-disk', but they may be /dev/vdb/dev/vdc in the guest os,
so if the guest user want to detach the /dev/vdb(guest device), he\she will be 
confused with the two target devices /dev/vdb/dev/vdc,
because he\she doesn't know the corresponding relation of the guest device and 
target device, 
he\she may detach an error device /dev/vdd(target device) which corresponding 
to /dev/vdc(guest device).

Could anyone give me some idea?
Thanks in advance.

Best Regards
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