From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTOun-0002t2-9x for qemu-devel@nongnu.org; Mon, 15 Sep 2014 01:33:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTOud-0006Po-NM for qemu-devel@nongnu.org; Mon, 15 Sep 2014 01:33:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTOud-0006Pc-Fu for qemu-devel@nongnu.org; Mon, 15 Sep 2014 01:33:19 -0400 Date: Mon, 15 Sep 2014 08:36:27 +0300 From: "Michael S. Tsirkin" Message-ID: <20140915053627.GA6480@redhat.com> References: <1410244510-9292-1-git-send-email-arei.gonglei@huawei.com> <1410244510-9292-2-git-send-email-arei.gonglei@huawei.com> <20140914181301.GB1226@redhat.com> <33183CC9F5247A488A2544077AF1902086DD32CD@SZXEMA503-MBS.china.huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33183CC9F5247A488A2544077AF1902086DD32CD@SZXEMA503-MBS.china.huawei.com> Subject: Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" Cc: "agraf@suse.de" , "peter.crosthwaite@xilinx.com" , "Huangweidong (C)" , Luonengjun , "Huangpeng (Peter)" , "qemu-devel@nongnu.org" , "borntraeger@de.ibm.com" , "stefanha@redhat.com" , "cornelia.huck@de.ibm.com" , "pbonzini@redhat.com" , "rth@twiddle.net" On Mon, Sep 15, 2014 at 01:03:24AM +0000, Gonglei (Arei) wrote: > > > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c > > > index ddb5da1..6722156 100644 > > > --- a/hw/virtio/virtio-pci.c > > > +++ b/hw/virtio/virtio-pci.c > > > @@ -1414,8 +1414,6 @@ static Property virtio_net_properties[] = { > > > VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false), > > > DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3), > > > DEFINE_VIRTIO_NET_FEATURES(VirtIOPCIProxy, host_features), > > > - DEFINE_NIC_PROPERTIES(VirtIONetPCI, vdev.nic_conf), > > > - DEFINE_VIRTIO_NET_PROPERTIES(VirtIONetPCI, vdev.net_conf), > > > DEFINE_PROP_END_OF_LIST(), > > > }; > > > > > > @@ -1456,6 +1454,7 @@ static void virtio_net_pci_instance_init(Object > > *obj) > > > VirtIONetPCI *dev = VIRTIO_NET_PCI(obj); > > > object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_NET); > > > object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), > > NULL); > > > + qdev_alias_all_properties(DEVICE(&dev->vdev), obj); > > > } > > > > > > static const TypeInfo virtio_net_pci_info = { > > > > Does -device virtio-net-pci,? still list e.g. the mac property with this > > patch? > > > Yes. Please see the properties of virtio-net-pci with this patch: > > #./qemu-system-x86_64 -enable-kvm -m 4096 -smp 4 -name redhat6.2 -drive file=/home/redhat6.2, \ > if=none,id=drive-ide0-0-0 -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ > -drive file=/mnt/sdb/gonglei/iso/rhel-server-7.0-x86_64-dvd.iso,if=none,id=drive-ide0-0-1 \ > -device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,bootindex=4 -vnc 0.0.0.0:10 \ > -netdev type=user,id=net0 -device virtio-net-pci,netdev=net0,bootindex=3,id=nic1 -monitor stdio > QEMU 2.1.50 monitor - type 'help' for more information > (qemu) qom-list nic1 > virtio-net-pci.rom[0] (child) > virtio-pci[0] (child) > msix-pba[0] (child) > msix-table[0] (child) > virtio-net-pci-msix[0] (child) > virtio-bus (child) > bus master[0] (child) > bootindex (int) > tx (str) > x-txburst (int32) > x-txtimer (uint32) > netdev (str) > vlan (int32) > mac (str) This is a regression though. Before: -virtio-net-pci.netdev=netdev -virtio-net-pci.vlan=vlan -virtio-net-pci.mac=macaddr After +virtio-net-pci.netdev=str +virtio-net-pci.vlan=int32 +virtio-net-pci.mac=str Compare to e1000: e1000.netdev=netdev e1000.vlan=vlan e1000.mac=macaddr -- MST