[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/41] block: get max_transfer limit for char (scsi-g
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 17/41] block: get max_transfer limit for char (scsi-generic) devices |
Date: |
Fri, 27 Jan 2017 14:45:25 +0100 |
From: Eric Farman <address@hidden>
We can get the maximum number of bytes for a single I/O transfer
from the BLKSECTGET ioctl, but we only perform this for block
devices. scsi-generic devices are represented as character devices,
and so do not issue this today. Update this, so that virtio-scsi
devices using the scsi-generic interface can return the same data.
Signed-off-by: Eric Farman <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/file-posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/file-posix.c b/block/file-posix.c
index 9f83725..2134e0e 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -674,7 +674,7 @@ static void raw_refresh_limits(BlockDriverState *bs, Error
**errp)
struct stat st;
if (!fstat(s->fd, &st)) {
- if (S_ISBLK(st.st_mode)) {
+ if (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode)) {
int ret = hdev_get_max_transfer_length(bs, s->fd);
if (ret > 0 && ret <= BDRV_REQUEST_MAX_BYTES) {
bs->bl.max_transfer = pow2floor(ret);
--
1.8.3.1
- [Qemu-devel] [PULL 06/41] replay: exception replay fix, (continued)
- [Qemu-devel] [PULL 06/41] replay: exception replay fix, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 07/41] apic: save apic_delivered flag, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 08/41] memory: tune mtree_print_mr() to dump mr type, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 12/41] hw/isa/lpc_ich9: negotiate SMI broadcast on pc-q35-2.9+ machine types, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 11/41] hw/isa/lpc_ich9: add broadcast SMI feature, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 13/41] block/iscsi: avoid data corruption with cache=writeback, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 09/41] memory: hmp: add "-f" for "info mtree", Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 10/41] hw/isa/lpc_ich9: add SMI feature negotiation via fw_cfg, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 14/41] Introduce DEVICE_CATEGORY_CPU for CPU devices, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 15/41] hw/scsi: Fix debug message of cdb structure in scsi-generic, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 17/41] block: get max_transfer limit for char (scsi-generic) devices,
Paolo Bonzini <=
- [Qemu-devel] [PULL 18/41] x86-KVM: Supply TSC and APIC clock rates to guest like VMWare, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 16/41] block: Fix target variable of BLKSECTGET ioctl, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 19/41] pc: Enable vmware-cpuid-freq CPU option for 2.9+ machine types, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 23/41] char: add qemu_chr_fe_add_watch() Returns description, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 20/41] block/iscsi: statically link qemu_iscsi_opts, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 24/41] doc: fix spelling, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 21/41] tests: fix linking test-char on win32, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 26/41] char: use a static array for backends, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 25/41] char: use a const CharDriver, Paolo Bonzini, 2017/01/27
- [Qemu-devel] [PULL 22/41] qemu-options: stdio is available on win32, Paolo Bonzini, 2017/01/27