All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: "Laurent Vivier" <lvivier@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH v2 05/10] migration: Make multifd_load_setup() get an Error parameter
Date: Tue, 07 Jan 2020 14:00:06 +0100	[thread overview]
Message-ID: <8736crqv55.fsf@trasno.org> (raw)
In-Reply-To: <20200103172222.GP3804@work-vm> (David Alan Gilbert's message of "Fri, 3 Jan 2020 17:22:22 +0000")

"Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> * Juan Quintela (quintela@redhat.com) wrote:
>> We need to change the full chain to pass the Error parameter.
>> 
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>>  migration/migration.c | 10 +++++-----
>>  migration/migration.h |  2 +-
>>  migration/ram.c       |  2 +-
>>  migration/ram.h       |  2 +-
>>  migration/rdma.c      |  2 +-
>>  5 files changed, 9 insertions(+), 9 deletions(-)
>> 
>> diff --git a/migration/migration.c b/migration/migration.c
>> index 5a56bd0c91..cf6cec5fb6 100644
>> --- a/migration/migration.c
>> +++ b/migration/migration.c
>> @@ -518,11 +518,11 @@ fail:
>>      exit(EXIT_FAILURE);
>>  }
>>  
>> -static void migration_incoming_setup(QEMUFile *f)
>> +static void migration_incoming_setup(QEMUFile *f, Error **errp)
>>  {
>>      MigrationIncomingState *mis = migration_incoming_get_current();
>>  
>> -    if (multifd_load_setup() != 0) {
>> +    if (multifd_load_setup(errp) != 0) {
>>          /* We haven't been able to create multifd threads
>>             nothing better to do */
>
> But if you're taking an errp and the load fails, don't you want to
> report the error before you exit? (with an error_get_pretty or
> something?)

error_report_err() that is.

>
>>          exit(EXIT_FAILURE);
>> @@ -572,13 +572,13 @@ static bool postcopy_try_recover(QEMUFile *f)
>>      return false;
>>  }
>>  
>> -void migration_fd_process_incoming(QEMUFile *f)
>> +void migration_fd_process_incoming(QEMUFile *f, Error **errp)
>>  {
>>      if (postcopy_try_recover(f)) {
>>          return;
>>      }
>>  
>> -    migration_incoming_setup(f);
>> +    migration_incoming_setup(f, errp);
>>      migration_incoming_process();
>
> and if you're making incoming_setup able to fail, don't you need
> to.... hmm, skip the incoming_process?

Changing it to test for errors, thanks.

>>  }
>>  
>> @@ -596,7 +596,7 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)
>>              return;
>>          }
>>  
>> -        migration_incoming_setup(f);
>> +        migration_incoming_setup(f, errp);
>
> Don't you need to make that use a local_err and propagate, like in the
> other half of the if/else?

Changed the whole business.  It appears that each time that I use an
Error ** I have to relearn how to use it.  Changed all places to use a
local error and propagate/error_report_err() as apropiate.

>>      rdma->migration_started_on_destination = 1;
>> -    migration_fd_process_incoming(f);
>> +    migration_fd_process_incoming(f, errp);
>
> Heck, the errp handling in rdma_accept_incoming_migration is very very
> broken; I don't see how the errp ever gets reported or freed.
> (But that's an existing problem)

Leaving this for next series.

Thanks, Juan.



  reply	other threads:[~2020-01-07 14:39 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  2:01 [PATCH v2 00/10] Multifd Migration Compression Juan Quintela
2019-12-18  2:01 ` [PATCH v2 01/10] migration: Increase default number of multifd channels to 16 Juan Quintela
2020-01-03 16:51   ` Dr. David Alan Gilbert
2020-01-03 16:58   ` Daniel P. Berrangé
2020-01-03 17:01     ` Dr. David Alan Gilbert
2020-01-03 17:12       ` Daniel P. Berrangé
2020-01-03 17:32         ` Dr. David Alan Gilbert
2020-01-03 18:25     ` Juan Quintela
2020-01-07 12:49       ` Daniel P. Berrangé
2020-01-07 13:32         ` Juan Quintela
2020-01-07 13:42           ` Daniel P. Berrangé
2020-01-03 17:49   ` Daniel P. Berrangé
2019-12-18  2:01 ` [PATCH v2 02/10] migration-test: Add migration multifd test Juan Quintela
2019-12-18  2:01 ` [PATCH v2 03/10] migration-test: introduce functions to handle string parameters Juan Quintela
2020-01-03 16:57   ` Dr. David Alan Gilbert
2019-12-18  2:01 ` [PATCH v2 04/10] migration: Make multifd_save_setup() get an Error parameter Juan Quintela
2020-01-03 16:46   ` Dr. David Alan Gilbert
2020-01-07 12:35     ` Juan Quintela
2019-12-18  2:01 ` [PATCH v2 05/10] migration: Make multifd_load_setup() " Juan Quintela
2020-01-03 17:22   ` Dr. David Alan Gilbert
2020-01-07 13:00     ` Juan Quintela [this message]
2019-12-18  2:01 ` [PATCH v2 06/10] migration: Add multifd-compress parameter Juan Quintela
2019-12-19  7:41   ` Markus Armbruster
2020-01-03 17:57   ` Dr. David Alan Gilbert
2020-01-07 13:03     ` Juan Quintela
2019-12-18  2:01 ` [PATCH v2 07/10] migration: Make no compression operations into its own structure Juan Quintela
2020-01-03 18:20   ` Dr. David Alan Gilbert
2020-01-07 13:08     ` Juan Quintela
2019-12-18  2:01 ` [PATCH v2 08/10] migration: Add zlib compression multifd support Juan Quintela
2019-12-18  2:01 ` [PATCH v2 09/10] configure: Enable test and libs for zstd Juan Quintela
2019-12-18  2:01 ` [PATCH v2 10/10] migration: Add zstd compression multifd support Juan Quintela

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=8736crqv55.fsf@trasno.org \
    --to=quintela@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.