From b3be57c358b3186b675ce4452a030fd3d9f37be0 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Tue, 4 Feb 2014 20:06:47 +0200 Subject: qtest: don't report signals if qtest driver enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qtest driver always uses signals to kill qemu no need to report it, whatever the accelerator state. Add API to detect qtest driver, and suppress reporting signals in this case. Reported-by: Andreas Färber Signed-off-by: Michael S. Tsirkin Signed-off-by: Andreas Färber --- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 383be1b617..a7b00cdd37 100644 --- a/vl.c +++ b/vl.c @@ -1750,7 +1750,7 @@ static int qemu_shutdown_requested(void) static void qemu_kill_report(void) { - if (!qtest_enabled() && shutdown_signal != -1) { + if (!qtest_driver() && shutdown_signal != -1) { fprintf(stderr, "qemu: terminating on signal %d", shutdown_signal); if (shutdown_pid == 0) { /* This happens for eg ^C at the terminal, so it's worth -- cgit v1.2.1 From 23802b4fe0cf5821b72aa5bc682e38c8c91bb168 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Mon, 10 Feb 2014 09:28:02 +0800 Subject: qtest: Don't segfault with invalid -qtest option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prints an error message, instead of core dump, when "-qtest" option value is invalid, e.g.: $ ./x86_64-softmmu/qemu-system-x86_64 -qtest unknown qemu-system-x86_64: Failed to initialize device for qtest: "unknown" Signed-off-by: Fam Zheng Signed-off-by: Andreas Färber --- vl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index a7b00cdd37..0f7d31f047 100644 --- a/vl.c +++ b/vl.c @@ -4078,7 +4078,13 @@ int main(int argc, char **argv, char **envp) configure_accelerator(); if (qtest_chrdev) { - qtest_init(qtest_chrdev, qtest_log); + Error *local_err = NULL; + qtest_init(qtest_chrdev, qtest_log, &local_err); + if (local_err) { + error_report("%s", error_get_pretty(local_err)); + error_free(local_err); + exit(1); + } } machine_opts = qemu_get_machine_opts(); -- cgit v1.2.1 From f31c41ff5e7d64680382e94b9ea35d52ab4ca045 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sat, 8 Feb 2014 11:01:54 +0100 Subject: block: Handle "rechs" and "large" translation options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sure, CHS translation is an obscure topic, and legacy options for hard-disk geometries are obscure as well. But since QEMU does nothing with it except telling the BIOS, and since there "large" and "rechs" are listed in the enums, parsing them seems to be the bare minimum. Acked-by: Stefan Hajnoczi Reviewed-by: Igor Mammedov Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini Signed-off-by: Andreas Färber --- vl.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 0f7d31f047..071372d309 100644 --- a/vl.c +++ b/vl.c @@ -3073,14 +3073,19 @@ int main(int argc, char **argv, char **envp) goto chs_fail; if (*p == ',') { p++; - if (!strcmp(p, "none")) + if (!strcmp(p, "large")) { + translation = BIOS_ATA_TRANSLATION_LARGE; + } else if (!strcmp(p, "rechs")) { + translation = BIOS_ATA_TRANSLATION_RECHS; + } else if (!strcmp(p, "none")) { translation = BIOS_ATA_TRANSLATION_NONE; - else if (!strcmp(p, "lba")) + } else if (!strcmp(p, "lba")) { translation = BIOS_ATA_TRANSLATION_LBA; - else if (!strcmp(p, "auto")) + } else if (!strcmp(p, "auto")) { translation = BIOS_ATA_TRANSLATION_AUTO; - else + } else { goto chs_fail; + } } else if (*p != '\0') { chs_fail: fprintf(stderr, "qemu: invalid physical CHS format\n"); @@ -3094,10 +3099,15 @@ int main(int argc, char **argv, char **envp) qemu_opt_set(hda_opts, "heads", num); snprintf(num, sizeof(num), "%d", secs); qemu_opt_set(hda_opts, "secs", num); - if (translation == BIOS_ATA_TRANSLATION_LBA) + if (translation == BIOS_ATA_TRANSLATION_LARGE) { + qemu_opt_set(hda_opts, "trans", "large"); + } else if (translation == BIOS_ATA_TRANSLATION_RECHS) { + qemu_opt_set(hda_opts, "trans", "rechs"); + } else if (translation == BIOS_ATA_TRANSLATION_LBA) { qemu_opt_set(hda_opts, "trans", "lba"); - if (translation == BIOS_ATA_TRANSLATION_NONE) + } else if (translation == BIOS_ATA_TRANSLATION_NONE) { qemu_opt_set(hda_opts, "trans", "none"); + } } } break; -- cgit v1.2.1