aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-07-04 15:09:22 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2013-07-09 13:38:58 -0500
commit2ff3de685a875ece3ee21256736c0a9dbf39dc4c (patch)
tree4dc758ba80a89c26d47b93b2c5282e27cdacc443 /exec.c
parent7bccd9402691e712305bc3b5cc6cf2fa1cc27631 (diff)
downloadqemu-2ff3de685a875ece3ee21256736c0a9dbf39dc4c.zip
qemu-2ff3de685a875ece3ee21256736c0a9dbf39dc4c.tar.gz
qemu-2ff3de685a875ece3ee21256736c0a9dbf39dc4c.tar.bz2
Simplify -machine option queries with qemu_get_machine_opts()
The previous two commits fixed bugs in -machine option queries. I can't find fault with the remaining queries, but let's use qemu_get_machine_opts() everywhere, for consistency, simplicity and robustness. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372943363-24081-7-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/exec.c b/exec.c
index 485d811..e150935 100644
--- a/exec.c
+++ b/exec.c
@@ -31,6 +31,7 @@
#include "hw/qdev.h"
#include "qemu/osdep.h"
#include "sysemu/kvm.h"
+#include "sysemu/sysemu.h"
#include "hw/xen/xen.h"
#include "qemu/timer.h"
#include "qemu/config-file.h"
@@ -1043,12 +1044,10 @@ ram_addr_t last_ram_offset(void)
static void qemu_ram_setup_dump(void *addr, ram_addr_t size)
{
int ret;
- QemuOpts *machine_opts;
/* Use MADV_DONTDUMP, if user doesn't want the guest memory in the core */
- machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
- if (machine_opts &&
- !qemu_opt_get_bool(machine_opts, "dump-guest-core", true)) {
+ if (!qemu_opt_get_bool(qemu_get_machine_opts(),
+ "dump-guest-core", true)) {
ret = qemu_madvise(addr, size, QEMU_MADV_DONTDUMP);
if (ret) {
perror("qemu_madvise");
@@ -1095,10 +1094,7 @@ void qemu_ram_set_idstr(ram_addr_t addr, const char *name, DeviceState *dev)
static int memory_try_enable_merging(void *addr, size_t len)
{
- QemuOpts *opts;
-
- opts = qemu_opts_find(qemu_find_opts("machine"), 0);
- if (opts && !qemu_opt_get_bool(opts, "mem-merge", true)) {
+ if (!qemu_opt_get_bool(qemu_get_machine_opts(), "mem-merge", true)) {
/* disabled by the user */
return 0;
}