|
@@ -1096,7 +1096,7 @@ static int drive_init_func(QemuOpts *opts, void *opaque)
|
|
static int drive_enable_snapshot(QemuOpts *opts, void *opaque)
|
|
static int drive_enable_snapshot(QemuOpts *opts, void *opaque)
|
|
{
|
|
{
|
|
if (qemu_opt_get(opts, "snapshot") == NULL) {
|
|
if (qemu_opt_get(opts, "snapshot") == NULL) {
|
|
- qemu_opt_set(opts, "snapshot", "on");
|
|
|
|
|
|
+ qemu_opt_set(opts, "snapshot", "on", &error_abort);
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -2074,7 +2074,7 @@ static int balloon_parse(const char *arg)
|
|
opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
|
|
opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
|
|
&error_abort);
|
|
&error_abort);
|
|
}
|
|
}
|
|
- qemu_opt_set(opts, "driver", "virtio-balloon");
|
|
|
|
|
|
+ qemu_opt_set(opts, "driver", "virtio-balloon", &error_abort);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2220,11 +2220,11 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty)
|
|
error_report_err(local_err);
|
|
error_report_err(local_err);
|
|
exit(1);
|
|
exit(1);
|
|
}
|
|
}
|
|
- qemu_opt_set(opts, "mode", mode);
|
|
|
|
- qemu_opt_set(opts, "chardev", label);
|
|
|
|
|
|
+ qemu_opt_set(opts, "mode", mode, &error_abort);
|
|
|
|
+ qemu_opt_set(opts, "chardev", label, &error_abort);
|
|
qemu_opt_set_bool(opts, "pretty", pretty, &error_abort);
|
|
qemu_opt_set_bool(opts, "pretty", pretty, &error_abort);
|
|
if (def)
|
|
if (def)
|
|
- qemu_opt_set(opts, "default", "on");
|
|
|
|
|
|
+ qemu_opt_set(opts, "default", "on", &error_abort);
|
|
monitor_device_index++;
|
|
monitor_device_index++;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2336,13 +2336,13 @@ static int virtcon_parse(const char *devname)
|
|
|
|
|
|
bus_opts = qemu_opts_create(device, NULL, 0, &error_abort);
|
|
bus_opts = qemu_opts_create(device, NULL, 0, &error_abort);
|
|
if (arch_type == QEMU_ARCH_S390X) {
|
|
if (arch_type == QEMU_ARCH_S390X) {
|
|
- qemu_opt_set(bus_opts, "driver", "virtio-serial-s390");
|
|
|
|
|
|
+ qemu_opt_set(bus_opts, "driver", "virtio-serial-s390", &error_abort);
|
|
} else {
|
|
} else {
|
|
- qemu_opt_set(bus_opts, "driver", "virtio-serial-pci");
|
|
|
|
|
|
+ qemu_opt_set(bus_opts, "driver", "virtio-serial-pci", &error_abort);
|
|
}
|
|
}
|
|
|
|
|
|
dev_opts = qemu_opts_create(device, NULL, 0, &error_abort);
|
|
dev_opts = qemu_opts_create(device, NULL, 0, &error_abort);
|
|
- qemu_opt_set(dev_opts, "driver", "virtconsole");
|
|
|
|
|
|
+ qemu_opt_set(dev_opts, "driver", "virtconsole", &error_abort);
|
|
|
|
|
|
snprintf(label, sizeof(label), "virtcon%d", index);
|
|
snprintf(label, sizeof(label), "virtcon%d", index);
|
|
virtcon_hds[index] = qemu_chr_new(label, devname, NULL);
|
|
virtcon_hds[index] = qemu_chr_new(label, devname, NULL);
|
|
@@ -2351,7 +2351,7 @@ static int virtcon_parse(const char *devname)
|
|
" to character backend '%s'\n", devname);
|
|
" to character backend '%s'\n", devname);
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
- qemu_opt_set(dev_opts, "chardev", label);
|
|
|
|
|
|
+ qemu_opt_set(dev_opts, "chardev", label, &error_abort);
|
|
|
|
|
|
index++;
|
|
index++;
|
|
return 0;
|
|
return 0;
|
|
@@ -2375,7 +2375,7 @@ static int sclp_parse(const char *devname)
|
|
assert(arch_type == QEMU_ARCH_S390X);
|
|
assert(arch_type == QEMU_ARCH_S390X);
|
|
|
|
|
|
dev_opts = qemu_opts_create(device, NULL, 0, NULL);
|
|
dev_opts = qemu_opts_create(device, NULL, 0, NULL);
|
|
- qemu_opt_set(dev_opts, "driver", "sclpconsole");
|
|
|
|
|
|
+ qemu_opt_set(dev_opts, "driver", "sclpconsole", &error_abort);
|
|
|
|
|
|
snprintf(label, sizeof(label), "sclpcon%d", index);
|
|
snprintf(label, sizeof(label), "sclpcon%d", index);
|
|
sclp_hds[index] = qemu_chr_new(label, devname, NULL);
|
|
sclp_hds[index] = qemu_chr_new(label, devname, NULL);
|
|
@@ -2384,7 +2384,7 @@ static int sclp_parse(const char *devname)
|
|
" to character backend '%s'\n", devname);
|
|
" to character backend '%s'\n", devname);
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
- qemu_opt_set(dev_opts, "chardev", label);
|
|
|
|
|
|
+ qemu_opt_set(dev_opts, "chardev", label, &error_abort);
|
|
|
|
|
|
index++;
|
|
index++;
|
|
return 0;
|
|
return 0;
|
|
@@ -2402,8 +2402,8 @@ static int debugcon_parse(const char *devname)
|
|
fprintf(stderr, "qemu: already have a debugcon device\n");
|
|
fprintf(stderr, "qemu: already have a debugcon device\n");
|
|
exit(1);
|
|
exit(1);
|
|
}
|
|
}
|
|
- qemu_opt_set(opts, "driver", "isa-debugcon");
|
|
|
|
- qemu_opt_set(opts, "chardev", "debugcon");
|
|
|
|
|
|
+ qemu_opt_set(opts, "driver", "isa-debugcon", &error_abort);
|
|
|
|
+ qemu_opt_set(opts, "chardev", "debugcon", &error_abort);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2973,19 +2973,23 @@ int main(int argc, char **argv, char **envp)
|
|
if (hda_opts != NULL) {
|
|
if (hda_opts != NULL) {
|
|
char num[16];
|
|
char num[16];
|
|
snprintf(num, sizeof(num), "%d", cyls);
|
|
snprintf(num, sizeof(num), "%d", cyls);
|
|
- qemu_opt_set(hda_opts, "cyls", num);
|
|
|
|
|
|
+ qemu_opt_set(hda_opts, "cyls", num, &error_abort);
|
|
snprintf(num, sizeof(num), "%d", heads);
|
|
snprintf(num, sizeof(num), "%d", heads);
|
|
- qemu_opt_set(hda_opts, "heads", num);
|
|
|
|
|
|
+ qemu_opt_set(hda_opts, "heads", num, &error_abort);
|
|
snprintf(num, sizeof(num), "%d", secs);
|
|
snprintf(num, sizeof(num), "%d", secs);
|
|
- qemu_opt_set(hda_opts, "secs", num);
|
|
|
|
|
|
+ qemu_opt_set(hda_opts, "secs", num, &error_abort);
|
|
if (translation == BIOS_ATA_TRANSLATION_LARGE) {
|
|
if (translation == BIOS_ATA_TRANSLATION_LARGE) {
|
|
- qemu_opt_set(hda_opts, "trans", "large");
|
|
|
|
|
|
+ qemu_opt_set(hda_opts, "trans", "large",
|
|
|
|
+ &error_abort);
|
|
} else if (translation == BIOS_ATA_TRANSLATION_RECHS) {
|
|
} else if (translation == BIOS_ATA_TRANSLATION_RECHS) {
|
|
- qemu_opt_set(hda_opts, "trans", "rechs");
|
|
|
|
|
|
+ qemu_opt_set(hda_opts, "trans", "rechs",
|
|
|
|
+ &error_abort);
|
|
} else if (translation == BIOS_ATA_TRANSLATION_LBA) {
|
|
} else if (translation == BIOS_ATA_TRANSLATION_LBA) {
|
|
- qemu_opt_set(hda_opts, "trans", "lba");
|
|
|
|
|
|
+ qemu_opt_set(hda_opts, "trans", "lba",
|
|
|
|
+ &error_abort);
|
|
} else if (translation == BIOS_ATA_TRANSLATION_NONE) {
|
|
} else if (translation == BIOS_ATA_TRANSLATION_NONE) {
|
|
- qemu_opt_set(hda_opts, "trans", "none");
|
|
|
|
|
|
+ qemu_opt_set(hda_opts, "trans", "none",
|
|
|
|
+ &error_abort);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -3271,24 +3275,27 @@ int main(int argc, char **argv, char **envp)
|
|
writeout = qemu_opt_get(opts, "writeout");
|
|
writeout = qemu_opt_get(opts, "writeout");
|
|
if (writeout) {
|
|
if (writeout) {
|
|
#ifdef CONFIG_SYNC_FILE_RANGE
|
|
#ifdef CONFIG_SYNC_FILE_RANGE
|
|
- qemu_opt_set(fsdev, "writeout", writeout);
|
|
|
|
|
|
+ qemu_opt_set(fsdev, "writeout", writeout, &error_abort);
|
|
#else
|
|
#else
|
|
fprintf(stderr, "writeout=immediate not supported on "
|
|
fprintf(stderr, "writeout=immediate not supported on "
|
|
"this platform\n");
|
|
"this platform\n");
|
|
exit(1);
|
|
exit(1);
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
- qemu_opt_set(fsdev, "fsdriver", qemu_opt_get(opts, "fsdriver"));
|
|
|
|
- qemu_opt_set(fsdev, "path", qemu_opt_get(opts, "path"));
|
|
|
|
|
|
+ qemu_opt_set(fsdev, "fsdriver",
|
|
|
|
+ qemu_opt_get(opts, "fsdriver"), &error_abort);
|
|
|
|
+ qemu_opt_set(fsdev, "path", qemu_opt_get(opts, "path"),
|
|
|
|
+ &error_abort);
|
|
qemu_opt_set(fsdev, "security_model",
|
|
qemu_opt_set(fsdev, "security_model",
|
|
- qemu_opt_get(opts, "security_model"));
|
|
|
|
|
|
+ qemu_opt_get(opts, "security_model"),
|
|
|
|
+ &error_abort);
|
|
socket = qemu_opt_get(opts, "socket");
|
|
socket = qemu_opt_get(opts, "socket");
|
|
if (socket) {
|
|
if (socket) {
|
|
- qemu_opt_set(fsdev, "socket", socket);
|
|
|
|
|
|
+ qemu_opt_set(fsdev, "socket", socket, &error_abort);
|
|
}
|
|
}
|
|
sock_fd = qemu_opt_get(opts, "sock_fd");
|
|
sock_fd = qemu_opt_get(opts, "sock_fd");
|
|
if (sock_fd) {
|
|
if (sock_fd) {
|
|
- qemu_opt_set(fsdev, "sock_fd", sock_fd);
|
|
|
|
|
|
+ qemu_opt_set(fsdev, "sock_fd", sock_fd, &error_abort);
|
|
}
|
|
}
|
|
|
|
|
|
qemu_opt_set_bool(fsdev, "readonly",
|
|
qemu_opt_set_bool(fsdev, "readonly",
|
|
@@ -3296,11 +3303,11 @@ int main(int argc, char **argv, char **envp)
|
|
&error_abort);
|
|
&error_abort);
|
|
device = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
|
|
device = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
|
|
&error_abort);
|
|
&error_abort);
|
|
- qemu_opt_set(device, "driver", "virtio-9p-pci");
|
|
|
|
|
|
+ qemu_opt_set(device, "driver", "virtio-9p-pci", &error_abort);
|
|
qemu_opt_set(device, "fsdev",
|
|
qemu_opt_set(device, "fsdev",
|
|
- qemu_opt_get(opts, "mount_tag"));
|
|
|
|
|
|
+ qemu_opt_get(opts, "mount_tag"), &error_abort);
|
|
qemu_opt_set(device, "mount_tag",
|
|
qemu_opt_set(device, "mount_tag",
|
|
- qemu_opt_get(opts, "mount_tag"));
|
|
|
|
|
|
+ qemu_opt_get(opts, "mount_tag"), &error_abort);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case QEMU_OPTION_virtfs_synth: {
|
|
case QEMU_OPTION_virtfs_synth: {
|
|
@@ -3313,13 +3320,13 @@ int main(int argc, char **argv, char **envp)
|
|
fprintf(stderr, "duplicate option: %s\n", "virtfs_synth");
|
|
fprintf(stderr, "duplicate option: %s\n", "virtfs_synth");
|
|
exit(1);
|
|
exit(1);
|
|
}
|
|
}
|
|
- qemu_opt_set(fsdev, "fsdriver", "synth");
|
|
|
|
|
|
+ qemu_opt_set(fsdev, "fsdriver", "synth", &error_abort);
|
|
|
|
|
|
device = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
|
|
device = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
|
|
&error_abort);
|
|
&error_abort);
|
|
- qemu_opt_set(device, "driver", "virtio-9p-pci");
|
|
|
|
- qemu_opt_set(device, "fsdev", "v_synth");
|
|
|
|
- qemu_opt_set(device, "mount_tag", "v_synth");
|
|
|
|
|
|
+ qemu_opt_set(device, "driver", "virtio-9p-pci", &error_abort);
|
|
|
|
+ qemu_opt_set(device, "fsdev", "v_synth", &error_abort);
|
|
|
|
+ qemu_opt_set(device, "mount_tag", "v_synth", &error_abort);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case QEMU_OPTION_serial:
|
|
case QEMU_OPTION_serial:
|