[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/3] vnc: add a is_vnc_active() helper
From: |
Amit Shah |
Subject: |
[Qemu-devel] [PATCH 2/3] vnc: add a is_vnc_active() helper |
Date: |
Mon, 27 Jul 2009 23:34:35 +0530 |
This helper is introduced to query the status of vnc.
Signed-off-by: Amit Shah <address@hidden>
---
vnc.c | 10 +++++++++-
vnc.h | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/vnc.c b/vnc.c
index de0ff87..e4e78dc 100644
--- a/vnc.c
+++ b/vnc.c
@@ -176,9 +176,17 @@ static void do_info_vnc_client(Monitor *mon, VncState
*client)
#endif
}
-void do_info_vnc(Monitor *mon)
+int is_vnc_active(void)
{
if (vnc_display == NULL || vnc_display->display == NULL) {
+ return 0;
+ }
+ return 1;
+}
+
+void do_info_vnc(Monitor *mon)
+{
+ if (!is_vnc_active()) {
monitor_printf(mon, "Server: disabled\n");
} else {
char *serverAddr = vnc_socket_local_addr(" address: %s:%s\n",
diff --git a/vnc.h b/vnc.h
index 3ae95f3..9739c35 100644
--- a/vnc.h
+++ b/vnc.h
@@ -313,7 +313,7 @@ void buffer_append(Buffer *buffer, const void *data, size_t
len);
/* Misc helpers */
+int is_vnc_active(void);
char *vnc_socket_local_addr(const char *format, int fd);
char *vnc_socket_remote_addr(const char *format, int fd);
-
#endif /* __QEMU_VNC_H */
--
1.6.2.5
- [Qemu-devel] virtio-serial: An interface for host-guest communication, Amit Shah, 2009/07/27
- [Qemu-devel] Re: virtio-serial: An interface for host-guest communication, Anthony Liguori, 2009/07/27
- Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication, Daniel P. Berrange, 2009/07/27
- Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication, Anthony Liguori, 2009/07/27
- Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication, Jamie Lokier, 2009/07/27
- Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication, Anthony Liguori, 2009/07/27
- Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication, Amit Shah, 2009/07/28
- Message not available
- Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication, Amit Shah, 2009/07/29
- Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication, Gleb Natapov, 2009/07/29
- Message not available
- Re: [Qemu-devel] Re: virtio-serial: An interface for host-guest communication, Anthony Liguori, 2009/07/28