qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Suggestion - trap window-close of VM
@ 2004-11-29 20:43 Richard Neill
  2004-11-29 20:46 ` Lennert Buytenhek
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Neill @ 2004-11-29 20:43 UTC (permalink / raw)
  To: qemu-devel

Dear All,

A thought that occurred to me. If one is running a virtual machine (eg 
copy of WinXP), then simply closing the qemu window is a really bad 
idea, since it will effectively crash the guest.

BUT, given that the user expects to be running an *application* rather 
than an operating system, the natural thing to do is to close the qemu 
window, rather than remembering to first do a full shutdown of the 
guest. This is a very easy mistake to make.

I'd suggest that:

if ((qemu's window is closed from the GUI) and (the guest has not shut 
down)); then
	qemu should pop up a warning dialog:
		"Are you sure you want to quit - you should really shut
	down the guest first, or you may suffer dataloss [yes] [no]"
fi


Is it possible to know whether the guest has finished shutting down from 
the CPU state?


Regards

Richard

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

* Re: [Qemu-devel] Suggestion - trap window-close of VM
  2004-11-29 20:43 [Qemu-devel] Suggestion - trap window-close of VM Richard Neill
@ 2004-11-29 20:46 ` Lennert Buytenhek
  0 siblings, 0 replies; 6+ messages in thread
From: Lennert Buytenhek @ 2004-11-29 20:46 UTC (permalink / raw)
  To: qemu-devel

On Mon, Nov 29, 2004 at 08:43:56PM +0000, Richard Neill wrote:

> Dear All,

Hi,


> A thought that occurred to me. If one is running a virtual machine (eg 
> copy of WinXP), then simply closing the qemu window is a really bad 
> idea, since it will effectively crash the guest.

Related thought -- it would be way cool if we could make killing qemu
do exactly happens when you press the power button on an ACPI-capable
machine with any recent OS on it (auto shutdown.)


--L

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

* Re: [Qemu-devel] Suggestion - trap window-close of VM
@ 2005-03-27  3:49 Ryan Rempel
  2005-03-27 18:30 ` Struan Bartlett
  2005-03-28 15:04 ` Mark Williamson
  0 siblings, 2 replies; 6+ messages in thread
From: Ryan Rempel @ 2005-03-27  3:49 UTC (permalink / raw)
  To: qemu-devel

On Mon, Nov 29, 2004 at 21:46:54 +0100, Lennert Buytenhek wrote

>On Mon, Nov 29, 2004 at 08:43:56PM +0000, Richard Neill wrote:
>
>> A thought that occurred to me. If one is running a virtual machine (eg 
>> copy of WinXP), then simply closing the qemu window is a really bad 
>> idea, since it will effectively crash the guest.
>
>Related thought -- it would be way cool if we could make killing qemu
>do exactly happens when you press the power button on an ACPI-capable
>machine with any recent OS on it (auto shutdown.)

I was wondering if anyone has followed up on this suggestion. I'm
putting together a Qemu-based setup for some relatively naive users,
and ideally I'd like to be able to deal with this in a reasonable
elegant way (the ACPI hook sounds very elegant indeed).

Alternatively, how do people deal with the problem of naive users who
might just close the Qemu window without shutting down the guest
properly? I'm working in a KDE environment -- perhaps there is a way
in KDE to prevent the close button from appearing? But that wouldn't
catch every case either (for instance, if the user were to shut down
the host).

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

* Re: [Qemu-devel] Suggestion - trap window-close of VM
  2005-03-27  3:49 Ryan Rempel
@ 2005-03-27 18:30 ` Struan Bartlett
  2005-03-28 15:04 ` Mark Williamson
  1 sibling, 0 replies; 6+ messages in thread
From: Struan Bartlett @ 2005-03-27 18:30 UTC (permalink / raw)
  To: Ryan Rempel, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1487 bytes --]

Ryan Rempel wrote:

