]> git.proxmox.com Git - mirror_qemu.git/blobdiff - qemu-nbd.c
9p: local: Properly set errp in fstatfs error path
[mirror_qemu.git] / qemu-nbd.c
index 0af0560ad1c65fa6d67b66e57e747849ce4f9979..51b9d38c72732c821cb4ee5bf362533406ce2494 100644 (file)
@@ -482,6 +482,12 @@ static const char *socket_activation_validate_opts(const char *device,
     return NULL;
 }
 
+static void qemu_nbd_shutdown(void)
+{
+    job_cancel_sync_all();
+    bdrv_close_all();
+}
+
 int main(int argc, char **argv)
 {
     BlockBackend *blk;
@@ -928,7 +934,7 @@ int main(int argc, char **argv)
         exit(EXIT_FAILURE);
     }
     bdrv_init();
-    atexit(bdrv_close_all);
+    atexit(qemu_nbd_shutdown);
 
     srcpath = argv[optind];
     if (imageOpts) {