> From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Monday, September 15, 2014 1:36 PM > Subject: Re: [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev > properties > > 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<qemu:memory-region>) > > virtio-pci[0] (child<qemu:memory-region>) > > msix-pba[0] (child<qemu:memory-region>) > > msix-table[0] (child<qemu:memory-region>) > > virtio-net-pci-msix[0] (child<qemu:memory-region>) > > virtio-bus (child<virtio-pci-bus>) > > bus master[0] (child<qemu:memory-region>) > > 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
Sorry, I don't understand your meaning. :( I used 'qom-list' interface is HMP interface which introduced by Andreas, haven't applied in qemu master. http://thread.gmane.org/gmane.comp.emulators.qemu/271513 Those properties of virtio-net-pci are the same with e1000. Please see details as below: #./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 \ -netdev type=user,id=net1 -device e1000,netdev=net1,bootindex=2,id=nic QEMU 2.1.50 monitor - type 'help' for more information (qemu) qom-list nic1 virtio-net-pci.rom[0] (child<qemu:memory-region>) virtio-pci[0] (child<qemu:memory-region>) msix-pba[0] (child<qemu:memory-region>) msix-table[0] (child<qemu:memory-region>) virtio-net-pci-msix[0] (child<qemu:memory-region>) virtio-bus (child<virtio-pci-bus>) bus master[0] (child<qemu:memory-region>) bootindex (int) tx (str) x-txburst (int32) x-txtimer (uint32) netdev (str) vlan (int32) mac (str) virtio-backend (child<virtio-net-device>) parent_bus (link<bus>) command_serr_enable (bool) multifunction (bool) rombar (uint32) romfile (str) addr (int32) legacy-addr (str) event_idx (bool) indirect_desc (bool) mq (bool) ctrl_guest_offloads (bool) ctrl_mac_addr (bool) ctrl_rx_extra (bool) ctrl_vlan (bool) ctrl_rx (bool) ctrl_vq (bool) status (bool) mrg_rxbuf (bool) host_ufo (bool) host_ecn (bool) host_tso6 (bool) host_tso4 (bool) guest_announce (bool) guest_ufo (bool) guest_ecn (bool) guest_tso6 (bool) guest_tso4 (bool) gso (bool) guest_csum (bool) csum (bool) any_layout (bool) vectors (uint32) ioeventfd (bool) hotplugged (bool) hotpluggable (bool) realized (bool) type (string) (qemu) qom-get nic1 mac "52:54:00:12:34:56" (qemu) qom-get nic1 bootindex 3 (0x3) (qemu) qom-list /machine/peripheral/nic1/virtio-backend bootindex (int) parent_bus (link<bus>) tx (str) x-txburst (int32) x-txtimer (uint32) netdev (str) vlan (int32) legacy-vlan (str) mac (str) hotplugged (bool) hotpluggable (bool) realized (bool) type (string) (qemu) qom-list nic e1000.rom[0] (child<qemu:memory-region>) e1000-io[0] (child<qemu:memory-region>) e1000-mmio[0] (child<qemu:memory-region>) bus master[0] (child<qemu:memory-region>) bootindex (int) parent_bus (link<bus>) command_serr_enable (bool) multifunction (bool) rombar (uint32) romfile (str) addr (int32) legacy-addr (str) mitigation (bool) autonegotiation (bool) netdev (str) vlan (int32) legacy-vlan (str) mac (str) hotplugged (bool) hotpluggable (bool) realized (bool) type (string) (qemu) info network nic1: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56 \ net0: index=0,type=user,net=10.0.2.0,restrict=off nic: index=0,type=nic,model=e1000,macaddr=52:54:00:12:34:57 \ net1: index=0,type=user,net=10.0.2.0,restrict=off (qemu) Best regards, -Gonglei