From 57bb40c9db408f692ec0a5365a141524b5cd7680 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Mon, 16 Jan 2017 16:40:05 +0800 Subject: memory: hmp: add "-f" for "info mtree" Adding one more option "-f" for "info mtree" to dump the flat views of all the address spaces. This will be useful to debug the memory rendering logic, also it'll be much easier with it to know what memory region is handling what address range. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Message-Id: <1484556005-29701-3-git-send-email-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- monitor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index 8b06b63..6ac4e95 100644 --- a/monitor.c +++ b/monitor.c @@ -1529,7 +1529,9 @@ static void hmp_boot_set(Monitor *mon, const QDict *qdict) static void hmp_info_mtree(Monitor *mon, const QDict *qdict) { - mtree_info((fprintf_function)monitor_printf, mon); + bool flatview = qdict_get_try_bool(qdict, "flatview", false); + + mtree_info((fprintf_function)monitor_printf, mon, flatview); } static void hmp_info_numa(Monitor *mon, const QDict *qdict) -- cgit v1.1 From ad5c679c7f4c10cc1bf4899ee2dfba08cc383f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 21 Oct 2016 22:38:41 +0300 Subject: char: introduce generic qemu_chr_get_kind() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows to remove the "is_mux" field from CharDriverState. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index 6ac4e95..24add02 100644 --- a/monitor.c +++ b/monitor.c @@ -3196,7 +3196,7 @@ static void ringbuf_completion(ReadLineState *rs, const char *str) if (!strncmp(chr_info->label, str, len)) { CharDriverState *chr = qemu_chr_find(chr_info->label); - if (chr && chr_is_ringbuf(chr)) { + if (chr && qemu_chr_is_ringbuf(chr)) { readline_add_completion(rs, chr_info->label); } } -- cgit v1.1 From 0ec7b3e7f21caf6bfde404528928d600b661ea8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 7 Dec 2016 16:20:22 +0300 Subject: char: rename CharDriverState Chardev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pick a uniform chardev type name. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index 24add02..065f659 100644 --- a/monitor.c +++ b/monitor.c @@ -3195,7 +3195,7 @@ static void ringbuf_completion(ReadLineState *rs, const char *str) ChardevInfo *chr_info = list->value; if (!strncmp(chr_info->label, str, len)) { - CharDriverState *chr = qemu_chr_find(chr_info->label); + Chardev *chr = qemu_chr_find(chr_info->label); if (chr && qemu_chr_is_ringbuf(chr)) { readline_add_completion(rs, chr_info->label); } @@ -3985,7 +3985,7 @@ static void __attribute__((constructor)) monitor_lock_init(void) qemu_mutex_init(&monitor_lock); } -void monitor_init(CharDriverState *chr, int flags) +void monitor_init(Chardev *chr, int flags) { static int is_first_init = 1; Monitor *mon; -- cgit v1.1 From 777357d758d937c9dd83082c39aff9f1e53e9ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 7 Dec 2016 18:39:10 +0300 Subject: chardev: qom-ify MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Turn Chardev into Object. qemu_chr_alloc() is replaced by the qemu_chardev_new() constructor. It will call qemu_char_open() to open/intialize the chardev with the ChardevCommon *backend settings. The CharDriver::create() callback is turned into a ChardevClass::open() which is called from the newly introduced qemu_chardev_open(). "chardev-gdb" and "chardev-hci" are internal chardev and aren't creatable directly with -chardev. Use a new internal flag to disable them. We may want to use TYPE_USER_CREATABLE interface instead, or perhaps allow -chardev usage. Although in general we keep typename and macros private, unless the type is being used by some other file, in this patch, all types and common helper macros for qemu-char.c are in char.h. This is to help transition now (some types must be declared early, while some aren't shared) and when splitting in several units. This is to be improved later. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index 065f659..25a480a 100644 --- a/monitor.c +++ b/monitor.c @@ -3196,7 +3196,7 @@ static void ringbuf_completion(ReadLineState *rs, const char *str) if (!strncmp(chr_info->label, str, len)) { Chardev *chr = qemu_chr_find(chr_info->label); - if (chr && qemu_chr_is_ringbuf(chr)) { + if (chr && CHARDEV_IS_RINGBUF(chr)) { readline_add_completion(rs, chr_info->label); } } -- cgit v1.1