From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWD1M-0002IY-Hk for qemu-devel@nongnu.org; Thu, 21 Aug 2008 12:28:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWD1I-0002GZ-TF for qemu-devel@nongnu.org; Thu, 21 Aug 2008 12:28:22 -0400 Received: from [199.232.76.173] (port=37104 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWD1H-0002Fs-JN for qemu-devel@nongnu.org; Thu, 21 Aug 2008 12:28:19 -0400 Received: from mx1.redhat.com ([66.187.233.31]:46329) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KWD1G-0005y9-Do for qemu-devel@nongnu.org; Thu, 21 Aug 2008 12:28:18 -0400 From: Gerd Hoffmann Date: Thu, 21 Aug 2008 18:27:33 +0200 Message-Id: <1219336054-15919-13-git-send-email-kraxel@redhat.com> In-Reply-To: <1219336054-15919-1-git-send-email-kraxel@redhat.com> References: <1219336054-15919-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 12/13] set vnc password from xenstore. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, xen-devel@lists.xensource.com Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- hw/xen_machine_pv.c | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/hw/xen_machine_pv.c b/hw/xen_machine_pv.c index 851837c..9f18742 100644 --- a/hw/xen_machine_pv.c +++ b/hw/xen_machine_pv.c @@ -24,6 +24,7 @@ #include "hw.h" #include "boards.h" +#include "console.h" #include "xen_backend.h" @@ -110,6 +111,29 @@ static int xen_init_pv(DisplayState *ds) return 0; } +static void xen_init_vnc(void) +{ + char xspath[256], *dom = NULL, *vm = NULL, *pw = NULL; + int len; + + dom = xs_get_domain_path(xenstore, xen_domid); + snprintf(xspath, sizeof(xspath), "%s/vm", dom); + vm = xs_read(xenstore, 0, xspath, &len); + if (!vm) + goto out; + snprintf(xspath, sizeof(xspath), "%s/vncpassword", vm); + pw = xs_read(xenstore, 0, xspath, &len); + if (!pw || !strlen(pw)) + goto out; + vnc_display_password(NULL, pw); + fprintf(stderr, "vnc password set from xenstore\n"); + +out: + free(dom); + free(vm); + free(pw); +} + /* -------------------------------------------------------------------- */ /* paravirtualized xen machine */ @@ -136,6 +160,8 @@ static void xenpv_init(ram_addr_t ram_size, int vga_ram_size, goto err; } + xen_init_vnc(); + /* create dummy cpu, halted */ if (cpu_model == NULL) { #ifdef TARGET_X86_64 -- 1.5.5.1