From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MxnxH-0003GH-Tn for qemu-devel@nongnu.org; Tue, 13 Oct 2009 16:26:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MxnxE-0003Cw-4f for qemu-devel@nongnu.org; Tue, 13 Oct 2009 16:26:47 -0400 Received: from [199.232.76.173] (port=34432 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MxnxD-0003Ci-Nj for qemu-devel@nongnu.org; Tue, 13 Oct 2009 16:26:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17333) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MxnxD-0000Ym-4D for qemu-devel@nongnu.org; Tue, 13 Oct 2009 16:26:43 -0400 Subject: Re: [Qemu-devel] Re: [PATCH v2 9/9] Add -kvm option References: <1254953315-5761-2-git-send-email-glommer@redhat.com> <1254953315-5761-3-git-send-email-glommer@redhat.com> <1254953315-5761-4-git-send-email-glommer@redhat.com> <1254953315-5761-5-git-send-email-glommer@redhat.com> <1254953315-5761-6-git-send-email-glommer@redhat.com> <1254953315-5761-7-git-send-email-glommer@redhat.com> <1254953315-5761-8-git-send-email-glommer@redhat.com> <1254953315-5761-9-git-send-email-glommer@redhat.com> <1254953315-5761-10-git-send-email-glommer@redhat.com> <4ACD1D92.8080607@us.ibm.com> <20091007231405.GQ8092@mothafucka.localdomain> <4ACD2414.9000401@codemonkey.ws> <4AD319F6.70506@redhat.com> <4AD33774.1030001@us.ibm.com> <4AD34C75.8090803@redhat.com> <4AD359E6.50108@us.ibm.com> <4AD434BB.1080102@redhat.com> <4AD49DDA.8060101@us.ibm.com> From: Markus Armbruster Date: Tue, 13 Oct 2009 21:26:09 +0200 In-Reply-To: <4AD49DDA.8060101@us.ibm.com> (Anthony Liguori's message of "Tue\, 13 Oct 2009 10\:33\:46 -0500") Message-ID: <87eip79ju6.fsf@pike.pond.sub.org> 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: Anthony Liguori Cc: Glauber Costa , Gerd Hoffmann , qemu-devel@nongnu.org Anthony Liguori writes: > Gerd Hoffmann wrote: >>> qemu should not have the concept of a default nic. >> >> Well, right now it has (likewise for serial, vga, ...). And it >> causes problems with the qdev way of managing devices, so we have to >> find a way to deal with it. > > There are a few separate issues that should be treated differently. > For vga, it should just be a default device in the machine > description. A special id should be used for the default vga card and > -vga std should have the effect of modifying the a vga device of that > id to be std. IOW, it should be -device-remove id=default_vga -device > stdvga,id=default_vga. > > For serial, we default to having one port. Again, it should have a > well known id and -serial none should be -device-remove > id=default_serial. For nics, it's a bit complicated by the fact that > -net nic doesn't require a model and by default, each machine may have > a default model. We will likely have to preserve this as a config > option which is unfortunate. > > That said, without -net none, we get a single network device. Again, > it should have a well known id and -net none should remove that > device. >> Right now the default devices are tied to a command line switch, >> i.e. in case there isn't a -serial switch specified qemu will add a >> default serial device, even in case one was added via -device >> isa-serial. > > I don't think -device has to have the same property of -serial. That > is, -device isa-serial doesn't need to replace the default serial > device which is connected to a vc. Rather, we should allow a user to > modify the char device associated with that default serial device via > -set. > > We shouldn't think of it like we add a default -serial device if no > -serial switch was used. Instead, there has always been a default > isa-serial device. You can modify it via -set or you can remove it. > -serial none removes it. For the first occurrence of -serial, it > behaves like -set. Future occurrences of -set behave like -device > isa-serial. The problem with that approach is in a part of Gerd's reply you snipped: >> I still don't like the concept though. Configuring a second nic would >> be different from configuring the first nic, because for the first >> you'll modify the default device, the second is added instead. >> libvirt folks will hate us for doing this. Having to use -set for configuring the first device of a kind, and -device for the second is a bad user interface. It's made worse by the fact that you need -set only for some kinds of devices, namely the kinds where QEMU provides a default. I agree with Gerd that we should distinguish between required and optional devices. It's fine to require -set for modifying required devices like RTC. But when I configure my first and second NIC, I don't really want to know that I'm actually modifying the first NIC and adding the second NIC. What about this: give the user a default FOO (for FOO in serial, NIC, ...) if he didn't configure one (no matter how, be it -device or some legacy option to ask for FOOs). This way, you ask for your first FOO exactly like any other: -device. Extra points for providing a way to say "do not give me any optional devices I didn't explicitely ask for".