qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org,  qemu-block@nongnu.org,
	 "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	 Stefan Hajnoczi <stefanha@redhat.com>,
	 Hailiang Zhang <zhang.zhanghailiang@huawei.com>,
	 Fam Zheng <fam@euphon.net>,
	Hailiang Zhang <zhanghailiang@xfusion.com>
Subject: Re: [PATCH v2 15/21] migration: remove the QEMUFileOps 'shut_down' callback
Date: Mon, 20 Jun 2022 17:36:29 +0200	[thread overview]
Message-ID: <87mte71h4y.fsf@secure.mitica> (raw)
In-Reply-To: <20220620110205.1357829-16-berrange@redhat.com> ("Daniel P. Berrangé"'s message of "Mon, 20 Jun 2022 12:01:59 +0100")

Daniel P. Berrangé <berrange@redhat.com> wrote:
> This directly implements the shutdown logic using QIOChannel APIs.
>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

> -{
> -    QIOChannel *ioc = QIO_CHANNEL(opaque);
> -
> -    if (qio_channel_has_feature(ioc,
> -                                QIO_CHANNEL_FEATURE_SHUTDOWN)) {
> -        QIOChannelShutdown mode;
> -        if (rd && wr) {
> -            mode = QIO_CHANNEL_SHUTDOWN_BOTH;
> -        } else if (rd) {
> -            mode = QIO_CHANNEL_SHUTDOWN_READ;
> -        } else {
> -            mode = QIO_CHANNEL_SHUTDOWN_WRITE;
> -        }
> -        if (qio_channel_shutdown(ioc, mode, errp) < 0) {
> -            return -EIO;
> -        }
> -    }
> -    return 0;
> -}

Here we don't return ENOSYS, we return 0 when the channel don't have the feature.

>      f->shutdown = true;
> -    if (!f->ops->shut_down) {
> +    if (!qio_channel_has_feature(f->ioc,
> +                                 QIO_CHANNEL_FEATURE_SHUTDOWN)) {
>          return -ENOSYS;
>      }

Here we return -ENOSYS.

It could only matter here:

./migration.c\02209:        ret = qemu_file_shutdown(ms->to_dst_file);
./migration.c\02218:        ret = qemu_file_shutdown(mis->from_src_file);

And both are for migrate_pause (postcopy recovery), that requires an
implementation that has a qiochannel, so my understanding is that it
don't matter at all.

Code is much better than what we had, anyways.

Later, Juan.



  reply	other threads:[~2022-06-20 15:37 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 11:01 [PATCH v2 00/21] migration: remove QEMUFileOps concept and assume use of QIOChannel Daniel P. Berrangé
2022-06-20 11:01 ` [PATCH v2 01/21] io: add a QIOChannelNull equivalent to /dev/null Daniel P. Berrangé
2022-06-20 12:44   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 02/21] migration: switch to use QIOChannelNull for dummy channel Daniel P. Berrangé
2022-06-20 12:45   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 03/21] migration: remove unreachble RDMA code in save_hook impl Daniel P. Berrangé
2022-06-20 15:11   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 04/21] migration: rename rate limiting fields in QEMUFile Daniel P. Berrangé
2022-06-20 15:11   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 05/21] migration: rename 'pos' field in QEMUFile to 'bytes_processed' Daniel P. Berrangé
2022-06-20 15:12   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 06/21] migration: rename qemu_ftell to qemu_file_total_transferred Daniel P. Berrangé
2022-06-20 15:13   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 07/21] migration: rename qemu_update_position to qemu_file_credit_transfer Daniel P. Berrangé
2022-06-20 15:14   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 08/21] migration: rename qemu_file_update_transfer to qemu_file_acct_rate_limit Daniel P. Berrangé
2022-06-20 14:36   ` Dr. David Alan Gilbert
2022-06-20 15:15   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 09/21] migration: introduce a QIOChannel impl for BlockDriverState VMState Daniel P. Berrangé
2022-06-20 15:17   ` Juan Quintela
2022-06-21 15:40   ` Juan Quintela
2022-06-21 15:42     ` Daniel P. Berrangé
2022-06-20 11:01 ` [PATCH v2 10/21] migration: convert savevm to use QIOChannelBlock for VMState Daniel P. Berrangé
2022-06-20 15:19   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 11/21] migration: stop passing 'opaque' parameter to QEMUFile hooks Daniel P. Berrangé
2022-06-20 15:20   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 12/21] migration: hardcode assumption that QEMUFile is backed with QIOChannel Daniel P. Berrangé
2022-06-20 15:21   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 13/21] migration: introduce new constructors for QEMUFile Daniel P. Berrangé
2022-06-20 15:27   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 14/21] migration: remove unused QEMUFileGetFD typedef / qemu_get_fd method Daniel P. Berrangé
2022-06-20 15:28   ` Juan Quintela
2022-06-20 11:01 ` [PATCH v2 15/21] migration: remove the QEMUFileOps 'shut_down' callback Daniel P. Berrangé
2022-06-20 15:36   ` Juan Quintela [this message]
2022-06-20 11:02 ` [PATCH v2 16/21] migration: remove the QEMUFileOps 'set_blocking' callback Daniel P. Berrangé
2022-06-20 15:39   ` Juan Quintela
2022-06-20 11:02 ` [PATCH v2 17/21] migration: remove the QEMUFileOps 'close' callback Daniel P. Berrangé
2022-06-20 15:40   ` Juan Quintela
2022-06-20 11:02 ` [PATCH v2 18/21] migration: remove the QEMUFileOps 'get_buffer' callback Daniel P. Berrangé
2022-06-20 15:40   ` Juan Quintela
2022-06-27 12:04   ` Dr. David Alan Gilbert
2022-06-20 11:02 ` [PATCH v2 19/21] migration: remove the QEMUFileOps 'writev_buffer' callback Daniel P. Berrangé
2022-06-20 15:43   ` Juan Quintela
2022-06-20 11:02 ` [PATCH v2 20/21] migration: remove the QEMUFileOps 'get_return_path' callback Daniel P. Berrangé
2022-06-20 15:45   ` Juan Quintela
2022-06-20 11:02 ` [PATCH v2 21/21] migration: remove the QEMUFileOps abstraction Daniel P. Berrangé
2022-06-20 15:47   ` Juan Quintela

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=87mte71h4y.fsf@secure.mitica \
    --to=quintela@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=fam@euphon.net \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=zhang.zhanghailiang@huawei.com \
    --cc=zhanghailiang@xfusion.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).