[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/15] osdep: Move default qemu_hw_version() value to
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 04/15] osdep: Move default qemu_hw_version() value to a macro |
Date: |
Mon, 23 May 2016 16:24:16 -0300 |
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 <address@hidden>
---
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
- [Qemu-devel] [PULL 00/15] X86 queue, 2016-05-23, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 04/15] osdep: Move default qemu_hw_version() value to a macro,
Eduardo Habkost <=
- [Qemu-devel] [PULL 01/15] target-i386: Define structs for layout of xsave area, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 02/15] target-i386: Use xsave structs for ext_save_area, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 05/15] pc: Set CPU model-id on compat_props for pc <= 2.4, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 03/15] target-i386: kvm: Use X86XSaveArea struct for xsave save/load, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 10/15] target-i386: Call cpu_exec_init() on realize, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 11/15] target-i386: kvm: Allocate kvm_msrs struct once per VCPU, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 06/15] target-i386: Set constant model_id for qemu63/qemu32/athlon, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 07/15] cpu: Eliminate cpudef_init(), cpudef_setup(), Eduardo Habkost, 2016/05/23