X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=monitor.c;h=6f960f13a6059c39713df5ca0562cfc5b8bb0882;hb=0517cc9863bd4753be56d47da1a568538069e19f;hp=2c8724407386eacf6cab3a33b65f528a602ef4a3;hpb=7c8eece45b10fc9b716850345118ed6fa8d17887;p=mirror_qemu.git diff --git a/monitor.c b/monitor.c index 2c87244073..6f960f13a6 100644 --- a/monitor.c +++ b/monitor.c @@ -23,6 +23,8 @@ */ #include "qemu/osdep.h" #include +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "monitor/qdev.h" #include "hw/usb.h" @@ -69,6 +71,8 @@ #include "trace/simple.h" #endif #include "exec/memory.h" +#include "exec/exec-all.h" +#include "qemu/log.h" #include "qmp-commands.h" #include "hmp.h" #include "qemu/thread.h" @@ -316,7 +320,7 @@ static void monitor_flush_locked(Monitor *mon) return; } if (rc > 0) { - /* partinal write */ + /* partial write */ QString *tmp = qstring_from_str(buf + rc); QDECREF(mon->outbuf); mon->outbuf = tmp; @@ -1107,7 +1111,12 @@ void qmp_client_migrate_info(const char *protocol, const char *hostname, static void hmp_logfile(Monitor *mon, const QDict *qdict) { - qemu_set_log_filename(qdict_get_str(qdict, "filename")); + Error *err = NULL; + + qemu_set_log_filename(qdict_get_str(qdict, "filename"), &err); + if (err) { + error_report_err(err); + } } static void hmp_log(Monitor *mon, const QDict *qdict) @@ -3428,12 +3437,12 @@ static void vm_completion(ReadLineState *rs, const char *str) { size_t len; BlockDriverState *bs; - BdrvNextIterator *it = NULL; + BdrvNextIterator it; len = strlen(str); readline_set_completion_index(rs, len); - while ((it = bdrv_next(it, &bs))) { + for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) { SnapshotInfoList *snapshots, *snapshot; AioContext *ctx = bdrv_get_aio_context(bs); bool ok = false; @@ -4269,3 +4278,16 @@ GICCapabilityList *qmp_query_gic_capabilities(Error **errp) return NULL; } #endif + +HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp) +{ + MachineState *ms = MACHINE(qdev_get_machine()); + MachineClass *mc = MACHINE_GET_CLASS(ms); + + if (!mc->query_hotpluggable_cpus) { + error_setg(errp, QERR_FEATURE_DISABLED, "query-hotpluggable-cpus"); + return NULL; + } + + return mc->query_hotpluggable_cpus(ms); +}