On 21.02.2017 15:58, Kevin Wolf wrote:
> This makes all device emulations with a qdev drive property request
> permissions on their BlockBackend. The only thing we block at this point
> is resizing images for some devices that can't support it.
> 
> Signed-off-by: Kevin Wolf <[email protected]>
> ---
>  hw/block/block.c                 | 22 +++++++++++++++++++++-
>  hw/block/fdc.c                   | 25 +++++++++++++++++++++++--
>  hw/block/m25p80.c                |  8 ++++++++
>  hw/block/nand.c                  |  7 +++++++
>  hw/block/nvme.c                  |  8 +++++++-
>  hw/block/onenand.c               |  7 +++++++
>  hw/block/pflash_cfi01.c          | 18 ++++++++++++------
>  hw/block/pflash_cfi02.c          | 19 +++++++++++++------
>  hw/block/virtio-blk.c            |  8 +++++++-
>  hw/core/qdev-properties-system.c |  1 -
>  hw/ide/qdev.c                    |  7 +++++--
>  hw/nvram/spapr_nvram.c           |  8 ++++++++
>  hw/scsi/scsi-disk.c              |  9 +++++++--
>  hw/sd/sd.c                       |  6 ++++++
>  hw/usb/dev-storage.c             |  6 +++++-
>  include/hw/block/block.h         |  3 ++-
>  tests/qemu-iotests/051.pc.out    |  6 +++---
>  17 files changed, 141 insertions(+), 27 deletions(-)

For all the SCSI disks, shouldn't @resizable be true only if the qdev
type is TYPE_DISK? At least hw/scsi/scsi-disk.c:scsi_realize() looks as
if that is not necessarily the case.

OTOH, I'm not sure how useful the condition in scsi_disk_resize_cb() is
in the first place. In my understanding, the SCSI device should always
be of TYPE_DISK there.

And for IDE devices, @resizable should be true only if the device is not
a CD ROM drive.

Max

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to