[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 1/4] scsi-disk: Allow overriding SCSI INQUIRY rem
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH v4 1/4] scsi-disk: Allow overriding SCSI INQUIRY removable bit |
Date: |
Mon, 24 Jan 2011 15:34:58 +0000 |
Provide the "removable" qdev property bit to override the SCSI INQUIRY
removable (RMB) bit for non-CDROM devices. This will be used by USB
Mass Storage Devices, which sometimes have this guest-visible bit set
and sometimes do not. They therefore requires a means for user
configuration.
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/scsi-disk.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 6cb317c..488eedd 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -72,6 +72,7 @@ struct SCSIDiskState
/* The qemu block layer uses a fixed 512 byte sector size.
This is the number of 512 byte blocks in a single scsi sector. */
int cluster_size;
+ uint32_t removable;
uint64_t max_lba;
QEMUBH *bh;
char *version;
@@ -552,6 +553,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req,
uint8_t *outbuf)
memcpy(&outbuf[16], "QEMU CD-ROM ", 16);
} else {
outbuf[0] = 0;
+ outbuf[1] = s->removable ? 0x80 : 0;
memcpy(&outbuf[16], "QEMU HARDDISK ", 16);
}
memcpy(&outbuf[8], "QEMU ", 8);
@@ -1295,6 +1297,7 @@ static SCSIDeviceInfo scsi_disk_info = {
DEFINE_BLOCK_PROPERTIES(SCSIDiskState, qdev.conf),
DEFINE_PROP_STRING("ver", SCSIDiskState, version),
DEFINE_PROP_STRING("serial", SCSIDiskState, serial),
+ DEFINE_PROP_BIT("removable", SCSIDiskState, removable, 0, false),
DEFINE_PROP_END_OF_LIST(),
},
};
--
1.7.2.3
- [Qemu-devel] [PATCH v4 0/4] usb-msd: Add usb-storage, removable=on|off property, Stefan Hajnoczi, 2011/01/24
- [Qemu-devel] [PATCH v4 1/4] scsi-disk: Allow overriding SCSI INQUIRY removable bit,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v4 4/4] docs: Document scsi-disk and usb-storage removable parameter, Stefan Hajnoczi, 2011/01/24
- [Qemu-devel] [PATCH v4 3/4] usb-msd: Propagate removable bit to SCSI device, Stefan Hajnoczi, 2011/01/24
- [Qemu-devel] [PATCH v4 2/4] scsi: Allow scsi_bus_legacy_add_drive() to set removable bit, Stefan Hajnoczi, 2011/01/24
- [Qemu-devel] Re: [PATCH v4 0/4] usb-msd: Add usb-storage, removable=on|off property, Kevin Wolf, 2011/01/24