raw-format.c (235e59cf03ed75d0ce96c97343194ed11c146231) | raw-format.c (af175e85f92c870386ad74f466e29537b79611d3) |
---|---|
1/* BlockDriver implementation for "raw" format driver 2 * 3 * Copyright (C) 2010-2016 Red Hat, Inc. 4 * Copyright (C) 2010, Blue Swirl <blauwirbel@gmail.com> 5 * Copyright (C) 2009, Anthony Liguori <aliguori@us.ibm.com> 6 * 7 * Author: 8 * Laszlo Ersek <lersek@redhat.com> --- 60 unchanged lines hidden (view full) --- 69 }, 70 { /* end of list */ } 71 } 72}; 73 74static int raw_read_options(QDict *options, uint64_t *offset, bool *has_size, 75 uint64_t *size, Error **errp) 76{ | 1/* BlockDriver implementation for "raw" format driver 2 * 3 * Copyright (C) 2010-2016 Red Hat, Inc. 4 * Copyright (C) 2010, Blue Swirl <blauwirbel@gmail.com> 5 * Copyright (C) 2009, Anthony Liguori <aliguori@us.ibm.com> 6 * 7 * Author: 8 * Laszlo Ersek <lersek@redhat.com> --- 60 unchanged lines hidden (view full) --- 69 }, 70 { /* end of list */ } 71 } 72}; 73 74static int raw_read_options(QDict *options, uint64_t *offset, bool *has_size, 75 uint64_t *size, Error **errp) 76{ |
77 Error *local_err = NULL; | |
78 QemuOpts *opts = NULL; 79 int ret; 80 81 opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort); | 77 QemuOpts *opts = NULL; 78 int ret; 79 80 opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort); |
82 if (!qemu_opts_absorb_qdict(opts, options, &local_err)) { 83 error_propagate(errp, local_err); | 81 if (!qemu_opts_absorb_qdict(opts, options, errp)) { |
84 ret = -EINVAL; 85 goto end; 86 } 87 88 *offset = qemu_opt_get_size(opts, "offset", 0); 89 *has_size = qemu_opt_find(opts, "size"); 90 *size = qemu_opt_get_size(opts, "size", 0); 91 --- 529 unchanged lines hidden --- | 82 ret = -EINVAL; 83 goto end; 84 } 85 86 *offset = qemu_opt_get_size(opts, "offset", 0); 87 *has_size = qemu_opt_find(opts, "size"); 88 *size = qemu_opt_get_size(opts, "size", 0); 89 --- 529 unchanged lines hidden --- |