Il 29/11/2013 15:58, Marc-André Lureau ha scritto:
> From: Marc-André Lureau <marcandre.lur...@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com>
> ---
>  block/nbd-client.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/block/nbd-client.c b/block/nbd-client.c
> index e29227b..c0ad2c2 100644
> --- a/block/nbd-client.c
> +++ b/block/nbd-client.c
> @@ -337,7 +337,12 @@ static void nbd_teardown_connection(NbdClientSession 
> *client)
>  
>  void nbd_client_session_close(NbdClientSession *client)
>  {
> +    if (!client->bs) {
> +        return;
> +    }
> +
>      nbd_teardown_connection(client);
> +    client->bs = NULL;
>  }
>  
>  int nbd_client_session_init(NbdClientSession *client, BlockDriverState *bs,
> 

Reviewed-by: Paolo Bonzini <pbonz...@redhat.com>

Perhaps "make nbd_client_session_close() idempotent" in the commit message.

Paolo

Reply via email to