Skip to contentSkip to conversation

qemu: add usb-bot support from disks points of view

PATCH Daniel P. Berrange 3 participants 5 messages Sep 2, 2013 – Sep 3, 2013 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 4 lines · Guannan Ren

usb-bot only supports 16 luns(0~15) and they must be contiguous, (using lun 0 and 2 without 1 doesn't work). In this case qemu doesn't throw an error, we can not find the lun 2 in guests. So Adding a checking function in libvirt to prevent from this case.

Hmm, this seems like a problematic restriction.

How does this work if we start off a guest with 3 disks attached to the usb-bot SCSI controller. Then hot-unplug the 2nd disk.

Next time we need will need to start with with LUNs 0 and 2 populated only, otherwise we have ABI change upon migrate or save/restore.

I think this restriction about contiguous luns must be removed if this device is to be usable with multiple luns.

Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
#3 lore raw
Quoted 10 lines · Daniel P. Berrange
Quoted 4 lines · Guannan Ren

usb-bot only supports 16 luns(0~15) and they must be contiguous, (using lun 0 and 2 without 1 doesn't work). In this case qemu doesn't throw an error, we can not find the lun 2 in guests. So Adding a checking function in libvirt to prevent from this case.

Hmm, this seems like a problematic restriction.

How does this work if we start off a guest with 3 disks attached to the usb-bot SCSI controller. Then hot-unplug the 2nd disk.

Currently, the qemu will throw out an error when I hot-unplug any of disks attached to usb-bot controller.

{ "execute": "device_del", "arguments": { "id": "scsi1-0-0-1"}}
{"error": {"class": "GenericError", "desc": "Bus 'scsi1.0' does not support hotplugging"}}

Libvirt will report an error:

# virsh detach-disk rhel64qcow2 sdd --current
error: Failed to detach disk
error: internal error: unable to execute QEMU command 'device_del': Bus 'scsi1.0' does not support hotplugging
Quoted 8 lines

Next time we need will need to start with with LUNs 0 and 2 populated only, otherwise we have ABI change upon migrate or save/restore.

I think this restriction about contiguous luns must be removed if this device is to be usable with multiple luns.

Daniel

#4 lore raw
In reply to Daniel P. Berrange
Quoted 7 lines · Daniel P. Berrange
Quoted 4 lines · Guannan Ren

usb-bot only supports 16 luns(0~15) and they must be contiguous, (using lun 0 and 2 without 1 doesn't work). In this case qemu doesn't throw an error, we can not find the lun 2 in guests. So Adding a checking function in libvirt to prevent from this case.

Hmm, this seems like a problematic restriction.

It's how the hardware works.

Quoted 3 lines

How does this work if we start off a guest with 3 disks attached to the usb-bot SCSI controller. Then hot-unplug the 2nd disk.

You can't hotplug individual luns anyway.

cheers,
Gerd

#5 lore raw
Quoted 9 lines · Gerd Hoffmann
Quoted 7 lines · Daniel P. Berrange
Quoted 4 lines · Guannan Ren

usb-bot only supports 16 luns(0~15) and they must be contiguous, (using lun 0 and 2 without 1 doesn't work). In this case qemu doesn't throw an error, we can not find the lun 2 in guests. So Adding a checking function in libvirt to prevent from this case.

Hmm, this seems like a problematic restriction.

Quoted 7 lines

It's how the hardware works.

Quoted 3 lines

How does this work if we start off a guest with 3 disks attached to the usb-bot SCSI controller. Then hot-unplug the 2nd disk.

You can't hotplug individual luns anyway.

How does hotplug/unplug work in the context of usb-bot ?

AFAIK we need to be able to run

device_add usb_bot
drive_add file...
device_add scsi-hd

And the reverse, to unplug it, if we're to have feature parity with usb-storage.

Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
#6 lore raw

Hi,

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

How does this work if we start off a guest with 3 disks attached to the usb-bot SCSI controller. Then hot-unplug the 2nd disk.

You can't hotplug individual luns anyway.

How does hotplug/unplug work in the context of usb-bot ?

Quoted 8 lines

AFAIK we need to be able to run

device_add usb_bot
drive_add file...
device_add scsi-hd

And the reverse, to unplug it, if we're to have feature parity with usb-storage.

Hot-unplug is easy. You can remove the usb-bot device which will also remove all child devices.

Hot-plug doesn't work at the moment, and I don't see any obvious way to fix that properly :-(

We need some way to hotplug a *group* of devices (usb-bot + all children) as usb-bot itself is hotpluggable but the individual scsi devices connected to it are not.

I could allow hotplug on usb-bot as workaround, then you can do

stop
device_add usb_bot
device_add scsi-{hd,cd,whatever}
cont

but that would be more a gross hack than a solution ...

cheers,
Gerd