[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 38/56] nbd: Allow larger requests
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 38/56] nbd: Allow larger requests |
Date: |
Mon, 8 Aug 2016 16:04:09 -0500 |
From: Eric Blake <address@hidden>
The NBD layer was breaking up request at a limit of 2040 sectors
(just under 1M) to cater to old qemu-nbd. But the server limit
was raised to 32M in commit 2d8214885 to match the kernel, more
than three years ago; and the upstream NBD Protocol is proposing
documentation that without any explicit communication to state
otherwise, a client should be able to safely assume that a 32M
transaction will work. It is time to rely on the larger sizing,
and any downstream distro that cares about maximum
interoperability to older qemu-nbd servers can just tweak the
value of #define NBD_MAX_SECTORS.
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Cc: address@hidden
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
(cherry picked from commit 476b923c32ece0e268580776aaf1fab4ab4459a8)
Conflicts:
include/block/nbd.h
* removed context dependency on 943cec86
Signed-off-by: Michael Roth <address@hidden>
---
block/nbd-client.c | 4 ----
include/block/nbd.h | 1 +
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/block/nbd-client.c b/block/nbd-client.c
index 878e879..6f6df46 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -269,10 +269,6 @@ static int nbd_co_writev_1(BlockDriverState *bs, int64_t
sector_num,
return -reply.error;
}
-/* qemu-nbd has a limit of slightly less than 1M per request. Try to
- * remain aligned to 4K. */
-#define NBD_MAX_SECTORS 2040
-
int nbd_client_co_readv(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, QEMUIOVector *qiov)
{
diff --git a/include/block/nbd.h b/include/block/nbd.h
index b86a976..36dde24 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -76,6 +76,7 @@ enum {
/* Maximum size of a single READ/WRITE data buffer */
#define NBD_MAX_BUFFER_SIZE (32 * 1024 * 1024)
+#define NBD_MAX_SECTORS (NBD_MAX_BUFFER_SIZE / BDRV_SECTOR_SIZE)
ssize_t nbd_wr_syncv(QIOChannel *ioc,
struct iovec *iov,
--
1.9.1
- [Qemu-devel] [PATCH 31/56] ui: fix regression in printing VNC host/port on startup, (continued)
- [Qemu-devel] [PATCH 31/56] ui: fix regression in printing VNC host/port on startup, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 32/56] net: fix qemu_announce_self not emitting packets, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 25/56] block: Drop bdrv_ioctl_bh_cb, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 26/56] vmsvga: move fifo sanity checks to vmsvga_fifo_length, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 02/56] spice/gl: add & use qemu_spice_gl_monitor_config, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 28/56] vmsvga: shadow fifo registers, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 34/56] qcow2: Avoid making the L1 table too big, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 33/56] backup: Don't leak BackupBlockJob in error path, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 35/56] qapi: Fix crash on missing alternate member of QAPI struct, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 36/56] pci-assign: Move "Invalid ROM" error message to pci-assign-load-rom.c, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 38/56] nbd: Allow larger requests,
Michael Roth <=
- [Qemu-devel] [PATCH 37/56] vfio/pci: Fix VGA quirks, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 39/56] scsi-generic: Merge block max xfer len in INQUIRY response, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 40/56] scsi: Advertise limits by blocksize, not 512, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 03/56] vl: change runstate only if new state is different from current state, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 44/56] s390x/ipl: fix reboots for migration from different bios, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 45/56] blockdev: Fix regression with the default naming of throttling groups, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 41/56] target-sparc: fix register corruption in ldstub if there is no write permission, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 43/56] Revert "virtio-net: unbreak self announcement and guest offloads after migration", Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 46/56] qemu-iotests: Test naming of throttling groups, Michael Roth, 2016/08/08
- [Qemu-devel] [PATCH 42/56] virtio: set low features early on load, Michael Roth, 2016/08/08