vnc.c (7cb6b97300f0405b4c6856c49bdc33fa3265852f) | vnc.c (653c97473530b4d0e79950103447bad99b64ed79) |
---|---|
1/* 2 * QEMU VNC display driver 3 * 4 * Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws> 5 * Copyright (C) 2006 Fabrice Bellard 6 * Copyright (C) 2009 Red Hat, Inc 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy --- 36 unchanged lines hidden (view full) --- 45#include "qapi/qapi-commands-ui.h" 46#include "ui/input.h" 47#include "crypto/hash.h" 48#include "crypto/tlscredsanon.h" 49#include "crypto/tlscredsx509.h" 50#include "crypto/random.h" 51#include "qom/object_interfaces.h" 52#include "qemu/cutils.h" | 1/* 2 * QEMU VNC display driver 3 * 4 * Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws> 5 * Copyright (C) 2006 Fabrice Bellard 6 * Copyright (C) 2009 Red Hat, Inc 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy --- 36 unchanged lines hidden (view full) --- 45#include "qapi/qapi-commands-ui.h" 46#include "ui/input.h" 47#include "crypto/hash.h" 48#include "crypto/tlscredsanon.h" 49#include "crypto/tlscredsx509.h" 50#include "crypto/random.h" 51#include "qom/object_interfaces.h" 52#include "qemu/cutils.h" |
53#include "qemu/help_option.h" |
|
53#include "io/dns-resolver.h" 54 55#define VNC_REFRESH_INTERVAL_BASE GUI_REFRESH_INTERVAL_DEFAULT 56#define VNC_REFRESH_INTERVAL_INC 50 57#define VNC_REFRESH_INTERVAL_MAX GUI_REFRESH_INTERVAL_IDLE 58static const struct timeval VNC_REFRESH_STATS = { 0, 500000 }; 59static const struct timeval VNC_REFRESH_LOSSY = { 2, 0 }; 60 --- 4145 unchanged lines hidden (view full) --- 4206 id = g_strdup("default"); 4207 while (qemu_opts_find(olist, id)) { 4208 g_free(id); 4209 id = g_strdup_printf("vnc%d", i++); 4210 } 4211 qemu_opts_set_id(opts, id); 4212} 4213 | 54#include "io/dns-resolver.h" 55 56#define VNC_REFRESH_INTERVAL_BASE GUI_REFRESH_INTERVAL_DEFAULT 57#define VNC_REFRESH_INTERVAL_INC 50 58#define VNC_REFRESH_INTERVAL_MAX GUI_REFRESH_INTERVAL_IDLE 59static const struct timeval VNC_REFRESH_STATS = { 0, 500000 }; 60static const struct timeval VNC_REFRESH_LOSSY = { 2, 0 }; 61 --- 4145 unchanged lines hidden (view full) --- 4207 id = g_strdup("default"); 4208 while (qemu_opts_find(olist, id)) { 4209 g_free(id); 4210 id = g_strdup_printf("vnc%d", i++); 4211 } 4212 qemu_opts_set_id(opts, id); 4213} 4214 |
4214QemuOpts *vnc_parse(const char *str, Error **errp) | 4215void vnc_parse(const char *str) |
4215{ 4216 QemuOptsList *olist = qemu_find_opts("vnc"); | 4216{ 4217 QemuOptsList *olist = qemu_find_opts("vnc"); |
4217 QemuOpts *opts = qemu_opts_parse(olist, str, true, errp); | 4218 QemuOpts *opts = qemu_opts_parse_noisily(olist, str, !is_help_option(str)); |
4218 const char *id; 4219 4220 if (!opts) { | 4219 const char *id; 4220 4221 if (!opts) { |
4221 return NULL; | 4222 exit(1); |
4222 } 4223 4224 id = qemu_opts_id(opts); 4225 if (!id) { 4226 /* auto-assign id if not present */ 4227 vnc_auto_assign_id(olist, opts); 4228 } | 4223 } 4224 4225 id = qemu_opts_id(opts); 4226 if (!id) { 4227 /* auto-assign id if not present */ 4228 vnc_auto_assign_id(olist, opts); 4229 } |
4229 return opts; | |
4230} 4231 4232int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp) 4233{ 4234 Error *local_err = NULL; 4235 char *id = (char *)qemu_opts_id(opts); 4236 4237 assert(id); --- 18 unchanged lines hidden --- | 4230} 4231 4232int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp) 4233{ 4234 Error *local_err = NULL; 4235 char *id = (char *)qemu_opts_id(opts); 4236 4237 assert(id); --- 18 unchanged lines hidden --- |