Re: [RFC PATCH 10/17] COLO ctl: introduce is_slave() and is_master()

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

 



* Yang Hongyang (yanghy@xxxxxxxxxxxxxx) wrote:
> is_slaver is to determine whether the QEMU instance is a
> slaver(migration target) at runtime.
> is_master is to determine whether the QEMU instance is a
> master(migration starter) at runtime.
> This 2 APIs will be used later.

Since the names are made global in patch 15, I think it's best to
do it here, but also use a more specific name for them, like
colo_is_master.

Dave

> Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
> ---
>  migration-colo.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/migration-colo.c b/migration-colo.c
> index 802f8b0..2699e77 100644
> --- a/migration-colo.c
> +++ b/migration-colo.c
> @@ -187,6 +187,12 @@ static const QEMUFileOps colo_read_ops = {
>  
>  /* save */
>  
> +static __attribute__((unused)) bool is_master(void)
> +{
> +    MigrationState *s = migrate_get_current();
> +    return (s->state == MIG_STATE_COLO);
> +}
> +
>  static void *colo_thread(void *opaque)
>  {
>      MigrationState *s = opaque;
> @@ -275,6 +281,11 @@ void colo_init_checkpointer(MigrationState *s)
>  
>  static Coroutine *colo;
>  
> +static __attribute__((unused)) bool is_slave(void)
> +{
> +    return colo != NULL;
> +}
> +
>  /*
>   * return:
>   * 0: start a checkpoint
> -- 
> 1.9.1
> 
--
Dr. David Alan Gilbert / dgilbert@xxxxxxxxxx / Manchester, UK
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux