From patchwork Wed Dec 16 09:00:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 557357 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9EDD71402A0 for ; Wed, 16 Dec 2015 20:01:15 +1100 (AEDT) Received: from localhost ([::1]:46058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a97xR-0001sZ-7l for incoming@patchwork.ozlabs.org; Wed, 16 Dec 2015 04:01:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a97xC-0001bs-Dc for qemu-devel@nongnu.org; Wed, 16 Dec 2015 04:00:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a97x9-0002Nl-3K for qemu-devel@nongnu.org; Wed, 16 Dec 2015 04:00:58 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:27413 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a97x8-0002NW-Km for qemu-devel@nongnu.org; Wed, 16 Dec 2015 04:00:55 -0500 Received: from hades.sw.ru ([10.30.8.132]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id tBG90nxN031023; Wed, 16 Dec 2015 12:00:50 +0300 (MSK) From: "Denis V. Lunev" To: Date: Wed, 16 Dec 2015 12:00:49 +0300 Message-Id: <1450256449-23779-1-git-send-email-den@openvz.org> X-Mailer: git-send-email 2.5.0 X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Cc: "Denis V. Lunev" , qemu-devel@nongnu.org, Dmitry Andreev , Markus Armbruster Subject: [Qemu-devel] [PATCH 1/1] qmp: process system-reset event in paused state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org With pvpanic or HyperV panic devices could be moved into the paused state with ' preserve'. In this state VM reacts only to 'virsh destroy' or 'continue'. 'virsh reset' command is usually used to force guest reset. The expectation of the behavior of this command is that the guest will be force restarted. This is not true at the moment. Thus it is quite natural to process 'virh reset' aka qmp_system_reset this way, i.e. allow to reset the guest. This behavior is similar to one observed with 'reset' button on real hardware :) Signed-off-by: Denis V. Lunev CC: Markus Armbruster CC: Dmitry Andreev --- qmp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qmp.c b/qmp.c index 0a1fa19..df17a33 100644 --- a/qmp.c +++ b/qmp.c @@ -112,6 +112,10 @@ void qmp_stop(Error **errp) void qmp_system_reset(Error **errp) { qemu_system_reset_request(); + + if (!runstate_is_running()) { + vm_start(); + } } void qmp_system_powerdown(Error **erp)