qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] SCSI CD-ROM hotplug problem
@ 2013-04-25 13:40 Liuji (Jeremy)
  2013-04-25 14:37 ` Stefan Hajnoczi
  2013-04-29  8:26 ` Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: Liuji (Jeremy) @ 2013-04-25 13:40 UTC (permalink / raw)
  To: qemu-devel@nongnu.org; +Cc: Luohao (brian), Haofeng

Hello, everyone

I have a question about hotplug of cd-rom.

version of qemu: Apr-22-2013   bb71623811686ce3c34ce724f073f5c5dd95f51b

1) start the vm:
qemu-kvm -enable-kvm -m 1024 -smp 2 -boot c -drive file=/home/vm/winxp.qcow2,if=none,id=drive0,format=qcow2 
-device virtio-blk-pci,scsi=off,drive=drive0,id=disk0 -monitor stdio -vnc 186.100.8.136:1 
-device lsi,id=scsi0,bus=pci.0

2) use "drive_add" and "device_add" commands to hotplug a cd-rom:
(qemu) drive_add 0 file=/home/vm/aaa.iso,if=none,id=my-cdrom-drive,readonly=on,format=raw
(qemu) device_add scsi-cd,bus=scsi0.0,scsi-id=2,drive=my-cdrom-drive,id=my-cdrom

3) but I can't find the new cd-rom in the WindowXP vm.

4) and then, I use "pci_add" command to hotplug another cd-rom:
(qemu) pci_add auto storage file=/home/vm/bbb.iso,if=scsi,readonly=on,format=raw,media=cdrom

5) I not only found the second cd-rom, but also found first cd-rom in the WindowXP vm.

When I only use "pci_add" command, I can hotplug a cd-rom successfully.

Would you please tell me how to use "drive_add" and "device_add" commands to hotplug a cd-rom?


Best Regards,

Jeremy Liu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] SCSI CD-ROM hotplug problem
  2013-04-25 13:40 [Qemu-devel] SCSI CD-ROM hotplug problem Liuji (Jeremy)
@ 2013-04-25 14:37 ` Stefan Hajnoczi
  2013-04-29  8:26 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2013-04-25 14:37 UTC (permalink / raw)
  To: Liuji (Jeremy); +Cc: Luohao (brian), qemu-devel@nongnu.org, Haofeng

On Thu, Apr 25, 2013 at 01:40:41PM +0000, Liuji (Jeremy) wrote:
> I have a question about hotplug of cd-rom.
> 
> version of qemu: Apr-22-2013   bb71623811686ce3c34ce724f073f5c5dd95f51b
> 
> 1) start the vm:
> qemu-kvm -enable-kvm -m 1024 -smp 2 -boot c -drive file=/home/vm/winxp.qcow2,if=none,id=drive0,format=qcow2 
> -device virtio-blk-pci,scsi=off,drive=drive0,id=disk0 -monitor stdio -vnc 186.100.8.136:1 
> -device lsi,id=scsi0,bus=pci.0

The LSI SCSI controller is not actively maintained and has known issues
(see the bug tracker on launchpad).  You're on your own if you use this
device.

> 2) use "drive_add" and "device_add" commands to hotplug a cd-rom:
> (qemu) drive_add 0 file=/home/vm/aaa.iso,if=none,id=my-cdrom-drive,readonly=on,format=raw
> (qemu) device_add scsi-cd,bus=scsi0.0,scsi-id=2,drive=my-cdrom-drive,id=my-cdrom
> 
> 3) but I can't find the new cd-rom in the WindowXP vm.
> 
> 4) and then, I use "pci_add" command to hotplug another cd-rom:
> (qemu) pci_add auto storage file=/home/vm/bbb.iso,if=scsi,readonly=on,format=raw,media=cdrom
> 
> 5) I not only found the second cd-rom, but also found first cd-rom in the WindowXP vm.
> 
> When I only use "pci_add" command, I can hotplug a cd-rom successfully.
> 
> Would you please tell me how to use "drive_add" and "device_add" commands to hotplug a cd-rom?

The reason why pci_add appears to work is because it hotplugs a new LSI
PCI adapter instead of just attaching a new SCSI CD-ROM to the existing
bus.  You can check this by using the Device Manager in Windows to show
storage controllers/PCI adapters.

Perhaps the hotplug of a new adapter causes the Windows XP SCSI
subsystem to rescan all adapters...

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] SCSI CD-ROM hotplug problem
  2013-04-25 13:40 [Qemu-devel] SCSI CD-ROM hotplug problem Liuji (Jeremy)
  2013-04-25 14:37 ` Stefan Hajnoczi
@ 2013-04-29  8:26 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2013-04-29  8:26 UTC (permalink / raw)
  To: Liuji (Jeremy); +Cc: Luohao (brian), qemu-devel@nongnu.org, Haofeng

Il 25/04/2013 15:40, Liuji (Jeremy) ha scritto:
> Hello, everyone
> 
> I have a question about hotplug of cd-rom.
> 
> version of qemu: Apr-22-2013   bb71623811686ce3c34ce724f073f5c5dd95f51b
> 
> 1) start the vm:
> qemu-kvm -enable-kvm -m 1024 -smp 2 -boot c -drive file=/home/vm/winxp.qcow2,if=none,id=drive0,format=qcow2 
> -device virtio-blk-pci,scsi=off,drive=drive0,id=disk0 -monitor stdio -vnc 186.100.8.136:1 
> -device lsi,id=scsi0,bus=pci.0
> 
> 2) use "drive_add" and "device_add" commands to hotplug a cd-rom:
> (qemu) drive_add 0 file=/home/vm/aaa.iso,if=none,id=my-cdrom-drive,readonly=on,format=raw
> (qemu) device_add scsi-cd,bus=scsi0.0,scsi-id=2,drive=my-cdrom-drive,id=my-cdrom
> 
> 3) but I can't find the new cd-rom in the WindowXP vm.

This is because Windows has not rescanned the SCSI bus.  To force a
rescan, open a command prompt, then type "diskpart" and then "rescan".

> 4) and then, I use "pci_add" command to hotplug another cd-rom:
> (qemu) pci_add auto storage file=/home/vm/bbb.iso,if=scsi,readonly=on,format=raw,media=cdrom

This works because it adds an entirely new SCSI controller.

> 5) I not only found the second cd-rom, but also found first cd-rom in the WindowXP vm.

This is probably some oddity of Windows, which forces a rescan of all
SCSI buses when a new controller is hot-plugged---or something like that.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-29  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-25 13:40 [Qemu-devel] SCSI CD-ROM hotplug problem Liuji (Jeremy)
2013-04-25 14:37 ` Stefan Hajnoczi
2013-04-29  8:26 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).