From: Wei Yang <richardw.yang@linux.intel.com>
To: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: Wei Yang <richardw.yang@linux.intel.com>,
qemu-devel@nongnu.org, dgilbert@redhat.com, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/4] migration/savevm: remove duplicate check of migration_is_blocked
Date: Fri, 26 Apr 2019 08:39:01 +0800 [thread overview]
Message-ID: <20190426003901.GA25513@richard> (raw)
In-Reply-To: <e9cd3438-345f-2a68-daec-1ce4cba37ef1@gmail.com>
On Thu, Apr 25, 2019 at 04:20:57PM -0300, Daniel Henrique Barboza wrote:
>
>
>On 4/23/19 9:46 PM, Wei Yang wrote:
>> Current call flow of save_snapshot is:
>>
>> save_snapshot
>> migration_is_blocked
>> qemu_savevm_state
>> migration_is_blocked
>>
>> Since qemu_savevm_state is only called in save_snapshot, this means
>> migration_is_blocked has been already checked.
>
>I think it would be a nice touch to add a comment in qemu_savevm_state,
>saying that the function must be called with migration_is_blocked()
>context. Just in case someone else in the future ends up re-using the
>function.
>
That's reasonable, let me add a comment for qemu_savevm_state().
>
>Other than that, +1 for less code duplication.
>
>
>Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>
>
>
>
>>
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> ---
>> migration/savevm.c | 4 ----
>> 1 file changed, 4 deletions(-)
>>
>> diff --git a/migration/savevm.c b/migration/savevm.c
>> index 92af2471cd..2eea604624 100644
>> --- a/migration/savevm.c
>> +++ b/migration/savevm.c
>> @@ -1412,10 +1412,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
>> return -EINVAL;
>> }
>> - if (migration_is_blocked(errp)) {
>> - return -EINVAL;
>> - }
>> -
>> if (migrate_use_block()) {
>> error_setg(errp, "Block migration and snapshots are incompatible");
>> return -EINVAL;
--
Wei Yang
Help you, Help me
WARNING: multiple messages have this Message-ID (diff)
From: Wei Yang <richardw.yang@linux.intel.com>
To: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: quintela@redhat.com, Wei Yang <richardw.yang@linux.intel.com>,
dgilbert@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/4] migration/savevm: remove duplicate check of migration_is_blocked
Date: Fri, 26 Apr 2019 08:39:01 +0800 [thread overview]
Message-ID: <20190426003901.GA25513@richard> (raw)
Message-ID: <20190426003901.AhGBkU8QUxcqYI872g3yjsWYVTtL0--eSUOz6d4Ick4@z> (raw)
In-Reply-To: <e9cd3438-345f-2a68-daec-1ce4cba37ef1@gmail.com>
On Thu, Apr 25, 2019 at 04:20:57PM -0300, Daniel Henrique Barboza wrote:
>
>
>On 4/23/19 9:46 PM, Wei Yang wrote:
>> Current call flow of save_snapshot is:
>>
>> save_snapshot
>> migration_is_blocked
>> qemu_savevm_state
>> migration_is_blocked
>>
>> Since qemu_savevm_state is only called in save_snapshot, this means
>> migration_is_blocked has been already checked.
>
>I think it would be a nice touch to add a comment in qemu_savevm_state,
>saying that the function must be called with migration_is_blocked()
>context. Just in case someone else in the future ends up re-using the
>function.
>
That's reasonable, let me add a comment for qemu_savevm_state().
>
>Other than that, +1 for less code duplication.
>
>
>Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>
>
>
>
>>
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> ---
>> migration/savevm.c | 4 ----
>> 1 file changed, 4 deletions(-)
>>
>> diff --git a/migration/savevm.c b/migration/savevm.c
>> index 92af2471cd..2eea604624 100644
>> --- a/migration/savevm.c
>> +++ b/migration/savevm.c
>> @@ -1412,10 +1412,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
>> return -EINVAL;
>> }
>> - if (migration_is_blocked(errp)) {
>> - return -EINVAL;
>> - }
>> -
>> if (migrate_use_block()) {
>> error_setg(errp, "Block migration and snapshots are incompatible");
>> return -EINVAL;
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2019-04-26 0:39 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-24 0:46 [Qemu-devel] [PATCH 0/4] cleanup savevm Wei Yang
2019-04-24 0:46 ` Wei Yang
2019-04-24 0:46 ` [Qemu-devel] [PATCH 1/4] migration/savevm: remove duplicate check of migration_is_blocked Wei Yang
2019-04-24 0:46 ` Wei Yang
2019-04-25 19:20 ` Daniel Henrique Barboza
2019-04-25 19:20 ` Daniel Henrique Barboza
2019-04-26 0:39 ` Wei Yang [this message]
2019-04-26 0:39 ` Wei Yang
2019-05-14 14:46 ` Dr. David Alan Gilbert
2019-05-14 15:55 ` Dr. David Alan Gilbert
2019-04-24 0:46 ` [Qemu-devel] [PATCH 2/4] migration/savevm: use migration_is_blocked to validate Wei Yang
2019-04-24 0:46 ` Wei Yang
2019-04-25 20:55 ` Daniel Henrique Barboza
2019-04-25 20:55 ` Daniel Henrique Barboza
2019-04-26 0:51 ` Wei Yang
2019-04-26 0:51 ` Wei Yang
2019-05-14 15:18 ` Dr. David Alan Gilbert
2019-05-15 6:38 ` Wei Yang
2019-05-15 7:03 ` Wei Yang
2019-05-15 9:38 ` Dr. David Alan Gilbert
2019-05-15 12:28 ` Wei Yang
2019-04-24 0:46 ` [Qemu-devel] [PATCH 3/4] migration/savevm: load_header before load_setup Wei Yang
2019-04-24 0:46 ` Wei Yang
2019-05-14 15:45 ` Dr. David Alan Gilbert
2019-04-24 0:47 ` [Qemu-devel] [PATCH 4/4] migration/savevm: wrap into qemu_loadvm_state_header() Wei Yang
2019-04-24 0:47 ` Wei Yang
2019-04-25 22:07 ` Daniel Henrique Barboza
2019-04-25 22:07 ` Daniel Henrique Barboza
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=20190426003901.GA25513@richard \
--to=richardw.yang@linux.intel.com \
--cc=danielhb413@gmail.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).