#include "exec/exec-all.h"
#include "qemu/log.h"
#include "qemu/option.h"
-#include "qmp-commands.h"
#include "hmp.h"
#include "qemu/thread.h"
#include "block/qapi.h"
+#include "qapi/qapi-commands.h"
+#include "qapi/qapi-events.h"
#include "qapi/error.h"
#include "qapi/qmp-event.h"
-#include "qapi-event.h"
-#include "qmp-introspect.h"
+#include "qapi/qapi-introspect.h"
#include "sysemu/qtest.h"
#include "sysemu/cpus.h"
#include "qemu/cutils.h"
* visit_type_SchemaInfoList() into a SchemaInfoList, then marshal it
* to QObject with generated output marshallers, every time. Instead,
* we do it in test-qobject-input-visitor.c, just to make sure
- * qapi-introspect.py's output actually conforms to the schema.
+ * qapi-gen.py's output actually conforms to the schema.
*/
static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
Error **errp)
return 0;
}
-CPUState *mon_get_cpu(void)
+static CPUState *mon_get_cpu_sync(bool synchronize)
{
CPUState *cpu;
monitor_set_cpu(first_cpu->cpu_index);
cpu = first_cpu;
}
- cpu_synchronize_state(cpu);
+ if (synchronize) {
+ cpu_synchronize_state(cpu);
+ }
return cpu;
}
+CPUState *mon_get_cpu(void)
+{
+ return mon_get_cpu_sync(true);
+}
+
CPUArchState *mon_get_cpu_env(void)
{
CPUState *cs = mon_get_cpu();
int monitor_get_cpu_index(void)
{
- CPUState *cs = mon_get_cpu();
+ CPUState *cs = mon_get_cpu_sync(false);
return cs ? cs->cpu_index : UNASSIGNED_CPU_INDEX;
}
{
const char *cmdname;
int i;
- const char *ptype, *str, *name;
+ const char *ptype, *old_ptype, *str, *name;
const mon_cmd_t *cmd;
BlockBackend *blk = NULL;
}
}
str = args[nb_args - 1];
- while (*ptype == '-' && ptype[1] != '\0') {
+ old_ptype = NULL;
+ while (*ptype == '-' && old_ptype != ptype) {
+ old_ptype = ptype;
ptype = next_arg_type(ptype);
}
switch(*ptype) {
},{
.name = "chardev",
.type = QEMU_OPT_STRING,
- },{
- .name = "default", /* deprecated */
- .type = QEMU_OPT_BOOL,
},{
.name = "pretty",
.type = QEMU_OPT_BOOL,