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 From: Eduardo Habkost 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> Subject: [Qemu-devel] [PULL 04/15] osdep: Move default qemu_hw_version() value to a macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel@nongnu.org, Paolo Bonzini , Richard Henderson 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) { -- 2.5.5