From patchwork Wed May 22 04:57:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 245505 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6EE982C00A1 for ; Wed, 22 May 2013 14:57:31 +1000 (EST) Received: from localhost ([::1]:56292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf17B-0005sJ-Es for incoming@patchwork.ozlabs.org; Wed, 22 May 2013 00:57:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf16w-0005sB-SG for qemu-devel@nongnu.org; Wed, 22 May 2013 00:57:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf16w-0005Gb-1o for qemu-devel@nongnu.org; Wed, 22 May 2013 00:57:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf16v-0005GS-QN for qemu-devel@nongnu.org; Wed, 22 May 2013 00:57:13 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4M4vBWM019671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 22 May 2013 00:57:12 -0400 Received: from dhcp-8-167.nay.redhat.com ([10.66.4.143]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4M4v7lO030256; Wed, 22 May 2013 00:57:08 -0400 From: Amos Kong To: gleb@redhat.com Date: Wed, 22 May 2013 12:57:35 +0800 Message-Id: <1369198655-25156-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH] kvm: add detail error message when fail to add ioeventfd 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 I try to hotplug 28 * 8 multiple-function devices to guest with old host kernel, ioeventfds in host kernel will be exhausted, then qemu fails to allocate ioeventfds for blk/nic devices. It's better to add detail error here. Signed-off-by: Amos Kong Reviewed-by: Stefan Hajnoczi --- kvm-all.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 8222729..3d5f7b7 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -813,6 +813,8 @@ static void kvm_mem_ioeventfd_add(MemoryListener *listener, r = kvm_set_ioeventfd_mmio(fd, section->offset_within_address_space, data, true, section->size, match_data); if (r < 0) { + fprintf(stderr, "%s: error adding ioeventfd: %s\n", + __func__, strerror(-r)); abort(); } } @@ -843,6 +845,8 @@ static void kvm_io_ioeventfd_add(MemoryListener *listener, r = kvm_set_ioeventfd_pio(fd, section->offset_within_address_space, data, true, section->size, match_data); if (r < 0) { + fprintf(stderr, "%s: error adding ioeventfd: %s\n", + __func__, strerror(-r)); abort(); } }