qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Steve Sistare <steven.sistare@oracle.com>
Cc: qemu-devel@nongnu.org, Fabiano Rosas <farosas@suse.de>,
	Peter Xu <peterx@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	"Dr. David Alan Gilbert" <dave@treblig.org>
Subject: Re: [PATCH V3 5/9] migration: cpr-exec-command parameter
Date: Mon, 8 Sep 2025 17:07:04 +0100	[thread overview]
Message-ID: <aL7_KHXT0XuvY6aG@redhat.com> (raw)
In-Reply-To: <1755191843-283480-6-git-send-email-steven.sistare@oracle.com>

On Thu, Aug 14, 2025 at 10:17:19AM -0700, Steve Sistare wrote:
> Create the cpr-exec-command migration parameter, defined as a list of
> strings.  It will be used for cpr-exec migration mode in a subsequent
> patch, and contains forward references to cpr-exec mode in the qapi
> doc.
> 
> No functional change, except that cpr-exec-command is shown by the
> 'info migrate' command.
> 
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
> ---
>  qapi/migration.json            | 21 ++++++++++++++++++---
>  migration/migration-hmp-cmds.c | 25 +++++++++++++++++++++++++
>  migration/options.c            | 14 ++++++++++++++
>  hmp-commands.hx                |  2 +-
>  4 files changed, 58 insertions(+), 4 deletions(-)

> diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c
> index 0fc21f0..79aa528 100644
> --- a/migration/migration-hmp-cmds.c
> +++ b/migration/migration-hmp-cmds.c
> @@ -306,6 +306,18 @@ void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict)
>      qapi_free_MigrationCapabilityStatusList(caps);
>  }
>  
> +static void monitor_print_cpr_exec_command(Monitor *mon, strList *args)
> +{
> +    monitor_printf(mon, "%s:",
> +        MigrationParameter_str(MIGRATION_PARAMETER_CPR_EXEC_COMMAND));
> +
> +    while (args) {
> +        monitor_printf(mon, " %s", args->value);
> +        args = args->next;
> +    }
> +    monitor_printf(mon, "\n");
> +}
> +
>  void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
>  {
>      MigrationParameters *params;
> @@ -435,6 +447,9 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
>                                 MIGRATION_PARAMETER_DIRECT_IO),
>                             params->direct_io ? "on" : "off");
>          }
> +
> +        assert(params->has_cpr_exec_command);
> +        monitor_print_cpr_exec_command(mon, params->cpr_exec_command);
>      }
>  
>      qapi_free_MigrationParameters(params);
> @@ -716,6 +731,16 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
>          p->has_direct_io = true;
>          visit_type_bool(v, param, &p->direct_io, &err);
>          break;
> +    case MIGRATION_PARAMETER_CPR_EXEC_COMMAND: {
> +        g_autofree char **strv = g_strsplit(valuestr ?: "", " ", -1);


Perhaps we should use   g_shell_parse_argv() in the HMP case ? IIUC
it should handle quoting for args containing whitespace (as long as
HMP itself has not already mangled that ?).

> +        strList **tail = &p->cpr_exec_command;
> +
> +        for (int i = 0; strv[i]; i++) {
> +            QAPI_LIST_APPEND(tail, strv[i]);
> +        }
> +        p->has_cpr_exec_command = true;
> +        break;
> +    }
>      default:
>          g_assert_not_reached();
>      }

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2025-09-08 16:08 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 17:17 [PATCH V3 0/9] Live update: cpr-exec Steve Sistare
2025-08-14 17:17 ` [PATCH V3 1/9] migration: multi-mode notifier Steve Sistare
2025-08-19 13:09   ` Fabiano Rosas
2025-09-09 15:43   ` Peter Xu
2025-09-09 16:40     ` Steven Sistare
2025-08-14 17:17 ` [PATCH V3 2/9] migration: add cpr_walk_fd Steve Sistare
2025-09-09 15:45   ` Peter Xu
2025-08-14 17:17 ` [PATCH V3 3/9] oslib: qemu_clear_cloexec Steve Sistare
2025-08-14 17:17 ` [PATCH V3 4/9] vl: helper to request exec Steve Sistare
2025-09-09 15:51   ` Peter Xu
2025-09-12 14:49     ` Steven Sistare
2025-08-14 17:17 ` [PATCH V3 5/9] migration: cpr-exec-command parameter Steve Sistare
2025-09-08 16:07   ` Daniel P. Berrangé [this message]
2025-09-09 15:22     ` Steven Sistare
2025-09-11 15:10   ` Markus Armbruster
2025-09-12 14:48     ` Steven Sistare
2025-08-14 17:17 ` [PATCH V3 6/9] migration: cpr-exec save and load Steve Sistare
2025-08-14 17:17 ` [PATCH V3 7/9] migration: cpr-exec mode Steve Sistare
2025-09-09 16:32   ` Peter Xu
2025-09-09 18:10     ` Steven Sistare
2025-09-09 19:27       ` Peter Xu
2025-09-12 14:49         ` Steven Sistare
2025-09-11 15:09   ` Markus Armbruster
2025-09-12 14:49     ` Steven Sistare
2025-08-14 17:17 ` [PATCH V3 8/9] migration: cpr-exec docs Steve Sistare
2025-08-14 17:17 ` [PATCH V3 9/9] vfio: cpr-exec mode Steve Sistare
2025-08-14 17:20   ` Steven Sistare
2025-09-05 16:48 ` [PATCH V3 0/9] Live update: cpr-exec Peter Xu
2025-09-05 17:09   ` Dr. David Alan Gilbert
2025-09-05 17:48     ` Peter Xu
2025-09-09 14:36   ` Steven Sistare
2025-09-09 15:24     ` Peter Xu
2025-09-09 16:03       ` Steven Sistare
2025-09-09 18:37         ` Peter Xu
2025-09-12 14:50           ` Steven Sistare
2025-09-12 15:44             ` Peter Xu
2025-09-09 16:41       ` Vladimir Sementsov-Ogievskiy
2025-09-08 17:02 ` Vladimir Sementsov-Ogievskiy

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=aL7_KHXT0XuvY6aG@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=steven.sistare@oracle.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).