blockdev.c (20a63d2cec838c2dde4d246c4d7abe747d9b7a11) blockdev.c (87ea75d5e135c0527c6a9dbac4317913409f28c7)
1/*
2 * QEMU host block devices
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or
7 * later. See the COPYING file in the top-level directory.
8 *

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

677 }
678 qemu_opt_unset(all_opts, "cache");
679 }
680
681 /* Get a QDict for processing the options */
682 bs_opts = qdict_new();
683 qemu_opts_to_qdict(all_opts, bs_opts);
684
1/*
2 * QEMU host block devices
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or
7 * later. See the COPYING file in the top-level directory.
8 *

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

677 }
678 qemu_opt_unset(all_opts, "cache");
679 }
680
681 /* Get a QDict for processing the options */
682 bs_opts = qdict_new();
683 qemu_opts_to_qdict(all_opts, bs_opts);
684
685 legacy_opts = qemu_opts_create_nofail(&qemu_legacy_drive_opts);
685 legacy_opts = qemu_opts_create(&qemu_legacy_drive_opts, NULL, 0,
686 &error_abort);
686 qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err);
687 if (error_is_set(&local_err)) {
688 qerror_report_err(local_err);
689 error_free(local_err);
690 goto fail;
691 }
692
693 /* Deprecated option boot=[on|off] */

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

848 devaddr = qemu_opt_get(legacy_opts, "addr");
849 if (devaddr && type != IF_VIRTIO) {
850 error_report("addr is not supported by this bus type");
851 goto fail;
852 }
853
854 if (type == IF_VIRTIO) {
855 QemuOpts *devopts;
687 qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err);
688 if (error_is_set(&local_err)) {
689 qerror_report_err(local_err);
690 error_free(local_err);
691 goto fail;
692 }
693
694 /* Deprecated option boot=[on|off] */

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

849 devaddr = qemu_opt_get(legacy_opts, "addr");
850 if (devaddr && type != IF_VIRTIO) {
851 error_report("addr is not supported by this bus type");
852 goto fail;
853 }
854
855 if (type == IF_VIRTIO) {
856 QemuOpts *devopts;
856 devopts = qemu_opts_create_nofail(qemu_find_opts("device"));
857 devopts = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
858 &error_abort);
857 if (arch_type == QEMU_ARCH_S390X) {
858 qemu_opt_set(devopts, "driver", "virtio-blk-s390");
859 } else {
860 qemu_opt_set(devopts, "driver", "virtio-blk-pci");
861 }
862 qemu_opt_set(devopts, "drive", qdict_get_str(bs_opts, "id"));
863 if (devaddr) {
864 qemu_opt_set(devopts, "addr", devaddr);

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

1815 base_bs = bdrv_find_base(top_bs);
1816 }
1817
1818 if (base_bs == NULL) {
1819 error_set(errp, QERR_BASE_NOT_FOUND, base ? base : "NULL");
1820 return;
1821 }
1822
859 if (arch_type == QEMU_ARCH_S390X) {
860 qemu_opt_set(devopts, "driver", "virtio-blk-s390");
861 } else {
862 qemu_opt_set(devopts, "driver", "virtio-blk-pci");
863 }
864 qemu_opt_set(devopts, "drive", qdict_get_str(bs_opts, "id"));
865 if (devaddr) {
866 qemu_opt_set(devopts, "addr", devaddr);

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

1817 base_bs = bdrv_find_base(top_bs);
1818 }
1819
1820 if (base_bs == NULL) {
1821 error_set(errp, QERR_BASE_NOT_FOUND, base ? base : "NULL");
1822 return;
1823 }
1824
1823 if (top_bs == bs) {
1824 commit_active_start(bs, base_bs, speed, on_error, block_job_cb,
1825 bs, &local_err);
1826 } else {
1827 commit_start(bs, base_bs, top_bs, speed, on_error, block_job_cb, bs,
1828 &local_err);
1829 }
1825 commit_start(bs, base_bs, top_bs, speed, on_error, block_job_cb, bs,
1826 &local_err);
1830 if (local_err != NULL) {
1831 error_propagate(errp, local_err);
1832 return;
1833 }
1834}
1835
1836void qmp_drive_backup(const char *device, const char *target,
1837 bool has_format, const char *format,

--- 529 unchanged lines hidden ---
1827 if (local_err != NULL) {
1828 error_propagate(errp, local_err);
1829 return;
1830 }
1831}
1832
1833void qmp_drive_backup(const char *device, const char *target,
1834 bool has_format, const char *format,

--- 529 unchanged lines hidden ---