From: Glauber Costa <gcosta@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 13/20] decorate application name
Date: Fri, 27 Jun 2008 17:38:16 -0300 [thread overview]
Message-ID: <1214599103-13846-14-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1214599103-13846-13-git-send-email-gcosta@redhat.com>
Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
accel.h | 10 ++++++++++
sdl.c | 7 +++++--
vl.c | 12 ++++++++++++
vnc.c | 6 ++++--
4 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/accel.h b/accel.h
index 99f4742..9755a9b 100644
--- a/accel.h
+++ b/accel.h
@@ -47,6 +47,15 @@ static inline void accel_cpu_interrupt(CPUState *env)
current_accel->cpu_interrupt(env);
}
+static inline char *accel_get_name(void)
+{
+ if (current_accel && current_accel->name)
+ return current_accel->name;
+ return NULL;
+}
+
+void decorate_app_name(void);
+
static inline void accel_start(void)
{
/* The top accelerator in the list gets tried first, but if it fails,
@@ -56,6 +65,7 @@ static inline void accel_start(void)
if (tmp->acc && tmp->acc->start && (!(tmp->acc->start())) ) {
tmp->active = 1;
current_accel = tmp->acc;
+ decorate_app_name();
break;
}
tmp = tmp->next;
diff --git a/sdl.c b/sdl.c
index bac60ea..5720b7f 100644
--- a/sdl.c
+++ b/sdl.c
@@ -218,9 +218,12 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
kbd_put_keycode(keycode & 0x7f);
}
+extern char qemu_app_name[];
+
static void sdl_update_caption(void)
{
char buf[1024];
+ char qemu_app_namei[512] = "QEMU";
const char *status = "";
if (!vm_running)
@@ -233,9 +236,9 @@ static void sdl_update_caption(void)
}
if (qemu_name)
- snprintf(buf, sizeof(buf), "QEMU (%s)%s", qemu_name, status);
+ snprintf(buf, sizeof(buf), "%s (%s)%s", qemu_app_name, qemu_name, status);
else
- snprintf(buf, sizeof(buf), "QEMU%s", status);
+ snprintf(buf, sizeof(buf), "%s%s", qemu_app_name, status);
SDL_WM_SetCaption(buf, "QEMU");
}
diff --git a/vl.c b/vl.c
index fd26b92..688fc3a 100644
--- a/vl.c
+++ b/vl.c
@@ -241,8 +241,20 @@ struct drive_opt {
static CPUState *cur_cpu;
static CPUState *next_cpu;
static int event_pending = 1;
+
QEMUAccel *current_accel;
QEMUCont *head = NULL;
+char qemu_app_name[20] = "QEMU";
+
+void decorate_app_name(void)
+{
+ char *name = accel_get_name();
+
+ if (!name)
+ sprintf(qemu_app_name, "QEMU");
+ else
+ sprintf(qemu_app_name, "QEMU/%s", name);
+}
#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
diff --git a/vnc.c b/vnc.c
index 31118ee..b55ed19 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1265,6 +1265,8 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
return 0;
}
+extern char qemu_app_name[];
+
static int protocol_client_init(VncState *vs, uint8_t *data, size_t len)
{
char pad[3] = { 0, 0, 0 };
@@ -1315,9 +1317,9 @@ static int protocol_client_init(VncState *vs, uint8_t *data, size_t len)
vnc_write(vs, pad, 3); /* padding */
if (qemu_name)
- size = snprintf(buf, sizeof(buf), "QEMU (%s)", qemu_name);
+ size = snprintf(buf, sizeof(buf), "%s (%s)", qemu_app_name, qemu_name);
else
- size = snprintf(buf, sizeof(buf), "QEMU");
+ size = snprintf(buf, sizeof(buf), "%s", qemu_app_name);
vnc_write_u32(vs, size);
vnc_write(vs, buf, size);
--
1.5.5.1
next prev parent reply other threads:[~2008-06-27 20:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-27 20:38 [Qemu-devel] [PATCH 0/20] QEMU Accel patch Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 01/20] split kqemu_init into two Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 02/20] introduce QEMUAccel and fill it with interrupt specific driver Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 03/20] init env made accel driver Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 04/20] wrap cache flushing functions into accel drivers Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 05/20] turn info kqemu into generic info accelerator Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 06/20] separate accelerator part of info profiler Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 07/20] move kqemu externs to kqemu.h Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 08/20] move disabling code to kqemu.c instead of vl.c Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 09/20] set_notdirty goes through accel wrapper Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 10/20] wrap modify_page through accel calls Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 11/20] remove kqemu reference from hw/pc.c Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 12/20] build list of available accelerators Glauber Costa
2008-06-27 20:38 ` Glauber Costa [this message]
2008-06-27 20:38 ` [Qemu-devel] [PATCH 14/20] tsc: kvm will use it, but it is pretty general Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 15/20] shift for masks Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 16/20] small changes in headers needed to acomodate kvm files as is Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 17/20] add hook to cpu_register_physical_memory Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 18/20] accel_trace_io Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 19/20] get_env accel wrapper Glauber Costa
2008-06-27 20:38 ` [Qemu-devel] [PATCH 20/20] add next_cpu_index Glauber Costa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1214599103-13846-14-git-send-email-gcosta@redhat.com \
--to=gcosta@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).