qemu-e2k/include/block
Eric Blake 081dd1fe36 nbd: Implement NBD_INFO_BLOCK_SIZE on client
The upstream NBD Protocol has defined a new extension to allow
the server to advertise block sizes to the client, as well as
a way for the client to inform the server whether it intends to
obey block sizes.

When using the block layer as the client, we will obey block
sizes; but when used as 'qemu-nbd -c' to hand off to the
kernel nbd module as the client, we are still waiting for the
kernel to implement a way for us to learn if it will honor
block sizes (perhaps by an addition to sysfs, rather than an
ioctl), as well as any way to tell the kernel what additional
block sizes to obey (NBD_SET_BLKSIZE appears to be accurate
for the minimum size, but preferred and maximum sizes would
probably be new ioctl()s), so until then, we need to make our
request for block sizes conditional.

When using ioctl(NBD_SET_BLKSIZE) to hand off to the kernel,
use the minimum block size as the sector size if it is larger
than 512, which also has the nice effect of cooperating with
(non-qemu) servers that don't do read-modify-write when
exposing a block device with 4k sectors; it might also allow
us to visit a file larger than 2T on a 32-bit kernel.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20170707203049.534-10-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-07-14 12:04:42 +02:00
..
accounting.h block: make accounting thread-safe 2017-06-16 07:55:00 +08:00
aio.h aio: add missing aio_notify() to aio_enable_external() 2017-05-12 10:36:46 -04:00
block.h block: Add PreallocMode to bdrv_truncate() 2017-07-11 17:45:01 +02:00
block_backup.h backup: Switch block_backup.h to byte-based 2017-07-10 13:18:06 +02:00
block_int.h block: Add PreallocMode to BD.bdrv_truncate() 2017-07-11 17:45:01 +02:00
blockjob.h fix: avoid an infinite loop or a dangling pointer problem in img_commit 2017-06-26 14:54:46 +02:00
blockjob_int.h blockjob: use deferred_to_main_loop to indicate the coroutine has ended 2017-05-24 16:38:51 -04:00
dirty-bitmap.h block: release persistent bitmaps on inactivate 2017-07-11 17:44:59 +02:00
nbd.h nbd: Implement NBD_INFO_BLOCK_SIZE on client 2017-07-14 12:04:42 +02:00
qapi.h block/qapi: Use blk_enable_write_cache() 2016-03-30 12:16:02 +02:00
raw-aio.h linux-aio: share one LinuxAioState within an AioContext 2016-07-18 15:09:31 +01:00
scsi.h * SCSI scanner support 2016-07-14 13:44:06 +01:00
snapshot.h include: Clean up includes 2016-02-23 12:43:05 +00:00
thread-pool.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
throttle-groups.h block: Move I/O throttling configuration functions to BlockBackend 2016-05-19 16:45:30 +02:00
write-threshold.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00