From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHizQ-0005XY-BO for qemu-devel@nongnu.org; Mon, 07 Dec 2009 14:11:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHizK-0005Uz-Ui for qemu-devel@nongnu.org; Mon, 07 Dec 2009 14:11:19 -0500 Received: from [199.232.76.173] (port=51525 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHizK-0005Us-OB for qemu-devel@nongnu.org; Mon, 07 Dec 2009 14:11:14 -0500 Received: from qw-out-1920.google.com ([74.125.92.146]:56236) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHizK-00005H-5m for qemu-devel@nongnu.org; Mon, 07 Dec 2009 14:11:14 -0500 Received: by qw-out-1920.google.com with SMTP id 14so659140qwa.4 for ; Mon, 07 Dec 2009 11:11:09 -0800 (PST) Message-ID: <4B1D534B.5060609@codemonkey.ws> Date: Mon, 07 Dec 2009 13:11:07 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [FOR 0.12 PATCH v3 17/21] rework -monitor handling, switch to QemuOpts References: <1260189773-20728-1-git-send-email-kraxel@redhat.com> <1260189773-20728-18-git-send-email-kraxel@redhat.com> In-Reply-To: <1260189773-20728-18-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org, agraf@suse.de Gerd Hoffmann wrote: > This patch reworks the -monitor handling: > > - It adds a new "mon" QemuOpts list for the monitor(s). > - It adds a monitor_parse() function to parse the -monitor switch. > - It adds a mon_init function to initialize the monitor(s) from the > "mon" QemuOpts list. > - It winds up everything and removes the old bits. > > Signed-off-by: Gerd Hoffmann > This SEGVs as Luiz has reported, but it also has some debugging noise in it: > +static int mon_init_func(QemuOpts *opts, void *opaque) > +{ > + CharDriverState *chr; > + const char *chardev; > + const char *mode; > + int flags; > + > + qemu_opts_print(opts, NULL); > Right here. > + mode = qemu_opt_get(opts, "mode"); > + if (mode == NULL) { > + mode = "readline"; > + } > + if (strcmp(mode, "readline") == 0) { > + flags = MONITOR_USE_READLINE; > + } else if (strcmp(mode, "control") == 0) { > + flags = MONITOR_USE_CONTROL; > + } else { > + fprintf(stderr, "unknown monitor mode \"%s\"\n", mode); > + exit(1); > + } > + Regards, Anthony Liguori