From patchwork Mon Feb 8 11:45:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 8248971 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 86D2EBEEE5 for ; Mon, 8 Feb 2016 11:46:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01A13203B0 for ; Mon, 8 Feb 2016 11:46:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34F4C203AE for ; Mon, 8 Feb 2016 11:46:10 +0000 (UTC) Received: from localhost ([::1]:43792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSkGf-0008WB-Mp for patchwork-qemu-devel@patchwork.kernel.org; Mon, 08 Feb 2016 06:46:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSkGW-0008Vq-In for qemu-devel@nongnu.org; Mon, 08 Feb 2016 06:46:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSkGQ-0000xE-E0 for qemu-devel@nongnu.org; Mon, 08 Feb 2016 06:46:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSkGQ-0000xA-84 for qemu-devel@nongnu.org; Mon, 08 Feb 2016 06:45:54 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id C57AD5A48 for ; Mon, 8 Feb 2016 11:45:53 +0000 (UTC) Received: from work.redhat.com (vpn1-5-195.ams2.redhat.com [10.36.5.195]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u18BjpwR016075; Mon, 8 Feb 2016 06:45:52 -0500 From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Mon, 8 Feb 2016 13:45:51 +0200 Message-Id: <1454931951-25212-1-git-send-email-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: marcel@redhat.com, pbonzini@redhat.com, lersek@redhat.com Subject: [Qemu-devel] [PATCH] vl.c: remove duplicate call to qemu_get_machine_opts 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Also we can use current machine properties instead of querying machine's opts. Signed-off-by: Marcel Apfelbaum Reviewed-by: Laszlo Ersek --- vl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/vl.c b/vl.c index 5873248..c03a4fe 100644 --- a/vl.c +++ b/vl.c @@ -4353,11 +4353,10 @@ int main(int argc, char **argv, char **envp) qtest_init(qtest_chrdev, qtest_log, &error_fatal); } - machine_opts = qemu_get_machine_opts(); - kernel_filename = qemu_opt_get(machine_opts, "kernel"); - initrd_filename = qemu_opt_get(machine_opts, "initrd"); - kernel_cmdline = qemu_opt_get(machine_opts, "append"); - bios_name = qemu_opt_get(machine_opts, "firmware"); + kernel_filename = current_machine->kernel_filename; + initrd_filename = current_machine->initrd_filename; + kernel_cmdline = current_machine->kernel_cmdline; + bios_name = current_machine->firmware; opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL); if (opts) {