All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Heinz Graalfs <graalfs@linux.vnet.ibm.com>,
	mst@redhat.com, virtualization@lists.linux-foundation.org
Cc: borntraeger@de.ibm.com
Subject: Re: [PATCH V2 RFC 1/9] virtio_ring: change host notification API
Date: Mon, 28 Oct 2013 09:57:47 +1030	[thread overview]
Message-ID: <871u36i9ak.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1382628200-42956-2-git-send-email-graalfs@linux.vnet.ibm.com>

Heinz Graalfs <graalfs@linux.vnet.ibm.com> writes:
> Currently a host kick error is silently ignored and not reflected in
> the virtqueue of a particular virtio device.
>
> Changing the notify API for guest->host notification seems to be one
> prerequisite in order to be able to handle such errors in the context
> where the kick is triggered.
>
> This patch changes the notify API. The notify function must return a
> negative int return value in case the host notification failed.

I think we need a bool here:

> -	kvm_hypercall1(KVM_S390_VIRTIO_NOTIFY, config->address);
> +	rc = kvm_hypercall1(KVM_S390_VIRTIO_NOTIFY, config->address);
> +	if (rc < 0)
> +		return rc;
> +	return 0;
>  }

I have no idea what this hypercall returns on failure...

> -static void virtio_ccw_kvm_notify(struct virtqueue *vq)
> +static int virtio_ccw_kvm_notify(struct virtqueue *vq)
>  {
>  	struct virtio_ccw_vq_info *info = vq->priv;
>  	struct virtio_ccw_device *vcdev;
> @@ -384,6 +384,9 @@ static void virtio_ccw_kvm_notify(struct virtqueue *vq)
>  	vcdev = to_vc_device(info->vq->vdev);
>  	ccw_device_get_schid(vcdev->cdev, &schid);
>  	info->cookie = do_kvm_notify(schid, vq->index, info->cookie);
> +	if (info->cookie < 0)
> +		return info->cookie;
> +	return 0;

Nor this one.

Since the caller can't really use the return value, I think a bool is
correct.

Cheers,
Rusty.

  reply	other threads:[~2013-10-27 23:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 15:23 [PATCH V2 RFC 0/9] virtio: fix hang(loop) after hot-unplug vlan Heinz Graalfs
2013-10-24 15:23 ` [PATCH V2 RFC 1/9] virtio_ring: change host notification API Heinz Graalfs
2013-10-27 23:27   ` Rusty Russell [this message]
2013-10-24 15:23 ` [PATCH V2 RFC 2/9] virtio_ring: let virtqueue_{kick()/notify()} return a bool Heinz Graalfs
2013-10-24 15:23 ` [PATCH V2 RFC 3/9] virtio_net: verify if virtqueue_kick() succeeded Heinz Graalfs
2013-10-24 15:23 ` [PATCH V2 RFC 4/9] virtio_test: " Heinz Graalfs
2013-10-24 15:23 ` [PATCH V2 RFC 5/9] virtio_ring: add new function virtqueue_is_broken() Heinz Graalfs
2013-10-24 15:23 ` [PATCH V2 RFC 6/9] virtio_blk: verify if queue is broken after virtqueue_get_buf() Heinz Graalfs
2013-10-24 15:23 ` [PATCH V2 RFC 7/9] virtio_console: " Heinz Graalfs
2013-10-24 15:23 ` [PATCH V2 RFC 8/9] virtio_net: " Heinz Graalfs
2013-10-24 15:23 ` [PATCH V2 RFC 9/9] virtio_scsi: " Heinz Graalfs
2013-10-27 23:29   ` Rusty Russell
2013-10-29  1:04   ` Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2013-10-28 10:30 [PATCH V2 RFC 1/9] virtio_ring: change host notification API Heinz Graalfs
2013-10-28 10:30 ` Heinz Graalfs
2013-10-28 23:13 ` Rusty Russell

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=871u36i9ak.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=borntraeger@de.ibm.com \
    --cc=graalfs@linux.vnet.ibm.com \
    --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 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.