On 09/18/2017 10:43 AM, Paolo Bonzini wrote: > On 18/09/2017 15:59, Vladimir Sementsov-Ogievskiy wrote: >> Read the whole reply in one place - in nbd_read_reply_entry. >> >> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> >> --- >> block/nbd-client.h | 1 + >> block/nbd-client.c | 42 ++++++++++++++++++++++++------------------ >> 2 files changed, 25 insertions(+), 18 deletions(-) >>
> > I am not sure this is an improvement. In principle you could have > commands that read replies a bit at a time without using a QEMUIOVector. Right now we don't, but the most likely point where this would be an issue is the fact that we want to implement structured replies (the server can send more than one response to a single request from the client) in order to then implement block status queries (where the server can send piecemeal information in response to a query, and the client could very easily want to handle information as it comes in rather than waiting for the entire server response, especially if the amount of information returned by the server is not known a priori by the client, the way the length is known in advance for NBD_CMD_READ, but instead learned partway through the reply). I guess the question becomes a matter of whether we are over-constraining future additions by making this refactoring, or whether we can still implement block status queries using a single QEMUIOVector. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature