diff mbox

[PATCHv2,20/20] block/raw: copy block limits and alignment information on raw_open

Message ID 1379425736-11326-21-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>
---
 block/raw_bsd.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Paolo Bonzini Sept. 18, 2013, 8:48 a.m. UTC | #1
Il 17/09/2013 15:48, Peter Lieven ha scritto:
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>  block/raw_bsd.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/block/raw_bsd.c b/block/raw_bsd.c
> index 0bfa5fc..dfdb375 100644
> --- a/block/raw_bsd.c
> +++ b/block/raw_bsd.c
> @@ -149,6 +149,10 @@ static int raw_create(const char *filename, QEMUOptionParameter *options)
>  static int raw_open(BlockDriverState *bs, QDict *options, int flags)
>  {
>      bs->sg = bs->file->sg;
> +    bs->max_discard = bs->file->max_discard;
> +    bs->discard_alignment = bs->file->discard_alignment;
> +    bs->max_write_zeroes = bs->file->max_write_zeroes;
> +    bs->write_zeroes_alignment = bs->file->write_zeroes_alignment;
>      return 0;

What about introducing a BlockLimits struct?

Paolo

>  }
>  
>
Peter Lieven Sept. 19, 2013, 7:29 a.m. UTC | #2
On 18.09.2013 10:48, Paolo Bonzini wrote:
> Il 17/09/2013 15:48, Peter Lieven ha scritto:
>> Signed-off-by: Peter Lieven <pl@kamp.de>
>> ---
>>   block/raw_bsd.c |    4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/block/raw_bsd.c b/block/raw_bsd.c
>> index 0bfa5fc..dfdb375 100644
>> --- a/block/raw_bsd.c
>> +++ b/block/raw_bsd.c
>> @@ -149,6 +149,10 @@ static int raw_create(const char *filename, QEMUOptionParameter *options)
>>   static int raw_open(BlockDriverState *bs, QDict *options, int flags)
>>   {
>>       bs->sg = bs->file->sg;
>> +    bs->max_discard = bs->file->max_discard;
>> +    bs->discard_alignment = bs->file->discard_alignment;
>> +    bs->max_write_zeroes = bs->file->max_write_zeroes;
>> +    bs->write_zeroes_alignment = bs->file->write_zeroes_alignment;
>>       return 0;
> What about introducing a BlockLimits struct?
Good idea.

Do you like the rest of the series?

Peter
Paolo Bonzini Sept. 19, 2013, 2:44 p.m. UTC | #3
Il 19/09/2013 09:29, Peter Lieven ha scritto:
> On 18.09.2013 10:48, Paolo Bonzini wrote:
>> Il 17/09/2013 15:48, Peter Lieven ha scritto:
>>> Signed-off-by: Peter Lieven <pl@kamp.de>
>>> ---
>>>   block/raw_bsd.c |    4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/block/raw_bsd.c b/block/raw_bsd.c
>>> index 0bfa5fc..dfdb375 100644
>>> --- a/block/raw_bsd.c
>>> +++ b/block/raw_bsd.c
>>> @@ -149,6 +149,10 @@ static int raw_create(const char *filename,
>>> QEMUOptionParameter *options)
>>>   static int raw_open(BlockDriverState *bs, QDict *options, int flags)
>>>   {
>>>       bs->sg = bs->file->sg;
>>> +    bs->max_discard = bs->file->max_discard;
>>> +    bs->discard_alignment = bs->file->discard_alignment;
>>> +    bs->max_write_zeroes = bs->file->max_write_zeroes;
>>> +    bs->write_zeroes_alignment = bs->file->write_zeroes_alignment;
>>>       return 0;
>> What about introducing a BlockLimits struct?
> Good idea.
> 
> Do you like the rest of the series?

Yes, I do.

Paolo
diff mbox

Patch

diff --git a/block/raw_bsd.c b/block/raw_bsd.c
index 0bfa5fc..dfdb375 100644
--- a/block/raw_bsd.c
+++ b/block/raw_bsd.c
@@ -149,6 +149,10 @@  static int raw_create(const char *filename, QEMUOptionParameter *options)
 static int raw_open(BlockDriverState *bs, QDict *options, int flags)
 {
     bs->sg = bs->file->sg;
+    bs->max_discard = bs->file->max_discard;
+    bs->discard_alignment = bs->file->discard_alignment;
+    bs->max_write_zeroes = bs->file->max_write_zeroes;
+    bs->write_zeroes_alignment = bs->file->write_zeroes_alignment;
     return 0;
 }