qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Lidong Chen <jemmy858585@gmail.com>, berrange@redhat.com
Cc: quintela@redhat.com, qemu-devel@nongnu.org, adido@mellanox.com,
	licq@mellanox.com, Lidong Chen <lidongchen@tencent.com>
Subject: Re: [Qemu-devel] [PATCH 2/5] migration: add the interface to set get_return_path
Date: Wed, 11 Apr 2018 18:18:18 +0100	[thread overview]
Message-ID: <20180411171818.GJ2667@work-vm> (raw)
In-Reply-To: <1523089594-1422-3-git-send-email-lidongchen@tencent.com>

* Lidong Chen (jemmy858585@gmail.com) wrote:
> The default get_return_path function of iochannel does not work for
> RDMA live migration. So add the interface to set get_return_path.
> 
> Signed-off-by: Lidong Chen <lidongchen@tencent.com>

Lets see how Dan wants this done, he knows the channel/file stuff;
to me this feels like it should be adding a member to QIOChannelClass
that gets used by QEMUFile's get_return_path.

(Dan and see next patch)

Dave
> ---
>  migration/qemu-file-channel.c | 12 ++++++++----
>  migration/qemu-file.c         | 10 ++++++++--
>  migration/qemu-file.h         |  2 +-
>  3 files changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
> index e202d73..d4dd8c4 100644
> --- a/migration/qemu-file-channel.c
> +++ b/migration/qemu-file-channel.c
> @@ -156,7 +156,6 @@ static const QEMUFileOps channel_input_ops = {
>      .close = channel_close,
>      .shut_down = channel_shutdown,
>      .set_blocking = channel_set_blocking,
> -    .get_return_path = channel_get_input_return_path,
>  };
>  
>  
> @@ -165,18 +164,23 @@ static const QEMUFileOps channel_output_ops = {
>      .close = channel_close,
>      .shut_down = channel_shutdown,
>      .set_blocking = channel_set_blocking,
> -    .get_return_path = channel_get_output_return_path,
>  };
>  
>  
>  QEMUFile *qemu_fopen_channel_input(QIOChannel *ioc)
>  {
> +    QEMUFile *f;
>      object_ref(OBJECT(ioc));
> -    return qemu_fopen_ops(ioc, &channel_input_ops);
> +    f = qemu_fopen_ops(ioc, &channel_input_ops);
> +    qemu_file_set_return_path(f, channel_get_input_return_path);
> +    return f;
>  }
>  
>  QEMUFile *qemu_fopen_channel_output(QIOChannel *ioc)
>  {
> +    QEMUFile *f;
>      object_ref(OBJECT(ioc));
> -    return qemu_fopen_ops(ioc, &channel_output_ops);
> +    f = qemu_fopen_ops(ioc, &channel_output_ops);
> +    qemu_file_set_return_path(f, channel_get_output_return_path);
> +    return f;
>  }
> diff --git a/migration/qemu-file.c b/migration/qemu-file.c
> index bb63c77..8acb574 100644
> --- a/migration/qemu-file.c
> +++ b/migration/qemu-file.c
> @@ -36,6 +36,7 @@
>  struct QEMUFile {
>      const QEMUFileOps *ops;
>      const QEMUFileHooks *hooks;
> +    QEMURetPathFunc *get_return_path;
>      void *opaque;
>  
>      int64_t bytes_xfer;
> @@ -72,10 +73,15 @@ int qemu_file_shutdown(QEMUFile *f)
>   */
>  QEMUFile *qemu_file_get_return_path(QEMUFile *f)
>  {
> -    if (!f->ops->get_return_path) {
> +    if (!f->get_return_path) {
>          return NULL;
>      }
> -    return f->ops->get_return_path(f->opaque);
> +    return f->get_return_path(f->opaque);
> +}
> +
> +void qemu_file_set_return_path(QEMUFile *f, QEMURetPathFunc *get_return_path)
> +{
> +    f->get_return_path = get_return_path;
>  }
>  
>  bool qemu_file_mode_is_not_valid(const char *mode)
> diff --git a/migration/qemu-file.h b/migration/qemu-file.h
> index f4f356a..74210b7 100644
> --- a/migration/qemu-file.h
> +++ b/migration/qemu-file.h
> @@ -102,7 +102,6 @@ typedef struct QEMUFileOps {
>      QEMUFileCloseFunc *close;
>      QEMUFileSetBlocking *set_blocking;
>      QEMUFileWritevBufferFunc *writev_buffer;
> -    QEMURetPathFunc *get_return_path;
>      QEMUFileShutdownFunc *shut_down;
>  } QEMUFileOps;
>  
> @@ -114,6 +113,7 @@ typedef struct QEMUFileHooks {
>  } QEMUFileHooks;
>  
>  QEMUFile *qemu_fopen_ops(void *opaque, const QEMUFileOps *ops);
> +void qemu_file_set_return_path(QEMUFile *f, QEMURetPathFunc *get_return_path);
>  void qemu_file_set_hooks(QEMUFile *f, const QEMUFileHooks *hooks);
>  int qemu_get_fd(QEMUFile *f);
>  int qemu_fclose(QEMUFile *f);
> -- 
> 1.8.3.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2018-04-11 17:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07  8:26 [Qemu-devel] [PATCH 0/5] Enable postcopy RDMA live migration Lidong Chen
2018-04-07  8:26 ` [Qemu-devel] [PATCH 1/5] migration: create a dedicated connection for rdma return path Lidong Chen
2018-04-11 16:57   ` Dr. David Alan Gilbert
2018-04-07  8:26 ` [Qemu-devel] [PATCH 2/5] migration: add the interface to set get_return_path Lidong Chen
2018-04-11 17:18   ` Dr. David Alan Gilbert [this message]
2018-04-12  8:28     ` Daniel P. Berrangé
2018-04-12 10:08       ` 858585 jemmy
2018-04-07  8:26 ` [Qemu-devel] [PATCH 3/5] migration: implement the get_return_path for RDMA iochannel Lidong Chen
2018-04-07  8:26 ` [Qemu-devel] [PATCH 4/5] migration: fix qemu carsh when RDMA live migration Lidong Chen
2018-04-11 16:43   ` Dr. David Alan Gilbert
2018-04-12  9:40     ` 858585 jemmy
2018-04-12 18:58       ` Dr. David Alan Gilbert
2018-04-07  8:26 ` [Qemu-devel] [PATCH 5/5] migration: disable RDMA WRITR after postcopy started Lidong Chen
2018-04-11 15:56   ` Dr. David Alan Gilbert
2018-04-12  6:50     ` 858585 jemmy
2018-04-12 18:55       ` Dr. David Alan Gilbert
2018-04-09  1:05 ` [Qemu-devel] [PATCH 0/5] Enable postcopy RDMA live migration 858585 jemmy
2018-04-11 12:29 ` Dr. David Alan Gilbert
2018-04-12  3:57   ` 858585 jemmy
2018-04-24 13:36     ` Dr. David Alan Gilbert

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=20180411171818.GJ2667@work-vm \
    --to=dgilbert@redhat.com \
    --cc=adido@mellanox.com \
    --cc=berrange@redhat.com \
    --cc=jemmy858585@gmail.com \
    --cc=licq@mellanox.com \
    --cc=lidongchen@tencent.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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).