Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDb5t-00058B-Ew for qemu-devel@nongnu.org; Thu, 26 Nov 2009 04:56:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDb5o-00056Q-U0 for qemu-devel@nongnu.org; Thu, 26 Nov 2009 04:56:57 -0500 Received: from [199.232.76.173] (port=37552 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDb5o-00056N-H7 for qemu-devel@nongnu.org; Thu, 26 Nov 2009 04:56:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56712) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDb5o-0006iw-0Z for qemu-devel@nongnu.org; Thu, 26 Nov 2009 04:56:52 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH] debugcon: support for debugging consoles (e.g. Bochs port 0xe9) References: <1258752795-15434-1-git-send-email-hpa@linux.intel.com> <4B0A6973.4010303@redhat.com> <4B0AEC8A.1020905@zytor.com> <4B0C66B0.5090805@zytor.com> <4B0D2713.60001@redhat.com> <4B0D70DC.8020605@linux.intel.com> <4B0DADDE.1080703@redhat.com> <4B0DAF0D.4010105@linux.intel.com> <4B0DB041.4060209@linux.intel.com> <4B0DB58E.1020203@redhat.com> Date: Thu, 26 Nov 2009 10:56:47 +0100 In-Reply-To: <4B0DB58E.1020203@redhat.com> (Gerd Hoffmann's message of "Wed, 25 Nov 2009 23:54:06 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: "H. Peter Anvin" , qemu-devel@nongnu.org, "H. Peter Anvin" Gerd Hoffmann writes: > On 11/25/09 23:31, H. Peter Anvin wrote: >> On 11/25/2009 02:26 PM, H. Peter Anvin wrote: >>> >>> As such, I think there is still a place for the simple command line >>> options like "-hda", "-serial" and my proposed "-debugcon", in addition >>> to the full-featured connect-anything options and configuration files. >>> That's all. >>> >> >> I guess one question is if the simplified options could be better >> implemented via some kind of builtin macros or translation submodule >> rather than being treated as first-class options which they basically >> are now. Still, that's a future development task. > > Wouldn't be that hard I think. Something along the lines of > > case QEMU_OPTION_debugcon: > opts = qemu_chr_parse_compat("debugcon", optarg); > if (NULL == opts) { > fprintf(stderr, "already have a debugcon chardev\"); > exit(1); > } > opts = qemu_opts_create(&qemu_device_opts, "debugcon", 1); > if (NULL == opts) { > fprintf(stderr, "already have a debugcon device\"); > exit(1); > } > qemu_opt_set(opts, "driver", isa-debugcon); > qemu_opt_set(opts, "chardev", "debugcon"); > break; > > should do the trick. Depends on the chardev fix mentioned in this > thread too. Allows to define a single device with the default port > via shortcut. There's precedence for this method to implement convenience options; look for uses of qemu_opts_create() / qemu_opt_set(). Expanding the convenience option into longhand that way saves code and avoids subtle differences between the two. Just avoid NULL == opts kraxelism ;) [...]