All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix save or snapshot at kernel loading time with HVM vm
@ 2010-05-17  5:57 James (song wei)
  2010-05-17 10:03 ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: James (song wei) @ 2010-05-17  5:57 UTC (permalink / raw)
  To: xen-devel


If doing save or snapshot at the time of kernel loading of a HVN vm,
event_channel haven't been initialized, so that make this saving with
xenstore. a string named "suspend" not "suspended"  will be sent to xend
from checkpoint thread. 
 But in the shutdown function with parameter "suspend" think this request
should shutdown this hvm guest, but obviously, this is not the expectation
of save or  snapshot. 

-James (Song Wei)

Signed-off-by:James (Song Wei) <jsong@novell.com>
diff -r baccadfd9418 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri May 14 08:05:05 2010
+0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon May 17 13:56:15 2010
+0800
@@ -530,7 +530,7 @@
         self.storeDom("control/shutdown", reason)
 
         # HVM domain shuts itself down only if it has PV drivers
-        if self.info.is_hvm():
+        if self.info.is_hvm() and reason != 'suspend':
             hvm_pvdrv = xc.hvm_get_param(self.domid,
HVM_PARAM_CALLBACK_IRQ)
             hvm_s_state = xc.hvm_get_param(self.domid,
HVM_PARAM_ACPI_S_STATE)
             if not hvm_pvdrv or hvm_s_state != 0:

-- 
View this message in context: http://old.nabble.com/-PATCH--fix-save-or-snapshot-at-kernel-loading-time-with-HVM-vm-tp28579732p28579732.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix save or snapshot at kernel loading time with HVM vm
  2010-05-17  5:57 [PATCH] fix save or snapshot at kernel loading time with HVM vm James (song wei)
@ 2010-05-17 10:03 ` Keir Fraser
  2010-05-19  6:44   ` James (song wei)
  0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2010-05-17 10:03 UTC (permalink / raw)
  To: James (song wei), xen-devel

On 17/05/2010 06:57, "James (song wei)" <jsong@novell.com> wrote:

> 
> If doing save or snapshot at the time of kernel loading of a HVN vm,
> event_channel haven't been initialized, so that make this saving with
> xenstore. a string named "suspend" not "suspended"  will be sent to xend
> from checkpoint thread.
>  But in the shutdown function with parameter "suspend" think this request
> should shutdown this hvm guest, but obviously, this is not the expectation
> of save or  snapshot.

I don't really understand this patch comment, and the solution just looks
like a poor hack which noone in future will be able to fathom.

 -- Keir

> -James (Song Wei)
> 
> Signed-off-by:James (Song Wei) <jsong@novell.com>
> diff -r baccadfd9418 tools/python/xen/xend/XendDomainInfo.py
> --- a/tools/python/xen/xend/XendDomainInfo.py   Fri May 14 08:05:05 2010
> +0100
> +++ b/tools/python/xen/xend/XendDomainInfo.py   Mon May 17 13:56:15 2010
> +0800
> @@ -530,7 +530,7 @@
>          self.storeDom("control/shutdown", reason)
>  
>          # HVM domain shuts itself down only if it has PV drivers
> -        if self.info.is_hvm():
> +        if self.info.is_hvm() and reason != 'suspend':
>              hvm_pvdrv = xc.hvm_get_param(self.domid,
> HVM_PARAM_CALLBACK_IRQ)
>              hvm_s_state = xc.hvm_get_param(self.domid,
> HVM_PARAM_ACPI_S_STATE)
>              if not hvm_pvdrv or hvm_s_state != 0:

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix save or snapshot at kernel loading time with HVM vm
  2010-05-17 10:03 ` Keir Fraser
@ 2010-05-19  6:44   ` James (song wei)
  2010-05-19  7:47     ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: James (song wei) @ 2010-05-19  6:44 UTC (permalink / raw)
  To: xen-devel




