[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/14] scsi-disk: add dpofua property
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 07/14] scsi-disk: add dpofua property |
Date: |
Fri, 4 May 2012 10:45:47 +0200 |
Linux expects REQ_FUA to be advertised only if WRITE+FUA is faster than
WRITE+SYNCHRONIZE CACHE, so we should not set the DPOFUA bit. However,
it is useful to have it for testing purposes, so add a qdev property to
set it.
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi-disk.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index e04b469..e0f1821 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -62,6 +62,7 @@ typedef struct SCSIDiskReq {
} SCSIDiskReq;
#define SCSI_DISK_F_REMOVABLE 0
+#define SCSI_DISK_F_DPOFUA 1
struct SCSIDiskState
{
@@ -1103,7 +1104,7 @@ static int scsi_disk_emulate_mode_sense(SCSIDiskReq *r,
uint8_t *outbuf)
p = outbuf;
if (s->qdev.type == TYPE_DISK) {
- dev_specific_param = 0x10; /* DPOFUA */
+ dev_specific_param = s->features & (1 << SCSI_DISK_F_DPOFUA) ? 0x10 :
0;
if (bdrv_is_read_only(s->qdev.conf.bs)) {
dev_specific_param |= 0x80; /* Readonly. */
}
@@ -1935,6 +1936,8 @@ static Property scsi_hd_properties[] = {
DEFINE_SCSI_DISK_PROPERTIES(),
DEFINE_PROP_BIT("removable", SCSIDiskState, features,
SCSI_DISK_F_REMOVABLE, false),
+ DEFINE_PROP_BIT("dpofua", SCSIDiskState, features,
+ SCSI_DISK_F_DPOFUA, false),
DEFINE_PROP_END_OF_LIST(),
};
@@ -2038,6 +2041,8 @@ static Property scsi_disk_properties[] = {
DEFINE_SCSI_DISK_PROPERTIES(),
DEFINE_PROP_BIT("removable", SCSIDiskState, features,
SCSI_DISK_F_REMOVABLE, false),
+ DEFINE_PROP_BIT("dpofua", SCSIDiskState, features,
+ SCSI_DISK_F_DPOFUA, false),
DEFINE_PROP_END_OF_LIST(),
};
--
1.7.9.3
- Re: [Qemu-devel] [PATCH 02/14] scsi: prevent data transfer overflow, (continued)
[Qemu-devel] [PATCH 04/14] scsi: fix WRITE SAME transfer length and direction, Paolo Bonzini, 2012/05/04
[Qemu-devel] [PATCH 05/14] scsi: Specify the xfer direction for UNMAP and ATA_PASSTHROUGH commands, Paolo Bonzini, 2012/05/04
[Qemu-devel] [PATCH 06/14] scsi: change "removable" field to host many features, Paolo Bonzini, 2012/05/04
[Qemu-devel] [PATCH 07/14] scsi-disk: add dpofua property,
Paolo Bonzini <=
[Qemu-devel] [PATCH 08/14] scsi: do not report bogus overruns for commands in the 0x00-0x1F range, Paolo Bonzini, 2012/05/04
[Qemu-devel] [PATCH 09/14] scsi: parse 16-byte tape CDBs, Paolo Bonzini, 2012/05/04
[Qemu-devel] [PATCH 11/14] scsi: do not require a minimum allocation length for REQUEST SENSE, Paolo Bonzini, 2012/05/04
[Qemu-devel] [PATCH 12/14] scsi: set VALID bit to 0 in fixed format sense data, Paolo Bonzini, 2012/05/04
[Qemu-devel] [PATCH 13/14] scsi: remove useless debug messages, Paolo Bonzini, 2012/05/04
[Qemu-devel] [PATCH 10/14] scsi: do not require a minimum allocation length for INQUIRY, Paolo Bonzini, 2012/05/04
[Qemu-devel] [PATCH 14/14] scsi: Add assertion for use-after-free errors, Paolo Bonzini, 2012/05/04
Re: [Qemu-devel] [PULL 00/14] SCSI changes for 1.1, Anthony Liguori, 2012/05/08