X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=hmp.c;h=4fb76ec7a71bd6f2395dc5023d35187a25ea5bcd;hb=bf0fda346694db1eddecff1d74ff9f4d5eba3461;hp=420d48bea61a24112fbb9ece2c1fe0862567ade4;hpb=3f23624c848b8f1c88e4305fe01e19b2520bfd3d;p=qemu.git diff --git a/hmp.c b/hmp.c index 420d48bea..4fb76ec7a 100644 --- a/hmp.c +++ b/hmp.c @@ -15,7 +15,7 @@ #include "hmp.h" #include "net/net.h" -#include "char/char.h" +#include "sysemu/char.h" #include "qemu/option.h" #include "qemu/timer.h" #include "qmp-commands.h" @@ -173,6 +173,8 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) info->ram->total >> 10); monitor_printf(mon, "duplicate: %" PRIu64 " pages\n", info->ram->duplicate); + monitor_printf(mon, "skipped: %" PRIu64 " pages\n", + info->ram->skipped); monitor_printf(mon, "normal: %" PRIu64 " pages\n", info->ram->normal); monitor_printf(mon, "normal bytes: %" PRIu64 " kbytes\n", @@ -607,6 +609,50 @@ void hmp_info_block_jobs(Monitor *mon, const QDict *qdict) } } +void hmp_info_tpm(Monitor *mon, const QDict *qdict) +{ + TPMInfoList *info_list, *info; + Error *err = NULL; + unsigned int c = 0; + TPMPassthroughOptions *tpo; + + info_list = qmp_query_tpm(&err); + if (err) { + monitor_printf(mon, "TPM device not supported\n"); + error_free(err); + return; + } + + if (info_list) { + monitor_printf(mon, "TPM device:\n"); + } + + for (info = info_list; info; info = info->next) { + TPMInfo *ti = info->value; + monitor_printf(mon, " tpm%d: model=%s\n", + c, TpmModel_lookup[ti->model]); + + monitor_printf(mon, " \\ %s: type=%s", + ti->id, TpmTypeOptionsKind_lookup[ti->options->kind]); + + switch (ti->options->kind) { + case TPM_TYPE_OPTIONS_KIND_PASSTHROUGH: + tpo = ti->options->passthrough; + monitor_printf(mon, "%s%s%s%s", + tpo->has_path ? ",path=" : "", + tpo->has_path ? tpo->path : "", + tpo->has_cancel_path ? ",cancel-path=" : "", + tpo->has_cancel_path ? tpo->cancel_path : ""); + break; + case TPM_TYPE_OPTIONS_KIND_MAX: + break; + } + monitor_printf(mon, "\n"); + c++; + } + qapi_free_TPMInfoList(info_list); +} + void hmp_quit(Monitor *mon, const QDict *qdict) { monitor_suspend(mon); @@ -1365,7 +1411,7 @@ void hmp_chardev_add(Monitor *mon, const QDict *qdict) opts = qemu_opts_parse(qemu_find_opts("chardev"), args, 1); if (opts == NULL) { - error_setg(&err, "Parsing chardev args failed\n"); + error_setg(&err, "Parsing chardev args failed"); } else { qemu_chr_new_from_opts(opts, NULL, &err); }