qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v6 01/19] migration: Create migration_ioc_proces


From: Peter Xu
Subject: Re: [Qemu-devel] [PATCH v6 01/19] migration: Create migration_ioc_process_incoming()
Date: Fri, 11 Aug 2017 11:47:25 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

On Tue, Aug 08, 2017 at 06:26:11PM +0200, Juan Quintela wrote:

[...]

>  void migration_fd_process_incoming(QEMUFile *f)
>  {
> -    Coroutine *co = qemu_coroutine_create(process_incoming_migration_co, f);
> -
> +    Coroutine *co = qemu_coroutine_create(process_incoming_migration_co, 
> NULL);
> +    MigrationIncomingState *mis = migration_incoming_get_current();
> +    
> +    if (!mis->from_src_file) {
> +        mis->from_src_file = f;

[1]

> +    }
>      qemu_file_set_blocking(f, false);
>      qemu_coroutine_enter(co);
>  }
>  
> +void migration_ioc_process_incoming(QIOChannel *ioc)
> +{
> +    MigrationIncomingState *mis = migration_incoming_get_current();
> +
> +    if (!mis->from_src_file) {
> +        QEMUFile *f = qemu_fopen_channel_input(ioc);
> +        mis->from_src_file = f;

Remove this line? Since migration_fd_process_incoming() will set it up
as well below at [1].

Then we can make sure there will be only one place to setup
from_src_file.

> +        migration_fd_process_incoming(f);
> +    }
> +    /* We still only have a single channel.  Nothing to do here yet */
> +}

Thanks,

-- 
Peter Xu



reply via email to

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