From patchwork Sat Mar 9 06:48:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 2241191 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EE37E40276 for ; Sat, 9 Mar 2013 06:49:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932224Ab3CIGtE (ORCPT ); Sat, 9 Mar 2013 01:49:04 -0500 Received: from mail-ee0-f54.google.com ([74.125.83.54]:45604 "EHLO mail-ee0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932143Ab3CIGs7 (ORCPT ); Sat, 9 Mar 2013 01:48:59 -0500 Received: by mail-ee0-f54.google.com with SMTP id c41so1375518eek.27 for ; Fri, 08 Mar 2013 22:48:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=f2NYOTvRcYGpsvqAAQMV36Sp/7vpxz6PfY4h4s2fdSU=; b=tQM+pbv2a0Lcoy4Xfz2tcI5myedOgdcPoH3lmDGrbpeCVu4qqUfYqGZU2Zr98xZDSG J1X/XX2riXsucS0jg1x2Z+BYnArc9/WNUlPCpBswn2nNyrpn6RNjh9FqDSqEGYbqhqiO VvWhm4RgfJt4BnWO/3o/bXD6dHQjwocyQTCSV0Td3sJm4Db6YuWoqwaohOUvIp5n0GwL mWwzCMibH8hu5m5rcpieaD1iZLKJXc36OAtqt896eY/EqJgVUvwz+uw6pCw65H/GAdFW UFnI7o8l803w9XOs4KwAqxz6thdN1FQiFJu8Q3uSPxqY30zZBjWW/mQAoqwkPZq/tIaM do8g== X-Received: by 10.14.219.7 with SMTP id l7mr3972196eep.12.1362811738655; Fri, 08 Mar 2013 22:48:58 -0800 (PST) Received: from yakj.lan (93-34-176-20.ip50.fastwebnet.it. [93.34.176.20]) by mx.google.com with ESMTPS id 44sm11727906eek.5.2013.03.08.22.48.57 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 08 Mar 2013 22:48:57 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, gnatapov@redhat.com, mtosatti@redhat.com, jan.kiszka@siemens.com Subject: [PATCH uq/master 1/2] kvm: detect errors from kvm_arch_process_async_events Date: Sat, 9 Mar 2013 07:48:49 +0100 Message-Id: <1362811730-6716-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1362811730-6716-1-git-send-email-pbonzini@redhat.com> References: <1362811730-6716-1-git-send-email-pbonzini@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The next patch will call a ioctl from kvm_arch_process_async_events. Trap errors and abort the program if one comes. Signed-off-by: Paolo Bonzini --- kvm-all.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kvm-all.c b/kvm-all.c index 4decfdc..bc1534c 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1536,7 +1536,13 @@ int kvm_cpu_exec(CPUArchState *env) DPRINTF("kvm_cpu_exec()\n"); - if (kvm_arch_process_async_events(cpu)) { + ret = kvm_arch_process_async_events(cpu); + if (ret) { + if (ret < 0) { + fprintf(stderr, "error: kvm process events failed %s\n", + strerror(-ret)); + abort(); + } cpu->exit_request = 0; return EXCP_HLT; }