diff mbox

[PATCHv2,06/20] block: add discard and write_zeroes limits and alignment to BlockDriverState

Message ID 1379425736-11326-7-git-send-email-pl@kamp.de
State New
Headers show

Commit Message

Peter Lieven Sept. 17, 2013, 1:48 p.m. UTC
Signed-off-by: Peter Lieven <pl@kamp.de>
---
 include/block/block_int.h |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Eric Blake Sept. 19, 2013, 6:53 p.m. UTC | #1
On 09/17/2013 07:48 AM, Peter Lieven wrote:
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>  include/block/block_int.h |   12 ++++++++++++
>  1 file changed, 12 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> +
> +    /* optimal alignment for write zeroes requests in sectors */
> +    int64_t write_zeroes_alignment;
> +
>      /* do we need to tell the quest if we have a volatile write cache? */
>      int enable_write_cache;

Hmm, I just pointed out to Paolo that this ought to be bool.  But as it
is in the context and not your actual patch, it has no bearing on this
series, and even if that gets changed first, git's pretty good about
context-only conflict resolution.
Peter Lieven Sept. 19, 2013, 7:11 p.m. UTC | #2
Am 19.09.2013 20:53, schrieb Eric Blake:
> On 09/17/2013 07:48 AM, Peter Lieven wrote:
>> Signed-off-by: Peter Lieven <pl@kamp.de>
>> ---
>>  include/block/block_int.h |   12 ++++++++++++
>>  1 file changed, 12 insertions(+)
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
>> +
>> +    /* optimal alignment for write zeroes requests in sectors */
>> +    int64_t write_zeroes_alignment;
>> +
Paolo voted for a BlockLimits struct to be nested into the BlockDriverState.
It would make it easier if the settings have to be copied (like in raw_open).
There might be more limits in the future so it might be good that its not necessary
to change the code everywhere.

>>      /* do we need to tell the quest if we have a volatile write cache? */
>>      int enable_write_cache;
> Hmm, I just pointed out to Paolo that this ought to be bool.  But as it
> is in the context and not your actual patch, it has no bearing on this
> series, and even if that gets changed first, git's pretty good about
> context-only conflict resolution.
>
If I put a v3 which is likely I can put a patch for that in as well.

Peter
diff mbox

Patch

diff --git a/include/block/block_int.h b/include/block/block_int.h
index 85c3474..692b9ed 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -280,6 +280,18 @@  struct BlockDriverState {
     /* the memory alignment required for the buffers handled by this driver */
     int buffer_alignment;
 
+    /* maximum number of sectors that can be discarded at once */
+    int max_discard;
+
+    /* optimal alignment for discard requests in sectors */
+    int64_t discard_alignment;
+
+    /* maximum number of sectors that can zeroized at once */
+    int max_write_zeroes;
+
+    /* optimal alignment for write zeroes requests in sectors */
+    int64_t write_zeroes_alignment;
+
     /* do we need to tell the quest if we have a volatile write cache? */
     int enable_write_cache;