From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: "agraf@suse.de" <agraf@suse.de>,
"peter.crosthwaite@xilinx.com" <peter.crosthwaite@xilinx.com>,
"Huangweidong (C)" <weidong.huang@huawei.com>,
Luonengjun <luonengjun@huawei.com>,
"Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"borntraeger@de.ibm.com" <borntraeger@de.ibm.com>,
"stefanha@redhat.com" <stefanha@redhat.com>,
"cornelia.huck@de.ibm.com" <cornelia.huck@de.ibm.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"afaerber@suse.de" <afaerber@suse.de>,
"rth@twiddle.net" <rth@twiddle.net>
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 [thread overview]
Message-ID: <20140915083723.GD6480@redhat.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF1902086DD4793@SZXEMA503-MBS.china.huawei.com>
On Mon, Sep 15, 2014 at 07:12:59AM +0000, Gonglei (Arei) wrote:
> > From: Michael S. Tsirkin [mailto:mst@redhat.com]
> > 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:mst@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 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.
next prev parent reply other threads:[~2014-09-15 8:36 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 6:35 [Qemu-devel] [PATCH v2 0/9] virtio: fix virtio child recount in transports arei.gonglei
2014-09-09 6:35 ` [Qemu-devel] [PATCH v2 1/9] virtio-net: use aliases instead of duplicate qdev properties arei.gonglei
2014-09-14 18:13 ` Michael S. Tsirkin
2014-09-15 1:03 ` Gonglei (Arei)
2014-09-15 5:36 ` Michael S. Tsirkin
2014-09-15 5:49 ` Gonglei (Arei)
2014-09-15 6:41 ` Michael S. Tsirkin
2014-09-15 7:12 ` Gonglei (Arei)
2014-09-15 8:37 ` Michael S. Tsirkin [this message]
2014-09-15 9:06 ` Gonglei (Arei)
2014-09-15 9:23 ` Gonglei (Arei)
2014-09-15 9:29 ` Gonglei (Arei)
2014-09-15 9:59 ` Michael S. Tsirkin
2014-09-15 14:11 ` Gonglei (Arei)
2014-09-15 9:58 ` Michael S. Tsirkin
2014-09-09 6:35 ` [Qemu-devel] [PATCH v2 2/9] virtio: fix virtio-net child refcount in transports arei.gonglei
2014-09-09 6:35 ` [Qemu-devel] [PATCH v2 3/9] virtio/vhost scsi: use aliases instead of duplicate qdev properties arei.gonglei
2014-09-09 6:35 ` [Qemu-devel] [PATCH v2 4/9] virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports arei.gonglei
2014-09-09 6:35 ` [Qemu-devel] [PATCH v2 5/9] virtio-serial: use aliases instead of duplicate qdev properties arei.gonglei
2014-09-09 6:35 ` [Qemu-devel] [PATCH v2 6/9] virtio-serial: fix virtio-serial child refcount in transports arei.gonglei
2014-09-09 6:35 ` [Qemu-devel] [PATCH v2 7/9] virtio-rng: use aliases instead of duplicate qdev properties arei.gonglei
2014-09-09 6:35 ` [Qemu-devel] [PATCH v2 8/9] virtio-rng: fix virtio-rng child refcount in transports arei.gonglei
2014-09-09 6:35 ` [Qemu-devel] [PATCH v2 9/9] virtio-balloon: fix virtio-balloon " arei.gonglei
2014-09-12 11:55 ` [Qemu-devel] [PATCH v2 0/9] virtio: fix virtio child recount " Gonglei (Arei)
2014-09-19 9:52 ` Gonglei (Arei)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140915083723.GD6480@redhat.com \
--to=mst@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=arei.gonglei@huawei.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=luonengjun@huawei.com \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.huangpeng@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@redhat.com \
--cc=weidong.huang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).