diff options
author | Sebastian Tanase <sebastian.tanase@openwide.fr> | 2014-07-25 11:56:28 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-06 17:53:07 +0200 |
commit | 1ad9580bd730f195a59136d11fdc431f90f266aa (patch) | |
tree | a133036f4721959ce831bc0206c79dff7dc3ab96 /cpus.c | |
parent | 714683950547ea8173aefe25f574874c06233455 (diff) |
icount: Add QemuOpts for icount
Make icount parameter use QemuOpts style options in order
to easily add other suboptions.
Signed-off-by: Sebastian Tanase <sebastian.tanase@openwide.fr>
Tested-by: Camille Bégué <camille.begue@openwide.fr>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'cpus.c')
-rw-r--r-- | cpus.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -473,13 +473,21 @@ static const VMStateDescription vmstate_timers = { } }; -void configure_icount(const char *option) +void configure_icount(QemuOpts *opts, Error **errp) { + const char *option; + seqlock_init(&timers_state.vm_clock_seqlock, NULL); vmstate_register(NULL, 0, &vmstate_timers, &timers_state); + option = qemu_opt_get(opts, "shift"); if (!option) { return; } + /* When using -icount shift, the shift option will be + misinterpreted as a boolean */ + if (strcmp(option, "on") == 0 || strcmp(option, "off") == 0) { + error_setg(errp, "The shift option must be a number or auto"); + } icount_warp_timer = timer_new_ns(QEMU_CLOCK_REALTIME, icount_warp_rt, NULL); |