>On Mon, Nov 29, 2004 at 21:46:54 +0100, Lennert Buytenhek wrote
>  
>
>>On Mon, Nov 29, 2004 at 08:43:56PM +0000, Richard Neill wrote:
>>    
>>
>>>A thought that occurred to me. If one is running a virtual machine (eg 
>>>copy of WinXP), then simply closing the qemu window is a really bad 
>>>idea, since it will effectively crash the guest.
>>>      
>>>
>>Related thought -- it would be way cool if we could make killing qemu
>>do exactly happens when you press the power button on an ACPI-capable
>>machine with any recent OS on it (auto shutdown.)
>>    
>>
>I was wondering if anyone has followed up on this suggestion. I'm
>putting together a Qemu-based setup for some relatively naive users,
>and ideally I'd like to be able to deal with this in a reasonable
>elegant way (the ACPI hook sounds very elegant indeed).
>
>Alternatively, how do people deal with the problem of naive users who
>might just close the Qemu window without shutting down the guest
>properly? I'm working in a KDE environment -- perhaps there is a way
>in KDE to prevent the close button from appearing? But that wouldn't
>catch every case either (for instance, if the user were to shut down
>the host).
>
This sounds like a good idea. An alternative solution, that might be 
more straightforward to implement if Qemu doesn't implement ACPI yet, 
would be for the kill signal to simply cause Qemu to do the equivalent 
of entering 'stop' and 'savevm <somefilepath>' into the monitor.

[-- Attachment #2: Type: text/html, Size: 1977 bytes --]

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

* Re: [Qemu-devel] Suggestion - trap window-close of VM
  2005-03-27  3:49 Ryan Rempel
  2005-03-27 18:30 ` Struan Bartlett
@ 2005-03-28 15:04 ` Mark Williamson
  2005-03-28 19:13   ` Joshua Kugler
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Williamson @ 2005-03-28 15:04 UTC (permalink / raw)
  To: qemu-devel, Ryan Rempel

> Alternatively, how do people deal with the problem of naive users who
> might just close the Qemu window without shutting down the guest
> properly? I'm working in a KDE environment -- perhaps there is a way
> in KDE to prevent the close button from appearing? But that wouldn't
> catch every case either (for instance, if the user were to shut down
> the host).

Doesn't X allow a handler to be called for events like window closing?  You 
could use this to pop up a "You've asked to close this VM.  Kill, save or 
cancel?" message and allow the user to choose the appropriate option.

$0.02,
Mark

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

* Re: [Qemu-devel] Suggestion - trap window-close of VM
  2005-03-28 15:04 ` Mark Williamson
@ 2005-03-28 19:13   ` Joshua Kugler
  0 siblings, 0 replies; 6+ messages in thread
From: Joshua Kugler @ 2005-03-28 19:13 UTC (permalink / raw)
  To: qemu-devel

On Monday 28 March 2005 06:04, Mark Williamson wrote:
> > Alternatively, how do people deal with the problem of naive users who
> > might just close the Qemu window without shutting down the guest
> > properly? I'm working in a KDE environment -- perhaps there is a way
> > in KDE to prevent the close button from appearing? But that wouldn't
> > catch every case either (for instance, if the user were to shut down
> > the host).
>
> Doesn't X allow a handler to be called for events like window closing?  You
> could use this to pop up a "You've asked to close this VM.  Kill, save or
> cancel?" message and allow the user to choose the appropriate option.

Yes it does.  Try closing your mail window when composing a message, or 
closing open office with an unsaved document. They'll ask you if you want to 
save or discard changes.  VMWare asks you if you want to close the running 
system if you try to use the close window command.  So yes, you can trap 
that.

j----- k-----

-- 
Joshua Kugler
CDE System Administrator
http://distance.uaf.edu/

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

end of thread, other threads:[~2005-03-28 19:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-29 20:43 [Qemu-devel] Suggestion - trap window-close of VM Richard Neill
2004-11-29 20:46 ` Lennert Buytenhek
  -- strict thread matches above, loose matches on Subject: below --
2005-03-27  3:49 Ryan Rempel
2005-03-27 18:30 ` Struan Bartlett
2005-03-28 15:04 ` Mark Williamson
2005-03-28 19:13   ` Joshua Kugler

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).