qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Cc: amit.shah@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] migration: We also want to store the global state for savevm
Date: Wed, 15 Jul 2015 10:33:50 +0200	[thread overview]
Message-ID: <55A61AEE.70903@de.ibm.com> (raw)
In-Reply-To: <20150715081815.GA2251@work-vm>

Am 15.07.2015 um 10:18 schrieb Dr. David Alan Gilbert:
> * Juan Quintela (quintela@redhat.com) wrote:
>> Previous commit only stored a valid state for migration.  It stored the
>> empty string for savevm.  Now, we are also storing the current state for
>> savevm.
>>
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
> 
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> 
> Looks OK to me; Christian - does it fix it for you?

This patch seems to work ok.


> 
> Dave
> 
>> ---
>>  include/migration/migration.h | 1 +
>>  migration/migration.c         | 2 +-
>>  migration/savevm.c            | 6 ++++++
>>  3 files changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/migration/migration.h b/include/migration/migration.h
>> index b2711ef..a2f8ed0 100644
>> --- a/include/migration/migration.h
>> +++ b/include/migration/migration.h
>> @@ -202,4 +202,5 @@ void savevm_skip_section_footers(void);
>>  void register_global_state(void);
>>  void global_state_set_optional(void);
>>  void savevm_skip_configuration(void);
>> +int global_state_store(void);
>>  #endif
>> diff --git a/migration/migration.c b/migration/migration.c
>> index ba82ff6..86ca099 100644
>> --- a/migration/migration.c
>> +++ b/migration/migration.c
>> @@ -110,7 +110,7 @@ typedef struct {
>>
>>  static GlobalState global_state;
>>
>> -static int global_state_store(void)
>> +int global_state_store(void)
>>  {
>>      if (!runstate_store((char *)global_state.runstate,
>>                          sizeof(global_state.runstate))) {
>> diff --git a/migration/savevm.c b/migration/savevm.c
>> index 86735fc..81dbe58 100644
>> --- a/migration/savevm.c
>> +++ b/migration/savevm.c
>> @@ -1315,6 +1315,12 @@ void hmp_savevm(Monitor *mon, const QDict *qdict)
>>      }
>>
>>      saved_vm_running = runstate_is_running();
>> +
>> +    ret = global_state_store();
>> +    if (ret) {
>> +        monitor_printf(mon, "Error saving global state\n");
>> +        return;
>> +    }
>>      vm_stop(RUN_STATE_SAVE_VM);
>>
>>      memset(sn, 0, sizeof(*sn));
>> -- 
>> 2.4.3
>>
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
> 

      reply	other threads:[~2015-07-15  8:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15  7:56 [Qemu-devel] [PATCH] migration: We also want to store the global state for savevm Juan Quintela
2015-07-15  8:10 ` Amit Shah
2015-07-15  8:19   ` Juan Quintela
2015-07-15  8:40     ` Amit Shah
2015-07-15  8:18 ` Dr. David Alan Gilbert
2015-07-15  8:33   ` Christian Borntraeger [this message]

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=55A61AEE.70903@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=amit.shah@redhat.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).