hw/block: Request permissions

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 <kwolf@redhat.com>
Acked-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Kevin Wolf 2017-01-24 13:43:31 +01:00
parent 39829a01ae
commit a17c17a274
17 changed files with 142 additions and 27 deletions

View file

@ -603,7 +603,11 @@ static void usb_msd_realize_storage(USBDevice *dev, Error **errp)
blkconf_serial(&s->conf, &dev->serial);
blkconf_blocksizes(&s->conf);
blkconf_apply_backend_options(&s->conf);
blkconf_apply_backend_options(&s->conf, blk_is_read_only(blk), true, &err);
if (err) {
error_propagate(errp, err);
return;
}
/*
* Hack alert: this pretends to be a block device, but it's really