Commit 495bf893 authored by Kevin Wolf's avatar Kevin Wolf
Browse files

qemu-nbd: Support help options for --object



Instead of parsing help options as normal object properties and
returning an error, provide the same help functionality as the system
emulator in qemu-nbd, too.

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
parent c6e5cdfd
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -507,6 +507,13 @@ static QemuOptsList qemu_object_opts = {
    },
};

static bool qemu_nbd_object_print_help(const char *type, QemuOpts *opts)
{
    if (user_creatable_print_help(type, opts)) {
        exit(0);
    }
    return true;
}


static QCryptoTLSCreds *nbd_get_tls_creds(const char *id, bool list,
@@ -902,7 +909,7 @@ int main(int argc, char **argv)

    qemu_opts_foreach(&qemu_object_opts,
                      user_creatable_add_opts_foreach,
                      NULL, &error_fatal);
                      qemu_nbd_object_print_help, &error_fatal);

    if (!trace_init_backends()) {
        exit(1);