aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-08-22 18:50:30 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-09-19 15:26:15 +0200
commita4aab7b4cb2d994e17c987d7d3fb2b6645ea92a2 (patch)
tree1d934cadde78274487738f1b8d7882c949a34daf
parent9a304d29a79a3daeeaf15c68d7439713037405b1 (diff)
nbd: do not close BlockDriverState in nbd_export_close
This is not desirable when embedding the NBD server inside QEMU. Move the bdrv_close to qemu-nbd. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--nbd.c1
-rw-r--r--qemu-nbd.c1
2 files changed, 1 insertions, 1 deletions
diff --git a/nbd.c b/nbd.c
index 5a3088d232..83200bdccd 100644
--- a/nbd.c
+++ b/nbd.c
@@ -721,7 +721,6 @@ void nbd_export_close(NBDExport *exp)
g_free(first);
}
- bdrv_close(exp->bs);
g_free(exp);
}
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 1c1cf6a463..23392e0d3c 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -586,6 +586,7 @@ int main(int argc, char **argv)
} while (!sigterm_reported && (persistent || !nbd_started || nb_fds > 0));
nbd_export_close(exp);
+ bdrv_close(bs);
if (sockpath) {
unlink(sockpath);
}