aboutsummaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
authorSebastian Tanase <sebastian.tanase@openwide.fr>2014-07-25 11:56:28 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2014-08-06 17:53:07 +0200
commit1ad9580bd730f195a59136d11fdc431f90f266aa (patch)
treea133036f4721959ce831bc0206c79dff7dc3ab96 /cpus.c
parent714683950547ea8173aefe25f574874c06233455 (diff)
downloadqemu-arm-1ad9580bd730f195a59136d11fdc431f90f266aa.tar.gz
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.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/cpus.c b/cpus.c
index bbb8d4e8be..8291044203 100644
--- a/cpus.c
+++ b/cpus.c
@@ -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);