summaryrefslogtreecommitdiffstats
path: root/hw/ide/qdev.c
diff options
context:
space:
mode:
authorKevin Wolf2017-01-24 13:43:31 +0100
committerKevin Wolf2017-02-28 20:40:36 +0100
commita17c17a274f24f0c0259f89d288f29b8ce0511aa (patch)
tree592723a71539dd34bdb76b7fe74f9898be7dcb90 /hw/ide/qdev.c
parentblock: Allow error return in BlockDevOps.change_media_cb() (diff)
downloadqemu-a17c17a274f24f0c0259f89d288f29b8ce0511aa.tar.gz
qemu-a17c17a274f24f0c0259f89d288f29b8ce0511aa.tar.xz
qemu-a17c17a274f24f0c0259f89d288f29b8ce0511aa.zip
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>
Diffstat (limited to 'hw/ide/qdev.c')
-rw-r--r--hw/ide/qdev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index bb3c377800..4383cd111d 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -170,7 +170,6 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind)
return -1;
} else {
/* Anonymous BlockBackend for an empty drive */
- /* FIXME Use real permissions */
dev->conf.blk = blk_new(0, BLK_PERM_ALL);
}
}
@@ -197,7 +196,12 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind)
return -1;
}
}
- blkconf_apply_backend_options(&dev->conf);
+ blkconf_apply_backend_options(&dev->conf, kind == IDE_CD, kind != IDE_CD,
+ &err);
+ if (err) {
+ error_report_err(err);
+ return -1;
+ }
if (ide_init_drive(s, dev->conf.blk, kind,
dev->version, dev->serial, dev->model, dev->wwn,