[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of dupli
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties |
Date: |
Mon, 15 Sep 2014 11:37:23 +0300 |
On Mon, Sep 15, 2014 at 07:12:59AM +0000, Gonglei (Arei) wrote:
> > From: Michael S. Tsirkin [mailto:address@hidden
> > Sent: Monday, September 15, 2014 2:41 PM
> > Subject: Re: [PATCH v2 1/9] virtio-net: use aliases instead of duplicate
> > qdev
> > properties
> >
> > On Mon, Sep 15, 2014 at 05:49:42AM +0000, Gonglei (Arei) wrote:
> > > > From: Michael S. Tsirkin [mailto:address@hidden
> > > > 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 applied your patch, and looked at the property types.
> >
> Could you tell me your method looked at properties type?
You can use an HMP command, or you can use
-device virtio-net-pci,?
changes must not modify output except for adding
new commands, or fixing bugs (with care).
> > They should be netdev/vlan/macaddr.
> > Your patch makes them str/int32/str
> >
> Does those changes have any side-effects? Thanks!
Yes. If the types are just "int" and "str" then you
have no way to know they should have a specific format,
such as a name of a netdev, valid mac address, or a vlan.
In fact, vlan=int is a bug since vlan names aren't numbers.
> The similar changes for virtio-blk had applied in qemu master.
>
> Best regards,
> -Gonglei
Which commit? Did output change? If yes it's a bug.
- [Qemu-devel] [PATCH v2 8/9] virtio-rng: fix virtio-rng child refcount in transports, (continued)
- [Qemu-devel] [PATCH v2 8/9] virtio-rng: fix virtio-rng child refcount in transports, arei.gonglei, 2014/09/09
- [Qemu-devel] [PATCH v2 2/9] virtio: fix virtio-net child refcount in transports, arei.gonglei, 2014/09/09
- [Qemu-devel] [PATCH v2 3/9] virtio/vhost scsi: use aliases instead of duplicate qdev properties, arei.gonglei, 2014/09/09
- [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, arei.gonglei, 2014/09/09
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Michael S. Tsirkin, 2014/09/14
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Gonglei (Arei), 2014/09/14
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Michael S. Tsirkin, 2014/09/15
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Gonglei (Arei), 2014/09/15
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Michael S. Tsirkin, 2014/09/15
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Gonglei (Arei), 2014/09/15
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties,
Michael S. Tsirkin <=
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Gonglei (Arei), 2014/09/15
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Gonglei (Arei), 2014/09/15
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Gonglei (Arei), 2014/09/15
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Michael S. Tsirkin, 2014/09/15
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Gonglei (Arei), 2014/09/15
- Re: [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties, Michael S. Tsirkin, 2014/09/15
[Qemu-devel] [PATCH v2 5/9] virtio-serial: use aliases instead of duplicate qdev properties, arei.gonglei, 2014/09/09
[Qemu-devel] [PATCH v2 6/9] virtio-serial: fix virtio-serial child refcount in transports, arei.gonglei, 2014/09/09
[Qemu-devel] [PATCH v2 7/9] virtio-rng: use aliases instead of duplicate qdev properties, arei.gonglei, 2014/09/09
Re: [Qemu-devel] [PATCH v2 0/9] virtio: fix virtio child recount in transports, Gonglei (Arei), 2014/09/12