On 04/19/2018 03:36 AM, Vladimir Sementsov-Ogievskiy wrote: > 18.04.2018 19:37, Eric Blake wrote: >> On 04/13/2018 09:31 AM, Vladimir Sementsov-Ogievskiy wrote: >>> Handle nbd CACHE command. Just do read, without sending read data back. >>> Cache mechanism should be done by exported node driver chain. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> >>> --- >>> include/block/nbd.h | 3 ++- >>> nbd/server.c | 10 ++++++---- >>> 2 files changed, 8 insertions(+), 5 deletions(-) >>> >>> diff --git a/include/block/nbd.h b/include/block/nbd.h >>> index fcdcd54502..b4793d0a29 100644 >>> --- a/include/block/nbd.h >>> +++ b/include/block/nbd.h >>> @@ -135,6 +135,7 @@ typedef struct NBDExtent { >>> #define NBD_FLAG_SEND_TRIM (1 << 5) /* Send TRIM (discard) */ >>> #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) /* Send WRITE_ZEROES */ >>> #define NBD_FLAG_SEND_DF (1 << 7) /* Send DF (Do not >>> Fragment) */ >>> +#define NBD_FLAG_SEND_CACHE (1 << 8) /* Send CACHE (prefetch) */ >> Hmm, this flag is not documented in the upstream NBD protocol yet; are >> we sure it matches the xNBD implementation? We'll want at least a >> documentation patch proposed for the NBD list before taking this. >> > > The discussion already on list: > https://lists.debian.org/nbd/2018/03/msg00040.html
Indeed, and that made me realize that we may want to add NBD_CMD_FLAG_* values corresponding to other useful posix_fadvise() modes before finalizing the NBD protocol addition of this feature, in which case we'd want to make sure the qemu implementation is in line with that. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature