From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Alexander Graf <agraf@suse.de>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
aliguori@us.ibm.com, Jesse Larrew <jlarrew@linux.vnet.ibm.com>,
Jens Freimann <jfrei@linux.vnet.ibm.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/3] hw/virtio-net.c: set config size using host features
Date: Tue, 05 Mar 2013 18:03:49 +0100 [thread overview]
Message-ID: <51362575.2000908@de.ibm.com> (raw)
In-Reply-To: <513621F7.9030403@suse.de>
On 05/03/13 17:48, Alexander Graf wrote:
> On 02/06/2013 12:47 AM, Jesse Larrew wrote:
>> Currently, the config size for virtio devices is hard coded. When a new
>> feature is added that changes the config size, drivers that assume a static
>> config size will break. For purposes of backward compatibility, there needs
>> to be a way to inform drivers of the config size needed to accommodate the
>> set of features enabled.
>>
>> Signed-off-by: Jesse Larrew<jlarrew@linux.vnet.ibm.com>
>
> The following patch gets my s390 virtio guest working again, but I doubt it's the right fix.
>
> What is the expected dependency chain of feature calls?
>
>
> Alex
>
> diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
> index 089ed92..81be971 100644
> --- a/hw/s390x/s390-virtio-bus.c
> +++ b/hw/s390x/s390-virtio-bus.c
> @@ -154,7 +154,7 @@ static int s390_virtio_net_init(VirtIOS390Device *dev)
> VirtIODevice *vdev;
>
> vdev = virtio_net_init((DeviceState *)dev, &dev->nic, &dev->net,
> - dev->host_features);
> + dev->host_features | (1 << VIRTIO_NET_F_MAC));
> if (!vdev) {
> return -1;
> }
>
>
Actually this goes back to
commit 1e89ad5b00ba0426d4e949c9e6ce2926c15b81b7
Author: Anthony Liguori <aliguori@us.ibm.com>
Date: Tue Feb 5 17:47:15 2013 -0600
virtio-net: pass host features to virtio_net_init
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-s390 calls virtio_net_init before it actually queries the dev->features into
the host_features. virtio-ccw does the same, but it does not BUG. (Its still wrong IMHO)
Same for virtio-pci:
static int virtio_net_init_pci(PCIDevice *pci_dev)
{
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
VirtIODevice *vdev;
vdev = virtio_net_init(&pci_dev->qdev, &proxy->nic, &proxy->net,
proxy->host_features); <--- use host_feature
vdev->nvectors = proxy->nvectors;
virtio_init_pci(proxy, vdev); <------------- actually gets host_feature (!)
[..]
Good that my old rusty virtio-ccw transport has lots of BUG_ONS :-)
next prev parent reply other threads:[~2013-03-05 17:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1360108037-9211-1-git-send-email-jlarrew@linux.vnet.ibm.com>
[not found] ` <1360108037-9211-3-git-send-email-jlarrew@linux.vnet.ibm.com>
2013-03-05 16:41 ` [Qemu-devel] [PATCH 2/3] hw/virtio-net.c: set config size using host features Alexander Graf
2013-03-05 16:48 ` Alexander Graf
2013-03-05 17:03 ` Christian Borntraeger [this message]
2013-03-07 12:28 ` Christian Borntraeger
2013-03-07 16:03 ` Anthony Liguori
2013-03-07 16:27 ` Christian Borntraeger
2013-03-07 16:38 ` Andreas Färber
2013-03-07 16:44 ` Anthony Liguori
2013-03-07 16:49 ` Michael S. Tsirkin
2013-03-07 17:23 ` Anthony Liguori
2013-03-07 17:22 ` Andreas Färber
2013-03-07 17:41 ` Anthony Liguori
2013-03-07 16:42 ` Alexander Graf
2013-03-07 16:43 ` Anthony Liguori
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=51362575.2000908@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=jlarrew@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.