nbd: make nbd_client_session_close() idempotent

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
master
Marc-André Lureau 2013-12-01 22:23:44 +01:00 committed by Gerd Hoffmann
parent e2bc625f9b
commit 5ad283ebb8
1 changed files with 5 additions and 0 deletions

View File

@ -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,