From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PULL 12/22] vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE
Date: Thu, 8 Oct 2015 13:24:25 +0800 [thread overview]
Message-ID: <20151008052425.GA3115@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <20151003193154-mutt-send-email-mst@redhat.com>
On Sat, Oct 03, 2015 at 07:33:16PM +0300, Michael S. Tsirkin wrote:
> On Fri, Oct 02, 2015 at 06:18:51PM +0200, Paolo Bonzini wrote:
> >
> >
> > On 24/09/2015 15:20, Michael S. Tsirkin wrote:
> > > From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> > >
> > > Quote from Michael:
> > >
> > > We really should rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE.
> >
> > Where is the corresponding Linux patch for this?
> >
> > I would like to fetch the updated headers for KVM, and this is breaking
> > it. In fact, a patch that just renames the #define (without providing
> > the old name for backwards compatibility) would be NACKed in upstream Linux.
> >
> > Paolo
>
> Right. And it turns out this whole approach is wrong. I intend to
> revert this patch,
I was considering to put this patch as the last one in this set, so that
we could drop (or revert) it if it's turned out to be wrong (I had vague
feeling that it was wrong).
Luckily, this patch could be reverted successfully (I firstly thought
there might be conflicts). Besides that, we need one extra manual fix:
[yliu@yliu-dev ~/qemu]$ gg 'VHOST.*RESET_DEVICE'
hw/virtio/vhost-user.c:195: case VHOST_USER_RESET_DEVICE:
Michael, shall I send the revert request, or you will do that?
> and also drop the patch sending VHOST_RESET_OWNER on
> device stop.
Something wrong there?
--yliu
>
> > > Suggested-by: Michael S. Tsirkin <mst@redhat.com>
> > > Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> > > Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > > Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> > > Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
> > > ---
> > > linux-headers/linux/vhost.h | 2 +-
> > > hw/net/vhost_net.c | 2 +-
> > > hw/virtio/vhost-user.c | 6 +++---
> > > tests/vhost-user-test.c | 2 +-
> > > docs/specs/vhost-user.txt | 4 ++--
> > > 5 files changed, 8 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h
> > > index ead86db..14a0160 100644
> > > --- a/linux-headers/linux/vhost.h
> > > +++ b/linux-headers/linux/vhost.h
> > > @@ -78,7 +78,7 @@ struct vhost_memory {
> > > #define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01)
> > > /* Give up ownership, and reset the device to default values.
> > > * Allows subsequent call to VHOST_OWNER_SET to succeed. */
> > > -#define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02)
> > > +#define VHOST_RESET_DEVICE _IO(VHOST_VIRTIO, 0x02)
> > >
> > > /* Set up/modify memory layout */
> > > #define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory)
> > > diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> > > index 9d32d76..b7d29b7 100644
> > > --- a/hw/net/vhost_net.c
> > > +++ b/hw/net/vhost_net.c
> > > @@ -287,7 +287,7 @@ static void vhost_net_stop_one(struct vhost_net *net,
> > > } else if (net->nc->info->type == NET_CLIENT_OPTIONS_KIND_VHOST_USER) {
> > > for (file.index = 0; file.index < net->dev.nvqs; ++file.index) {
> > > const VhostOps *vhost_ops = net->dev.vhost_ops;
> > > - int r = vhost_ops->vhost_call(&net->dev, VHOST_RESET_OWNER,
> > > + int r = vhost_ops->vhost_call(&net->dev, VHOST_RESET_DEVICE,
> > > NULL);
> > > assert(r >= 0);
> > > }
> > > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> > > index 7fe35c6..9cb2f52 100644
> > > --- a/hw/virtio/vhost-user.c
> > > +++ b/hw/virtio/vhost-user.c
> > > @@ -32,7 +32,7 @@ typedef enum VhostUserRequest {
> > > VHOST_USER_GET_FEATURES = 1,
> > > VHOST_USER_SET_FEATURES = 2,
> > > VHOST_USER_SET_OWNER = 3,
> > > - VHOST_USER_RESET_OWNER = 4,
> > > + VHOST_USER_RESET_DEVICE = 4,
> > > VHOST_USER_SET_MEM_TABLE = 5,
> > > VHOST_USER_SET_LOG_BASE = 6,
> > > VHOST_USER_SET_LOG_FD = 7,
> > > @@ -98,7 +98,7 @@ static unsigned long int ioctl_to_vhost_user_request[VHOST_USER_MAX] = {
> > > VHOST_GET_FEATURES, /* VHOST_USER_GET_FEATURES */
> > > VHOST_SET_FEATURES, /* VHOST_USER_SET_FEATURES */
> > > VHOST_SET_OWNER, /* VHOST_USER_SET_OWNER */
> > > - VHOST_RESET_OWNER, /* VHOST_USER_RESET_OWNER */
> > > + VHOST_RESET_DEVICE, /* VHOST_USER_RESET_DEVICE */
> > > VHOST_SET_MEM_TABLE, /* VHOST_USER_SET_MEM_TABLE */
> > > VHOST_SET_LOG_BASE, /* VHOST_USER_SET_LOG_BASE */
> > > VHOST_SET_LOG_FD, /* VHOST_USER_SET_LOG_FD */
> > > @@ -222,7 +222,7 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
> > > break;
> > >
> > > case VHOST_USER_SET_OWNER:
> > > - case VHOST_USER_RESET_OWNER:
> > > + case VHOST_USER_RESET_DEVICE:
> > > break;
> > >
> > > case VHOST_USER_SET_MEM_TABLE:
> > > diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
> > > index 75fedf0..e301db7 100644
> > > --- a/tests/vhost-user-test.c
> > > +++ b/tests/vhost-user-test.c
> > > @@ -58,7 +58,7 @@ typedef enum VhostUserRequest {
> > > VHOST_USER_GET_FEATURES = 1,
> > > VHOST_USER_SET_FEATURES = 2,
> > > VHOST_USER_SET_OWNER = 3,
> > > - VHOST_USER_RESET_OWNER = 4,
> > > + VHOST_USER_RESET_DEVICE = 4,
> > > VHOST_USER_SET_MEM_TABLE = 5,
> > > VHOST_USER_SET_LOG_BASE = 6,
> > > VHOST_USER_SET_LOG_FD = 7,
> > > diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt
> > > index 70da3b1..ccbbcbb 100644
> > > --- a/docs/specs/vhost-user.txt
> > > +++ b/docs/specs/vhost-user.txt
> > > @@ -194,10 +194,10 @@ Message types
> > > as an owner of the session. This can be used on the Slave as a
> > > "session start" flag.
> > >
> > > - * VHOST_USER_RESET_OWNER
> > > + * VHOST_USER_RESET_DEVICE
> > >
> > > Id: 4
> > > - Equivalent ioctl: VHOST_RESET_OWNER
> > > + Equivalent ioctl: VHOST_RESET_DEVICE
> > > Master payload: N/A
> > >
> > > Issued when a new connection is about to be closed. The Master will no
> > >
next prev parent reply other threads:[~2015-10-08 5:20 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 13:20 [Qemu-devel] [PULL 00/22] virtio,pc features, fixes Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 01/22] virtio: right size for virtio_queue_get_avail_size Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 02/22] virtio-net: unbreak self announcement and guest offloads after migration Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 03/22] q35: Move options common to all classes to pc_q35_machine_options() Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 04/22] q35: Move options common to all classes to pc_i440fx_machine_options() Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 05/22] pc: Introduce pc-*-2.5 machine classes Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 06/22] virtio: ring sizes vs. reset Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 07/22] virtio-ccw: support ring size changes Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 08/22] virtio-ccw: feature bits > 31 handling Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 09/22] virtio-ccw: enable virtio-1 Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 10/22] vhost-user: use VHOST_USER_XXX macro for switch statement Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 11/22] vhost-user: add protocol feature negotiation Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 12/22] vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE Michael S. Tsirkin
2015-10-02 16:18 ` Paolo Bonzini
2015-10-03 16:33 ` Michael S. Tsirkin
2015-10-08 5:24 ` Yuanhan Liu [this message]
2015-11-05 11:42 ` Peter Maydell
2015-11-06 1:34 ` Yuanhan Liu
2015-11-06 10:01 ` Peter Maydell
2015-11-09 3:56 ` Yuanhan Liu
2015-09-24 13:20 ` [Qemu-devel] [PULL 13/22] vhost-user: add VHOST_USER_GET_QUEUE_NUM message Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 14/22] vhost: introduce vhost_backend_get_vq_index method Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 15/22] vhost-user: add multiple queue support Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 16/22] vhost-user: add a new message to disable/enable a specific virt queue Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 17/22] intel_iommu: Add support for translation for devices behind bridges Michael S. Tsirkin
2015-09-25 6:43 ` Michael S. Tsirkin
2015-09-25 7:33 ` Knut Omang
2015-09-24 13:20 ` [Qemu-devel] [PULL 18/22] MAINTAINERS: add more devices to the PC section Michael S. Tsirkin
2015-09-24 13:20 ` [Qemu-devel] [PULL 19/22] MAINTAINERS: add more devices to the PCI section Michael S. Tsirkin
2015-09-24 13:21 ` [Qemu-devel] [PULL 20/22] virtio: introduce virtqueue_unmap_sg() Michael S. Tsirkin
2015-09-24 18:58 ` Michael S. Tsirkin
2015-09-25 3:26 ` Jason Wang
2015-09-24 13:21 ` [Qemu-devel] [PULL 21/22] virtio: introduce virtqueue_discard() Michael S. Tsirkin
2015-09-24 13:21 ` [Qemu-devel] [PULL 22/22] virtio-net: correctly drop truncated packets Michael S. Tsirkin
2015-09-24 13:30 ` [Qemu-devel] [PULL 00/22] virtio,pc features, fixes Michael S. Tsirkin
2015-09-24 18:36 ` Peter Maydell
2015-09-24 18:57 ` Michael S. Tsirkin
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=20151008052425.GA3115@yliu-dev.sh.intel.com \
--to=yuanhan.liu@linux.intel.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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 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).