Keir Fraser-3 wrote:
> 
> On 17/05/2010 06:57, "James (song wei)" <jsong@novell.com> wrote:
> 
>> 
>> If doing save or snapshot at the time of kernel loading of a HVN vm,
>> event_channel haven't been initialized, so that make this saving with
>> xenstore. a string named "suspend" not "suspended"  will be sent to xend
>> from checkpoint thread.
>>  But in the shutdown function with parameter "suspend" think this request
>> should shutdown this hvm guest, but obviously, this is not the
>> expectation
>> of save or  snapshot.
> 
>>>I don't really understand this patch comment, and the solution just looks
>>>like a poor hack which noone in future will be able to fathom.
> 
> Keir,
>     Sorry for not descripting this issue clearly.  When I do save at the
> beginning of HVM guest booting(first stage - loading kernel), I found
> guest os destoryed after saving completely. So I see the code and get this
> flow:
> xc_save()( here, call this function, when loading the kernel at the time
> of guest booting. Event channel haven't been initialized,so that go to 
> compat_suspend() path in suspend()(save.c) -->> then, notify  the thread
> named saveInputHandler in xend with a string "suspend". so  that
> dominfo.shutdown is invoked.
> So, VM shutdown after do saving operator.
> 
> -James (Song Wei)
>> 
>> Signed-off-by:James (Song Wei) <jsong@novell.com>
>> diff -r baccadfd9418 tools/python/xen/xend/XendDomainInfo.py
>> --- a/tools/python/xen/xend/XendDomainInfo.py   Fri May 14 08:05:05 2010
>> +0100
>> +++ b/tools/python/xen/xend/XendDomainInfo.py   Mon May 17 13:56:15 2010
>> +0800
>> @@ -530,7 +530,7 @@
>>          self.storeDom("control/shutdown", reason)
>>  
>>          # HVM domain shuts itself down only if it has PV drivers
>> -        if self.info.is_hvm():
>> +        if self.info.is_hvm() and reason != 'suspend':
>>              hvm_pvdrv = xc.hvm_get_param(self.domid,
>> HVM_PARAM_CALLBACK_IRQ)
>>              hvm_s_state = xc.hvm_get_param(self.domid,
>> HVM_PARAM_ACPI_S_STATE)
>>              if not hvm_pvdrv or hvm_s_state != 0:
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 
> 

-- 
View this message in context: http://old.nabble.com/-PATCH--fix-save-or-snapshot-at-kernel-loading-time-with-HVM-vm-tp28579732p28604661.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix save or snapshot at kernel loading time with HVM vm
  2010-05-19  6:44   ` James (song wei)
@ 2010-05-19  7:47     ` Keir Fraser
  0 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2010-05-19  7:47 UTC (permalink / raw)
  To: James (song wei), xen-devel

On 19/05/2010 07:44, "James (song wei)" <jsong@novell.com> wrote:

>>     Sorry for not descripting this issue clearly.  When I do save at the
>> beginning of HVM guest booting(first stage - loading kernel), I found
>> guest os destoryed after saving completely.

Well, that's expected isn't it? Normally, saving a guest should save its
state to a file and destroy the guest, so that the saved state can be safely
resumed later.

>> So I see the code and get this flow:
>> xc_save()( here, call this function, when loading the kernel at the time
>> of guest booting. Event channel haven't been initialized,so that go to
>> compat_suspend() path in suspend()(save.c) -->> then, notify  the thread
>> named saveInputHandler in xend with a string "suspend". so  that
>> dominfo.shutdown is invoked.

That's required. We need the guest to shutdown with state SHUTDOWN_suspend,
so that we can save a consistent snapshot of its state. If you skip the
shutdown then you break domain save in the absence of PV drivers. It will be
broken because the guest will continue to run while xc_save does its work --
hence it will not save a consistent snapshot of the guest state.

 -- Keir

>> So, VM shutdown after do saving operator.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-19  7:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-17  5:57 [PATCH] fix save or snapshot at kernel loading time with HVM vm James (song wei)
2010-05-17 10:03 ` Keir Fraser
2010-05-19  6:44   ` James (song wei)
2010-05-19  7:47     ` Keir Fraser

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.