From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6Kna-0001Dz-Qo for qemu-devel@nongnu.org; Thu, 23 Jan 2014 08:58:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6KnR-0003wc-BD for qemu-devel@nongnu.org; Thu, 23 Jan 2014 08:58:26 -0500 Received: from cantor2.suse.de ([195.135.220.15]:39461 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6KnR-0003wW-5q for qemu-devel@nongnu.org; Thu, 23 Jan 2014 08:58:17 -0500 Message-ID: <52E11FF6.1070405@suse.de> Date: Thu, 23 Jan 2014 14:58:14 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1384273995-16486-1-git-send-email-cminyard@mvista.com> <1384273995-16486-2-git-send-email-cminyard@mvista.com> <52E11A00.3060109@suse.de> In-Reply-To: <52E11A00.3060109@suse.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 01/16] qemu-char: Allocate CharDriverState in qemu_chr_new_from_opts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Minyard , qemu-devel@nongnu.org Cc: Bret Ketchum , Corey Minyard , "Michael S. Tsirkin" Am 23.01.2014 14:32, schrieb Andreas F=E4rber: > Am 12.11.2013 17:33, schrieb Corey Minyard: >> This allocates the CharDriverState structure and passes it in to the >> open routine. This allows a coming option to automatically attempt to >> reconnect a chardev if the connection fails. The chardev has to be >> kept around so a reconnect can be done on it. >> >> Signed-off-by: Corey Minyard > [...] >> diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h >> index 86c75c7..eadb9c9 100644 >> --- a/include/ui/qemu-spice.h >> +++ b/include/ui/qemu-spice.h >> @@ -46,9 +46,11 @@ int qemu_spice_migrate_info(const char *hostname, i= nt port, int tls_port, >> void do_info_spice_print(Monitor *mon, const QObject *data); >> void do_info_spice(Monitor *mon, QObject **ret_data); >> =20 >> -CharDriverState *qemu_chr_open_spice_vmc(const char *type); >> +CharDriverState *qemu_chr_open_spice_vmc(CharDriverState *chr, >> + const char *type); >> #if SPICE_SERVER_VERSION >=3D 0x000c02 >> -CharDriverState *qemu_chr_open_spice_port(const char *name); >> +CharDriverState *qemu_chr_open_spice_port(CharDriverSTate *chr, >=20 > This needs to be CharDriverState. >=20 >> + const char *name); >> void qemu_spice_register_ports(void); >> #else >> static inline CharDriverState *qemu_chr_open_spice_port(const char *n= ame) > [snip] I also needed the following: diff --git a/ui/gtk.c b/ui/gtk.c index 6316f5b..c2210a2 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1113,11 +1113,8 @@ static int gd_vc_chr_write(CharDriverState *chr, const uint8_t *buf, int len) static int nb_vcs; static CharDriverState *vcs[MAX_VCS]; -static CharDriverState *gd_vc_handler(ChardevVC *unused) +static CharDriverState *gd_vc_handler(CharDriverState *chr, ChardevVC *unused) { - CharDriverState *chr; - - chr =3D g_malloc0(sizeof(*chr)); chr->chr_write =3D gd_vc_chr_write; /* defer OPENED events until our vc is fully initialized */ chr->explicit_be_open =3D true; Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg