|
@@ -2346,12 +2346,7 @@ static void scsi_realize(SCSIDevice *dev, Error **errp)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- blkconf_blocksizes(&s->qdev.conf);
|
|
|
|
-
|
|
|
|
- if (s->qdev.conf.logical_block_size >
|
|
|
|
- s->qdev.conf.physical_block_size) {
|
|
|
|
- error_setg(errp,
|
|
|
|
- "logical_block_size > physical_block_size not supported");
|
|
|
|
|
|
+ if (!blkconf_blocksizes(&s->qdev.conf, errp)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2436,7 +2431,9 @@ static void scsi_hd_realize(SCSIDevice *dev, Error **errp)
|
|
if (s->qdev.conf.blk) {
|
|
if (s->qdev.conf.blk) {
|
|
ctx = blk_get_aio_context(s->qdev.conf.blk);
|
|
ctx = blk_get_aio_context(s->qdev.conf.blk);
|
|
aio_context_acquire(ctx);
|
|
aio_context_acquire(ctx);
|
|
- blkconf_blocksizes(&s->qdev.conf);
|
|
|
|
|
|
+ if (!blkconf_blocksizes(&s->qdev.conf, errp)) {
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
s->qdev.blocksize = s->qdev.conf.logical_block_size;
|
|
s->qdev.blocksize = s->qdev.conf.logical_block_size;
|
|
s->qdev.type = TYPE_DISK;
|
|
s->qdev.type = TYPE_DISK;
|
|
@@ -2444,6 +2441,7 @@ static void scsi_hd_realize(SCSIDevice *dev, Error **errp)
|
|
s->product = g_strdup("QEMU HARDDISK");
|
|
s->product = g_strdup("QEMU HARDDISK");
|
|
}
|
|
}
|
|
scsi_realize(&s->qdev, errp);
|
|
scsi_realize(&s->qdev, errp);
|
|
|
|
+out:
|
|
if (ctx) {
|
|
if (ctx) {
|
|
aio_context_release(ctx);
|
|
aio_context_release(ctx);
|
|
}
|
|
}
|