ssh.c (374c52467a38c2e811f6c0db4edc9ea7d5f34341) ssh.c (af91062ee1408f7f5bb58389d355d29a5040c648)
1/*
2 * Secure Shell (ssh) backend for QEMU.
3 *
4 * Copyright (C) 2013 Red Hat Inc., Richard W.M. Jones <rjones@redhat.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 592 unchanged lines hidden (view full) ---

601 return true;
602}
603
604static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
605{
606 BlockdevOptionsSsh *result = NULL;
607 QemuOpts *opts = NULL;
608 Error *local_err = NULL;
1/*
2 * Secure Shell (ssh) backend for QEMU.
3 *
4 * Copyright (C) 2013 Red Hat Inc., Richard W.M. Jones <rjones@redhat.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 592 unchanged lines hidden (view full) ---

601 return true;
602}
603
604static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
605{
606 BlockdevOptionsSsh *result = NULL;
607 QemuOpts *opts = NULL;
608 Error *local_err = NULL;
609 QObject *crumpled;
610 const QDictEntry *e;
611 Visitor *v;
612
613 /* Translate legacy options */
614 opts = qemu_opts_create(&ssh_runtime_opts, NULL, 0, &error_abort);
615 qemu_opts_absorb_qdict(opts, options, &local_err);
616 if (local_err) {
617 error_propagate(errp, local_err);
618 goto fail;
619 }
620
621 if (!ssh_process_legacy_options(options, opts, errp)) {
622 goto fail;
623 }
624
625 /* Create the QAPI object */
609 const QDictEntry *e;
610 Visitor *v;
611
612 /* Translate legacy options */
613 opts = qemu_opts_create(&ssh_runtime_opts, NULL, 0, &error_abort);
614 qemu_opts_absorb_qdict(opts, options, &local_err);
615 if (local_err) {
616 error_propagate(errp, local_err);
617 goto fail;
618 }
619
620 if (!ssh_process_legacy_options(options, opts, errp)) {
621 goto fail;
622 }
623
624 /* Create the QAPI object */
626 crumpled = qdict_crumple_for_keyval_qiv(options, errp);
627 if (crumpled == NULL) {
625 v = qobject_input_visitor_new_flat_confused(options, errp);
626 if (!v) {
628 goto fail;
629 }
630
627 goto fail;
628 }
629
631 v = qobject_input_visitor_new_keyval(crumpled);
632 visit_type_BlockdevOptionsSsh(v, NULL, &result, &local_err);
633 visit_free(v);
630 visit_type_BlockdevOptionsSsh(v, NULL, &result, &local_err);
631 visit_free(v);
634 qobject_unref(crumpled);
635
636 if (local_err) {
637 error_propagate(errp, local_err);
638 goto fail;
639 }
640
641 /* Remove the processed options from the QDict (the visitor processes
642 * _all_ options in the QDict) */

--- 661 unchanged lines hidden ---
632
633 if (local_err) {
634 error_propagate(errp, local_err);
635 goto fail;
636 }
637
638 /* Remove the processed options from the QDict (the visitor processes
639 * _all_ options in the QDict) */

--- 661 unchanged lines hidden ---