]> Git Repo - qemu.git/commitdiff
scsi: scsi-cd without drive property for empty drive
authorKevin Wolf <[email protected]>
Thu, 14 Jul 2016 13:49:43 +0000 (15:49 +0200)
committerKevin Wolf <[email protected]>
Mon, 5 Sep 2016 17:06:47 +0000 (19:06 +0200)
This allows the creation of an empty scsi-cd device without manually
creating a BlockBackend.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
hw/scsi/scsi-disk.c

index 836a1553edd0b8f00a7b8fefb3f5f67b6d83dd42..99c9d618da34700562f0c84ba5e4b8dfa136a1e6 100644 (file)
@@ -2359,6 +2359,11 @@ static void scsi_hd_realize(SCSIDevice *dev, Error **errp)
 static void scsi_cd_realize(SCSIDevice *dev, Error **errp)
 {
     SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
+
+    if (!dev->conf.blk) {
+        dev->conf.blk = blk_new();
+    }
+
     s->qdev.blocksize = 2048;
     s->qdev.type = TYPE_ROM;
     s->features |= 1 << SCSI_DISK_F_REMOVABLE;
This page took 0.030404 seconds and 4 git commands to generate.