qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Subject: Re: [PATCH RFC] migration: warn about non-migratable configurations unless '--no-migration' was specified
Date: Sat, 17 Apr 2021 11:35:26 +0200	[thread overview]
Message-ID: <87sg3p1cf5.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20210415154402.28424-1-vkuznets@redhat.com> (Vitaly Kuznetsov's message of "Thu, 15 Apr 2021 17:44:02 +0200")

Vitaly Kuznetsov <vkuznets@redhat.com> writes:

> When a migration blocker is added nothing is reported to the user,
> inability to migrate such guest may come as a late surprise. As a bare
> minimum, we can print a warning. To not pollute the output for those, who
> have no intention to migrate their guests, introduce '--no-migration'
> option which both block the migration and eliminates warning from

Sure this justifies its own command line option?  Can we make it a
parameter of an existing option?  We have too many options, and options
starting "no-" are often awkward.

> Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
>  include/qapi/qmp/qerror.h |  3 +++
>  include/sysemu/sysemu.h   |  1 +
>  migration/migration.c     | 18 +++++++++++++++++-
>  qemu-options.hx           |  7 +++++++
>  softmmu/globals.c         |  1 +
>  softmmu/vl.c              |  3 +++
>  6 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
> index 596fce0c54e7..2e1563c72f83 100644
> --- a/include/qapi/qmp/qerror.h
> +++ b/include/qapi/qmp/qerror.h
> @@ -50,6 +50,9 @@
   /*
    * These macros will go away, please don't use in new code, and do not
    * add new ones!
    */
   ...
>  #define QERR_MISSING_PARAMETER \
>      "Parameter '%s' is missing"
>  
> +#define QERR_NO_MIGRATION \
> +    "Guest is not migratable ('--no-migration' used)"
> +
>  #define QERR_PERMISSION_DENIED \
>      "Insufficient permission to perform this operation"
>  

Please don't add new macros here.

Looks like you use QERR_NO_MIGRATION only in migration/migration.c.  You
can add a macro there.  Or simply duplicate the error string, which I'd
find easier to read.  Up to you.

> diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
> index 8fae667172ac..c65cd5d5a336 100644
> --- a/include/sysemu/sysemu.h
> +++ b/include/sysemu/sysemu.h
> @@ -9,6 +9,7 @@
>  /* vl.c */
>  
>  extern int only_migratable;
> +extern int no_migration;
>  extern const char *qemu_name;
>  extern QemuUUID qemu_uuid;
>  extern bool qemu_uuid_set;
> diff --git a/migration/migration.c b/migration/migration.c
> index ca8b97baa5ac..29a8480ced54 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -1077,7 +1077,9 @@ static void fill_source_migration_info(MigrationInfo *info)
>      info->blocked = migration_is_blocked(NULL);
>      info->has_blocked_reasons = info->blocked;
>      info->blocked_reasons = NULL;
> -    if (info->blocked) {
> +    if (no_migration) {
> +        QAPI_LIST_PREPEND(info->blocked_reasons, g_strdup(QERR_NO_MIGRATION));
> +    } else if (info->blocked) {
>          GSList *cur_blocker = migration_blockers;
>  
>          /*

Apropos blocked-reasons.  migration.json has:

    # @blocked: True if outgoing migration is blocked (since 6.0)
    #
    # @blocked-reasons: A list of reasons an outgoing migration is blocked (since 6.0)
    [...]
              'blocked': 'bool',
              '*blocked-reasons': ['str'],

Can "blocked-reasons" be absent or empty when "blocked" is true?

If not, then "blocked" is redundant, and should be dropped before we
release 6.0.

Else, the documentation should spell it out.  No need to rush that.

The patch was not cc'ed to me.  I might have caught it earlier...

[...]



  parent reply	other threads:[~2021-04-17  9:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 15:44 [PATCH RFC] migration: warn about non-migratable configurations unless '--no-migration' was specified Vitaly Kuznetsov
2021-04-15 16:04 ` Daniel P. Berrangé
2021-04-15 16:30   ` Eduardo Habkost
2021-04-15 16:40     ` Daniel P. Berrangé
2021-04-15 17:07       ` Daniel P. Berrangé
2021-04-15 17:28   ` Dr. David Alan Gilbert
2021-04-16  7:33     ` Vitaly Kuznetsov
2021-04-16 16:28       ` Eduardo Habkost
2021-04-17  9:33         ` Markus Armbruster
2021-04-19 16:42         ` Daniel P. Berrangé
2021-04-19 16:48           ` Eduardo Habkost
2021-04-19 17:11         ` Dr. David Alan Gilbert
2021-04-19 17:15           ` Daniel P. Berrangé
2021-04-19 17:17             ` Daniel P. Berrangé
2021-04-19 18:47               ` Dr. David Alan Gilbert
2021-04-19 19:32                 ` Eduardo Habkost
2021-04-20 11:51                   ` Dr. David Alan Gilbert
2021-04-20 13:48                     ` Eduardo Habkost
2021-04-20 14:10                       ` Dr. David Alan Gilbert
2021-04-20 14:15                         ` Daniel P. Berrangé
2021-04-20 15:20                         ` Eduardo Habkost
2021-04-17  9:35 ` Markus Armbruster [this message]
2021-04-19  7:26   ` Markus Armbruster
2021-04-19 15:46   ` Markus Armbruster
2021-04-18 15:53 ` Peter Maydell
2021-04-19 16:28   ` Eduardo Habkost
2021-04-19 16:37     ` Daniel P. Berrangé

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=87sg3p1cf5.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=vkuznets@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).