qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] migration: implement query migration threadinfo by name


From: Juan Quintela
Subject: Re: [PATCH 2/3] migration: implement query migration threadinfo by name
Date: Mon, 30 Jan 2023 05:27:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Jiang Jiacheng <jiangjiacheng@huawei.com> wrote:
> Introduce interface query-migrationthreads. The interface is use
> with the migration thread name reported by qemu and returns with
> migration thread name and its pid.
> Introduce threadinfo.c to manage threads with migration.
>
> Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com>

I like this query interface better than the way you expose the thread
name in the 1st place.

But once that we are here, why don't we just "tweak" abit the interface:

> diff --git a/qapi/migration.json b/qapi/migration.json
> index b0cf366ac0..e93c3e560a 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -1970,6 +1970,36 @@
>  { 'command': 'query-vcpu-dirty-limit',
>    'returns': [ 'DirtyLimitInfo' ] }
>  
> +##
> +# @MigrationThreadInfo:
> +#
> +# Information about migrationthreads
> +#
> +# @name: the name of migration thread
> +#
> +# @thread-id: ID of the underlying host thread
> +#
> +# Since: 7.2
> +##
> +{ 'struct': 'MigrationThreadInfo',
> +  'data': {'name': 'str',
> +           'thread-id': 'int'} }

1st, it is an int enough for all architectures?  I know that for linux
and friends it is, but not sure about windows and other weird systems.

> +##
> +# @query-migrationthreads:

What about renaming this to:

@query-migrationthread (I removed the last 's')

because it returns the info of a single thread.

> +#
> +# Returns threadInfo about the thread specified by name
> +#
> +# data: migration thread name
> +#
> +# returns: information about the specified thread
> +#
> +# Since: 7.2
> +##
> +{ 'command': 'query-migrationthreads',
> +  'data': { 'name': 'str' },
> +  'returns': 'MigrationThreadInfo' }
> +
>  ##
>  # @snapshot-save:
>  #

And leaves the @query-migrationthreads name for something in the spirit of

> +{ 'command': 'query-migrationthreads',
> +  'returns': ['str'] }

That returns all the migration threads names.

Or perhaps even

> +{ 'command': 'query-migrationthreads',
> +  'returns': ['MigrationThreadInfo'] }

And call it a day?

Later, Juan.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]