diff --git a/qemu-nbd.c b/qemu-nbd.c index bcdb74ff13..f71f5125d8 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -584,6 +584,9 @@ int main(int argc, char **argv) const char *pid_file_name = NULL; const char *selinux_label = NULL; BlockExportOptions *export_opts; +#if HAVE_NBD_DEVICE + struct NbdClientOpts opts; +#endif #ifdef CONFIG_POSIX os_setup_early_signal_handling(); @@ -1122,7 +1125,7 @@ int main(int argc, char **argv) if (device) { #if HAVE_NBD_DEVICE int ret; - struct NbdClientOpts opts = { + opts = (struct NbdClientOpts) { .device = device, .fork_process = fork_process, };