From: Glauber Costa Subject: [PATCH] remove tests of user memory from vl.c Date: Mon, 8 Sep 2008 16:30:11 -0300 Message-ID: <1220902221-7536-3-git-send-email-gcosta@redhat.com> References: <1220902221-7536-1-git-send-email-gcosta@redhat.com> <1220902221-7536-2-git-send-email-gcosta@redhat.com> Cc: avi@qumranet.com, aliguori@us.ibm.com, Glauber Costa To: kvm@vger.kernel.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:58734 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753629AbYIHThk (ORCPT ); Mon, 8 Sep 2008 15:37:40 -0400 In-Reply-To: <1220902221-7536-2-git-send-email-gcosta@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Glauber Costa kvm_qemu_create_context() will fail if we don't have userspace memory capability, so no need to check it here. Signed-off-by: Glauber Costa --- qemu/vl.c | 18 +++++------------- 1 files changed, 5 insertions(+), 13 deletions(-) diff --git a/qemu/vl.c b/qemu/vl.c index b34a114..25a1ee9 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -9934,20 +9934,12 @@ int main(int argc, char **argv) fprintf(stderr, "Could not create KVM context\n"); exit(1); } -#ifdef KVM_CAP_USER_MEMORY -{ - int ret; - ret = kvm_qemu_check_extension(KVM_CAP_USER_MEMORY); - if (ret) { - phys_ram_base = qemu_alloc_physram(phys_ram_size); - if (!phys_ram_base) { - fprintf(stderr, "Could not allocate physical memory\n"); - exit(1); - } - } -} -#endif + phys_ram_base = qemu_alloc_physram(phys_ram_size); + if (!phys_ram_base) { + fprintf(stderr, "Could not allocate physical memory\n"); + exit(1); + } } else { phys_ram_base = qemu_vmalloc(phys_ram_size); if (!phys_ram_base) { -- 1.5.5.1