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: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH v6 01/19] migration: Create migration_ioc_process_incoming()
Date: Wed, 13 Sep 2017 11:41:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Peter Xu <address@hidden> wrote:
> 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.

Done.

I still think that it is weird that we have both:
- mis
- f

in one function and wait to asign that to other function, but I agree
that it is also weird to set it up in two places.

Later, Juan.



reply via email to

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