Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754237Ab2F0GxD (ORCPT ); Wed, 27 Jun 2012 02:53:03 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:16765 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751903Ab2F0GxB (ORCPT ); Wed, 27 Jun 2012 02:53:01 -0400 X-IronPort-AV: E=Sophos;i="4.77,483,1336320000"; d="scan'208";a="5272438" Message-ID: <4FEAAED6.4040601@cn.fujitsu.com> Date: Wed, 27 Jun 2012 14:57:26 +0800 From: Wen Congyang User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100413 Fedora/3.0.4-2.fc13 Thunderbird/3.0.4 MIME-Version: 1.0 To: kvm list , qemu-devel , "linux-kernel@vger.kernel.org" , Avi Kivity , "Daniel P. Berrange" , KAMEZAWA Hiroyuki , Jan Kiszka , Gleb Natapov Subject: [PATCH 1/6 v5] start vm after reseting it References: <4FEAAE6E.7070302@cn.fujitsu.com> In-Reply-To: <4FEAAE6E.7070302@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/06/27 14:53:10, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/06/27 14:53:11, Serialize complete at 2012/06/27 14:53:11 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1707 Lines: 58 The guest should run after reseting it, but it does not run if its old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED. Signed-off-by: Wen Congyang --- block.h | 2 ++ qmp.c | 2 +- vl.c | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/block.h b/block.h index d135652..d9570dd 100644 --- a/block.h +++ b/block.h @@ -365,6 +365,8 @@ void bdrv_disable_copy_on_read(BlockDriverState *bs); void bdrv_set_in_use(BlockDriverState *bs, int in_use); int bdrv_in_use(BlockDriverState *bs); +void iostatus_bdrv_it(void *opaque, BlockDriverState *bs); + enum BlockAcctType { BDRV_ACCT_READ, BDRV_ACCT_WRITE, diff --git a/qmp.c b/qmp.c index fee9fb2..a111dff 100644 --- a/qmp.c +++ b/qmp.c @@ -125,7 +125,7 @@ SpiceInfo *qmp_query_spice(Error **errp) }; #endif -static void iostatus_bdrv_it(void *opaque, BlockDriverState *bs) +void iostatus_bdrv_it(void *opaque, BlockDriverState *bs) { bdrv_iostatus_reset(bs); } diff --git a/vl.c b/vl.c index 1329c30..b38aa5f 100644 --- a/vl.c +++ b/vl.c @@ -1532,7 +1532,8 @@ static bool main_loop_should_exit(void) resume_all_vcpus(); if (runstate_check(RUN_STATE_INTERNAL_ERROR) || runstate_check(RUN_STATE_SHUTDOWN)) { - runstate_set(RUN_STATE_PAUSED); + bdrv_iterate(iostatus_bdrv_it, NULL); + vm_start(); } } if (qemu_powerdown_requested()) { -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/