X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/23bafd75cd979ad3a21af10273c5a0c5d67d068b..afb6e20429d5853e79e9a8af4a68b51d14b0c0c1:/qemu-nbd.c diff --git a/qemu-nbd.c b/qemu-nbd.c index 3723493be1..51b9d38c72 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -22,18 +22,19 @@ #include #include "qapi/error.h" -#include "qemu-common.h" #include "qemu/cutils.h" #include "sysemu/block-backend.h" #include "block/block_int.h" #include "block/nbd.h" #include "qemu/main-loop.h" +#include "qemu/option.h" #include "qemu/error-report.h" #include "qemu/config-file.h" #include "qemu/bswap.h" #include "qemu/log.h" #include "qemu/systemd.h" #include "block/snapshot.h" +#include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" #include "qom/object_interfaces.h" #include "io/channel-socket.h" @@ -129,7 +130,7 @@ QEMU_HELP_BOTTOM "\n" static void version(const char *name) { printf( -"%s " QEMU_VERSION QEMU_PKGVERSION "\n" +"%s " QEMU_FULL_VERSION "\n" "Written by Anthony Liguori.\n" "\n" QEMU_COPYRIGHT "\n" @@ -481,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; @@ -927,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) {