Received: from eggs.gnu.org ([2001:4830:134:3::10]:45865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcE8w-0002qg-7M for qemu-devel@nongnu.org; Fri, 01 Nov 2013 08:48:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcE8o-0000Ev-Vx for qemu-devel@nongnu.org; Fri, 01 Nov 2013 08:48:02 -0400 References: <1381460995-11855-1-git-send-email-aik@ozlabs.ru> <67B9EE56-26C9-4AE0-8C9E-B08628A8C531@suse.de> <527387F4.4090407@ozlabs.ru> Mime-Version: 1.0 (1.0) In-Reply-To: <527387F4.4090407@ozlabs.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <000EEE77-BC62-49E2-8F09-63B6DE9B8943@suse.de> From: Alexander Graf Date: Fri, 1 Nov 2013 05:47:45 -0700 Subject: Re: [Qemu-devel] [RFC PATCH] spapr: add ibmveth to the supported network adapters list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: "open@suse.de" , "list@suse.de:PReP" , QEMU Developers , Anthony Liguori Am 01.11.2013 um 03:52 schrieb Alexey Kardashevskiy : > On 10/28/2013 05:03 AM, Alexander Graf wrote: >>=20 >> On 10.10.2013, at 20:09, Alexey Kardashevskiy wrote: >>=20 >>> The problem is that "-net nic,model=3D?" does not print "ibmveth" in >>> the list while it is actually supported. >>>=20 >>> Most of the QEMU emulated network devices are PCI but "ibmveth" >>> (a.k.a. spapr-vlan) is not. However with "-net nic,model=3D?", QEMU prin= ts >>> only PCI devices in the list, even if it does not say that the list is >>> all about PCI devices. >>>=20 >>> This adds "?"/"help" handling in spapr.c and adds "ibmveth" in the begin= ning >>> of the list. >>>=20 >>> Signed-off-by: Alexey Kardashevskiy >>> --- >>>=20 >>> This is an RFC patch. >>>=20 >>> The other solutions could be: >>> 1. add "ibmveth" into pci_nic_models[] in hw/pci/pci.c but this would no= t >>> be correct as "ibmveth" is not PCI and it must appear only on pseries ma= chine. >>>=20 >>> 2. implemement short version of qdev_print_category_devices() and call i= t >>> with DEVICE_CATEGORY_NETWORK but that would print more devices than >>> pci_nic_init_nofail() can handle (vmxnet3, usb-bt-dongle). >>>=20 >>> 3. fix qemu_check_nic_model() to specifically say that this is a list of= >>> PCI devices and there might be some other devices which "-net nic,model+= " >>> supports but there are not PCI but that could break compatibility (some >>> management software may rely on this exact string). >>>=20 >>> 4. Reject the patch and just say that people must stop using "-net". Ok f= or me :) >>>=20 >>> Since "-net" is kind of obsolete interface and does not seem to be exten= ded ever, >>> the proposed patch does not look too ugly, does not it? >>> --- >>> hw/ppc/spapr.c | 15 +++++++++++++++ >>> 1 file changed, 15 insertions(+) >>>=20 >>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c >>> index c0613e4..45ed3da 100644 >>> --- a/hw/ppc/spapr.c >>> +++ b/hw/ppc/spapr.c >>> @@ -1276,6 +1276,21 @@ static void ppc_spapr_init(QEMUMachineInitArgs *a= rgs) >>>=20 >>> if (strcmp(nd->model, "ibmveth") =3D=3D 0) { >>> spapr_vlan_create(spapr->vio_bus, nd); >>> + } else if (is_help_option(nd->model)) { >>> + static const char * const nic_models[] =3D { >>> + "ibmveth", >>> + "ne2k_pci", >>> + "i82551", >>> + "i82557b", >>> + "i82559er", >>> + "rtl8139", >>> + "e1000", >>> + "pcnet", >>> + "virtio", >>> + NULL >>> + }; >>=20 >> I don't like the idea of duplicating that list. >=20 > Neither do I :) But the list itself already looks quite ugly. >=20 >> Basically the list of supported -net models is incorrect today even on >> x86 where you can say -net nic,model=3Dne2k_isa. It really is only a list= >> of PCI devices. >=20 >=20 >> I can think of a number of convoluted ways to fix this up, but I think >> that ignoring fully accuracy of the output of -net model=3D? is the most >> straight forward thing to do. >=20 > Does any of your "convoluted" ways include adding a new category > (DEVICE_CATEGORY_NETWORK_LEGACY?) into enum DeviceCategory, adding devices= > from the list above and fixing qemu_show_nic_models() to show what is in > the category? Most of them consist of a full redesign of the way -net works :). >=20 > Or "-net" interface is "deprecated" and we do not want even touch it? I don't think we should deprecate it. It's easier to use than anything else.= Ahci adoption heavily suffered from not being enabled in -drive - I don't w= ant that again here. Alex >=20 >=20 >=20 > --=20 > Alexey