Heinz Graalfs <[email protected]> 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.
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reply via email to