From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuggA-0001Wk-Ov for qemu-devel@nongnu.org; Mon, 14 Jan 2013 04:50:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tugfz-0003GQ-Uc for qemu-devel@nongnu.org; Mon, 14 Jan 2013 04:50:06 -0500 Received: from mx3-phx2.redhat.com ([209.132.183.24]:51097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tugfz-0003F0-NH for qemu-devel@nongnu.org; Mon, 14 Jan 2013 04:49:55 -0500 Date: Mon, 14 Jan 2013 04:49:52 -0500 (EST) From: Paolo Bonzini Message-ID: <351437397.5571854.1358156992701.JavaMail.root@redhat.com> In-Reply-To: <20130114092630.GF11260@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/27] qemu-option: move standard option definitions out of qemu-config.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org > On Sat, Jan 12, 2013 at 06:35:12PM +0100, Paolo Bonzini wrote: > > @@ -2566,6 +2755,22 @@ int main(int argc, char **argv, char **envp) > > > > module_call_init(MODULE_INIT_QOM); > > > > + qemu_add_opts(&qemu_drive_opts); > > + qemu_add_opts(&qemu_chardev_opts); > > + qemu_add_opts(&qemu_device_opts); > > + qemu_add_opts(&qemu_netdev_opts); > > + qemu_add_opts(&qemu_net_opts); > > + qemu_add_opts(&qemu_rtc_opts); > > + qemu_add_opts(&qemu_global_opts); > > + qemu_add_opts(&qemu_mon_opts); > > + qemu_add_opts(&qemu_trace_opts); > > + qemu_add_opts(&qemu_option_rom_opts); > > + qemu_add_opts(&qemu_machine_opts); > > + qemu_add_opts(&qemu_boot_opts); > > + qemu_add_opts(&qemu_sandbox_opts); > > + qemu_add_opts(&qemu_add_fd_opts); > > + qemu_add_opts(&qemu_object_opts); > > + > > Is there a reason to register in main() instead of using module init > functions? IMO it's preferrable to keep options modular instead of > making them global and registering in main(). I wasn't really sure where to put these. In some cases, such as drive_opts or trace_opts, those files are linked to tools that have nothing to do QemuOpts. In others, vl.c is really the consumer. The choice is between module_init in vl.c or qemu_add_opts as above. Paolo