From patchwork Mon May 23 19:24:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9132307 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 14C246075F for ; Mon, 23 May 2016 19:26:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BED728246 for ; Mon, 23 May 2016 19:26:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00F2C2824E; Mon, 23 May 2016 19:26:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id A597828246 for ; Mon, 23 May 2016 19:26:14 +0000 (UTC) Received: from localhost ([::1]:49993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4vUT-0003ZE-OC for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 May 2016 15:26:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4vTT-0002zd-2j for qemu-devel@nongnu.org; Mon, 23 May 2016 15:25:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4vTR-0004wn-33 for qemu-devel@nongnu.org; Mon, 23 May 2016 15:25:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4vTQ-0004wS-Tq for qemu-devel@nongnu.org; Mon, 23 May 2016 15:25:09 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7547F85366; Mon, 23 May 2016 19:25:08 +0000 (UTC) Received: from localhost (vpn1-7-9.gru2.redhat.com [10.97.7.9]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4NJP7R6025662; Mon, 23 May 2016 15:25:07 -0400 From: Eduardo Habkost To: Peter Maydell Date: Mon, 23 May 2016 16:24:16 -0300 Message-Id: <1464031467-20736-5-git-send-email-ehabkost@redhat.com> In-Reply-To: <1464031467-20736-1-git-send-email-ehabkost@redhat.com> References: <1464031467-20736-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 23 May 2016 19:25:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/15] osdep: Move default qemu_hw_version() value to a macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The macro will be used by code that will stop calling qemu_hw_version() at runtime and just need a constant value. Signed-off-by: Eduardo Habkost --- include/qemu/osdep.h | 9 +++++++++ util/osdep.c | 9 +-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 994bfa0..6937694 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -327,6 +327,15 @@ static inline void qemu_timersub(const struct timeval *val1, void qemu_set_cloexec(int fd); +/* Starting on QEMU 2.5, qemu_hw_version() returns "2.5+" by default + * instead of QEMU_VERSION, so setting hw_version on MachineClass + * is no longer mandatory. + * + * Do NOT change this string, or it will break compatibility on all + * machine classes that don't set hw_version. + */ +#define QEMU_HW_VERSION "2.5+" + /* QEMU "hardware version" setting. Used to replace code that exposed * QEMU_VERSION to guests in the past and need to keep compatibility. * Do not use qemu_hw_version() in new code. diff --git a/util/osdep.c b/util/osdep.c index d56d071..9a7a439 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -44,14 +44,7 @@ extern int madvise(caddr_t, size_t, int); static bool fips_enabled = false; -/* Starting on QEMU 2.5, qemu_hw_version() returns "2.5+" by default - * instead of QEMU_VERSION, so setting hw_version on MachineClass - * is no longer mandatory. - * - * Do NOT change this string, or it will break compatibility on all - * machine classes that don't set hw_version. - */ -static const char *hw_version = "2.5+"; +static const char *hw_version = QEMU_HW_VERSION; int socket_set_cork(int fd, int v) {