From: Christian Borntraeger <borntraeger@de.ibm.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
Anthony Liguori <anthony@codemonkey.ws>,
kvm@vger.kernel.org, avi@redhat.com,
Carsten Otte <cotte@de.ibm.com>
Subject: Re: [PATCHv5 1/3] virtio: find_vqs/del_vqs virtio operations
Date: Thu, 14 May 2009 08:35:24 +0200 [thread overview]
Message-ID: <200905140835.24627.borntraeger@de.ibm.com> (raw)
In-Reply-To: <20090513190858.GA3990@redhat.com>
Am Wednesday 13 May 2009 21:08:58 schrieb Michael S. Tsirkin:
> This replaces find_vq/del_vq with find_vqs/del_vqs virtio operations,
> and updates all drivers. This is needed for MSI support, because MSI
> needs to know the total number of vectors upfront.
[...]
> --- a/drivers/s390/kvm/kvm_virtio.c
> +++ b/drivers/s390/kvm/kvm_virtio.c
> @@ -227,6 +227,38 @@ static void kvm_del_vq(struct virtqueue *vq)
> KVM_S390_VIRTIO_RING_ALIGN));
> }
>
> +static void vp_del_vqs(struct virtio_device *vdev)
s/vp_del_vqs/kvm_del_vqs/ :
drivers/s390/kvm/kvm_virtio.c: In function 'kvm_find_vqs':
drivers/s390/kvm/kvm_virtio.c:258: error: implicit declaration of function 'kvm_del_vqs'
drivers/s390/kvm/kvm_virtio.c: At top level:
drivers/s390/kvm/kvm_virtio.c:274: error: 'kvm_del_vqs' undeclared here (not in a function)
make[2]: *** [drivers/s390/kvm/kvm_virtio.o] Error 1
> +{
> + struct virtqueue *vq, *n;
> +
> + list_for_each_entry_safe(vq, n, &vdev->vqs, list)
> + kvm_del_vq(vq);
> +}
> +
> +static int kvm_find_vqs(struct virtio_device *vdev, unsigned nvqs,
> + struct virtqueue *vqs[],
> + vq_callback_t *callbacks[],
> + const char *names[])
> +{
> + struct kvm_device *kdev = to_kvmdev(vdev);
> + int i;
> +
> + /* We must have this many virtqueues. */
> + if (nvqs > kdev->desc->num_vq)
> + return -ENOENT;
> +
> + for (i = 0; i < nvqs; ++i) {
> + vqs[i] = kvm_find_vq(vdev, i, callbacks[i], names[i]);
> + if (IS_ERR(vqs[i]))
> + goto error;
> + }
> + return 0;
> +
> +error:
> + kvm_del_vqs(vdev);
> + return PTR_ERR(vqs[i]);
> +}
> +
> /*
> * The config ops structure as defined by virtio config
> */
> @@ -238,8 +270,8 @@ static struct virtio_config_ops kvm_vq_configspace_ops = {
> .get_status = kvm_get_status,
> .set_status = kvm_set_status,
> .reset = kvm_reset,
> - .find_vq = kvm_find_vq,
> - .del_vq = kvm_del_vq,
> + .find_vqs = kvm_find_vqs,
> + .del_vqs = kvm_del_vqs,
> };
>
> /*
> --- a/include/linux/virtio_config.h
> +++ b/include/linux/virtio_config.h
[...]
needs an
#ifdef __KERNEL__
+#include <linux/err.h>
#include <linux/virtio.h>
[...]
> + int err = vdev->config->find_vqs(vdev, 1, &vq, callbacks, names);
> + if (err < 0)
> + return ERR_PTR(err);
Otherwise ERR_PTR does not compile.
next prev parent reply other threads:[~2009-05-14 6:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1242241196.git.mst@redhat.com>
2009-05-13 19:08 ` [PATCHv5 1/3] virtio: find_vqs/del_vqs virtio operations Michael S. Tsirkin
2009-05-14 6:35 ` Christian Borntraeger [this message]
2009-05-13 19:09 ` [PATCHv5 2/3] virtio_pci: split up vp_interrupt Michael S. Tsirkin
2009-05-13 19:11 ` [PATCHv5 3/3] virtio_pci: optional MSI-X support Michael S. Tsirkin
2009-05-14 2:16 ` 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=200905140835.24627.borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=cotte@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox