qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/5] disk_deadlines: add request to resume Virtu


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 2/5] disk_deadlines: add request to resume Virtual Machine
Date: Mon, 14 Sep 2015 17:46:18 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Sep 10, 2015 at 10:18:32PM +0300, Denis V. Lunev wrote:
> On 09/10/2015 11:51 AM, Stefan Hajnoczi wrote:
> >On Tue, Sep 08, 2015 at 11:00:25AM +0300, Denis V. Lunev wrote:
> >>From: Raushaniya Maksudova <address@hidden>
> >>
> >>In some cases one needs to pause and resume a Virtual Machine from inside
> >>of Qemu. Currently there are request functions to pause VM (vmstop), but
> >>there are no respective ones to resume VM.
> >>
> >>Signed-off-by: Raushaniya Maksudova <address@hidden>
> >>Signed-off-by: Denis V. Lunev <address@hidden>
> >>CC: Stefan Hajnoczi <address@hidden>
> >>CC: Kevin Wolf <address@hidden>
> >>CC: Paolo Bonzini <address@hidden>
> >>---
> >>  include/sysemu/sysemu.h |  1 +
> >>  stubs/vm-stop.c         |  5 +++++
> >>  vl.c                    | 18 ++++++++++++++++++
> >>  3 files changed, 24 insertions(+)
> >Why can't vm_start() be used?
> >
> 
> we do fear about correct thread to perform this operation.
> this code eventually redirect state changing code into
> main event loop.

The code isn't thread-safe though:

There is a race condition if qemu_vmstart_requested() is called while
qemu_vmstart_request() is called.  qemu_vmstart_requested() might return
false and the qemu_vmstart_request() is missed.

Please add doc comments to these functions explaining assumptions about
thread-safety and environment.

If the guest is resumed in an I/O completion handler function it
probably needs to be truly thread-safe.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]