summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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);
     }