mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
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>
This commit is contained in:
parent
e2bc625f9b
commit
5ad283ebb8
1 changed files with 5 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue