All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] iscsi: do not assume device is zero initialized
@ 2012-11-17 15:20 Peter Lieven
  2012-11-19  8:25 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Lieven @ 2012-11-17 15:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Paolo Bonzini, ronnie sahlberg

Without any complex checks we can't assume that an
iscsi target is initialized to zero.

Signed-off-by: Peter Lieven <pl@kamp.de>
---
 block/iscsi.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/block/iscsi.c b/block/iscsi.c
index eb586cb..d685f20 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -991,6 +991,11 @@ out:
     return ret;
 }
 
+static int iscsi_has_zero_init(BlockDriverState *bs)
+{
+    return 0;
+}
+
 static QEMUOptionParameter iscsi_create_options[] = {
     {
         .name = BLOCK_OPT_SIZE,
@@ -1017,6 +1022,7 @@ static BlockDriver bdrv_iscsi = {
     .bdrv_aio_flush  = iscsi_aio_flush,
 
     .bdrv_aio_discard = iscsi_aio_discard,
+    .bdrv_has_zero_init = iscsi_has_zero_init,    
 
 #ifdef __linux__
     .bdrv_ioctl       = iscsi_ioctl,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] iscsi: do not assume device is zero initialized
  2012-11-17 15:20 [Qemu-devel] [PATCH] iscsi: do not assume device is zero initialized Peter Lieven
@ 2012-11-19  8:25 ` Paolo Bonzini
  2012-11-19 10:09   ` Peter Lieven
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2012-11-19  8:25 UTC (permalink / raw)
  To: Peter Lieven; +Cc: Kevin Wolf, qemu-devel, ronnie sahlberg

Il 17/11/2012 16:20, Peter Lieven ha scritto:
> Without any complex checks we can't assume that an
> iscsi target is initialized to zero.
> 
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>  block/iscsi.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/block/iscsi.c b/block/iscsi.c
> index eb586cb..d685f20 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -991,6 +991,11 @@ out:
>      return ret;
>  }
>  
> +static int iscsi_has_zero_init(BlockDriverState *bs)
> +{
> +    return 0;
> +}
> +
>  static QEMUOptionParameter iscsi_create_options[] = {
>      {
>          .name = BLOCK_OPT_SIZE,
> @@ -1017,6 +1022,7 @@ static BlockDriver bdrv_iscsi = {
>      .bdrv_aio_flush  = iscsi_aio_flush,
>  
>      .bdrv_aio_discard = iscsi_aio_discard,
> +    .bdrv_has_zero_init = iscsi_has_zero_init,    
>  
>  #ifdef __linux__
>      .bdrv_ioctl       = iscsi_ioctl,
> 

Applied to scsi-next branch.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] iscsi: do not assume device is zero initialized
  2012-11-19  8:25 ` Paolo Bonzini
@ 2012-11-19 10:09   ` Peter Lieven
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Lieven @ 2012-11-19 10:09 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Kevin Wolf, qemu-devel, ronnie sahlberg


Am 19.11.2012 um 09:25 schrieb Paolo Bonzini <pbonzini@redhat.com>:

> Il 17/11/2012 16:20, Peter Lieven ha scritto:
>> Without any complex checks we can't assume that an
>> iscsi target is initialized to zero.
>> 
>> Signed-off-by: Peter Lieven <pl@kamp.de>
>> ---
>> block/iscsi.c |    6 ++++++
>> 1 file changed, 6 insertions(+)
>> 
>> diff --git a/block/iscsi.c b/block/iscsi.c
>> index eb586cb..d685f20 100644
>> --- a/block/iscsi.c
>> +++ b/block/iscsi.c
>> @@ -991,6 +991,11 @@ out:
>>     return ret;
>> }
>> 
>> +static int iscsi_has_zero_init(BlockDriverState *bs)
>> +{
>> +    return 0;
>> +}
>> +
>> static QEMUOptionParameter iscsi_create_options[] = {
>>     {
>>         .name = BLOCK_OPT_SIZE,
>> @@ -1017,6 +1022,7 @@ static BlockDriver bdrv_iscsi = {
>>     .bdrv_aio_flush  = iscsi_aio_flush,
>> 
>>     .bdrv_aio_discard = iscsi_aio_discard,
>> +    .bdrv_has_zero_init = iscsi_has_zero_init,    
>> 
>> #ifdef __linux__
>>     .bdrv_ioctl       = iscsi_ioctl,
>> 
> 
> Applied to scsi-next branch.

Thank you. 

Wouldn`t it be better to have has_zero_init == 0 as default and set it to 1 for the backends
that support it?

Peter


> 
> Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-19 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-17 15:20 [Qemu-devel] [PATCH] iscsi: do not assume device is zero initialized Peter Lieven
2012-11-19  8:25 ` Paolo Bonzini
2012-11-19 10:09   ` Peter Lieven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.