[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 14/36] scsi-generic: Apply lock-mode when realize
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH v8 14/36] scsi-generic: Apply lock-mode when realize |
Date: |
Fri, 30 Sep 2016 20:09:44 +0800 |
Signed-off-by: Fam Zheng <address@hidden>
---
hw/scsi/scsi-generic.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 7a588a7..4f131e8 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -502,12 +502,19 @@ static void scsi_generic_realize(SCSIDevice *s, Error
**errp)
int rc;
int sg_version;
struct sg_scsi_id scsiid;
+ Error *err = NULL;
if (!s->conf.blk) {
error_setg(errp, "drive property not set");
return;
}
+ blk_lock_image(s->conf.blk, s->conf.lock_mode, &err);
+ if (err) {
+ error_propagate(errp, err);
+ return;
+ }
+
if (blk_get_on_error(s->conf.blk, 0) != BLOCKDEV_ON_ERROR_ENOSPC) {
error_setg(errp, "Device doesn't support drive option werror");
return;
--
2.7.4
- [Qemu-devel] [PATCH v8 04/36] osdep: Add qemu_lock_fd and qemu_unlock_fd, (continued)
- [Qemu-devel] [PATCH v8 04/36] osdep: Add qemu_lock_fd and qemu_unlock_fd, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 06/36] qemu-io: Add "-L" option for BDRV_O_NO_LOCK, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 05/36] raw-posix: Add image locking support, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 08/36] qemu-img: Update documentation of "-L" option, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 07/36] qemu-img: Add "-L" option to sub commands, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 10/36] block: Don't lock drive-backup target image in none mode, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 09/36] qemu-nbd: Add "--no-lock/-L" option, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 11/36] block: Add blk_lock_image, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 12/36] virtio-blk: Apply lock-mode when realize, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 13/36] scsi-disk: Apply lock-mode when realize, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 14/36] scsi-generic: Apply lock-mode when realize,
Fam Zheng <=
- [Qemu-devel] [PATCH v8 15/36] qdev: Add "lock-mode" to block device options, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 16/36] ide: Apply lock-mode when initialize, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 17/36] nvme: Apply lock-mode when initialize, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 18/36] usb-storage: Apply lock-mode when realize, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 19/36] pflash: Add "lock-mode" property, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 20/36] qemu-iotests: 046: Move version detection out from verify_io, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 21/36] qemu-iotests: 091: Prepare for image lock, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 22/36] qemu-iotests: 030: Disable image locking when checking test image, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 23/36] iotests: 087: Disable image locking in cases where file is shared, Fam Zheng, 2016/09/30
- [Qemu-devel] [PATCH v8 24/36] iotests: 087: Disable image locking in cases where file is shared, Fam Zheng, 2016/09/30