qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 6/9] nbd: BLOCK_STATUS for standard get_block_st


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 6/9] nbd: BLOCK_STATUS for standard get_block_status function: client part
Date: Mon, 12 Mar 2018 09:00:12 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 03/12/2018 08:13 AM, Vladimir Sementsov-Ogievskiy wrote:

We should probably validate that the length field is a multiple of min_block (if a server tells us that all operations must be 512-byte aligned, then reports an extent that is smaller than 512 bytes, we have no way to ask for the status of the second half of the sector). Probably also something that needs to be explicitly stated in the NBD spec. [1]

related question: what server should reply on zero-length request? I'll add

+     if (!bytes) {
+         *pnum = 0;
+         return 0;
+     }

to nbd_client_co_block_status, to prevent such situation, but looks like spec lacks the information.

nbd.git commit ee926037 mentions that NBD_CMD_READ, _WRITE, _TRIM, and _WRITE_ZEROES have unspecified behavior for zero-length transactions; we should do the same for NBD_CMD_BLOCK_STATUS. But in the meantime, handling it gracefully with a no-op reply (the way qemu.git commit ef8c887e handles 0-length structured read) is fine.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]