From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Andreas Färber" <afaerber@suse.de>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>
Subject: [Qemu-devel] [PATCH for-2.7 1/4] osdep: Move default qemu_hw_version() value to a macro
Date: Sat, 9 Apr 2016 17:37:44 -0300 [thread overview]
Message-ID: <1460234267-20523-2-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1460234267-20523-1-git-send-email-ehabkost@redhat.com>
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 <ehabkost@redhat.com>
---
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 408783f..1ad2fcb 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -298,6 +298,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 compatibilty.
* 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.1.0
next prev parent reply other threads:[~2016-04-09 20:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-09 20:37 [Qemu-devel] [PATCH for-2.7 0/4] cpu: Finally remove cpudef_init() Eduardo Habkost
2016-04-09 20:37 ` Eduardo Habkost [this message]
2016-04-09 20:37 ` [Qemu-devel] [PATCH for-2.7 2/4] pc: Set CPU model-id on compat_props for pc <= 2.4 Eduardo Habkost
2016-05-10 15:37 ` Michael S. Tsirkin
2016-04-09 20:37 ` [Qemu-devel] [PATCH for-2.7 3/4] target-i386: Set constant model_id for qemu63/qemu32/athlon Eduardo Habkost
2016-04-09 20:37 ` [Qemu-devel] [PATCH for-2.7 4/4] cpu: Eliminate cpudef_init(), cpudef_setup() Eduardo Habkost
2016-05-11 19:21 ` [Qemu-devel] [PATCH for-2.7 0/4] cpu: Finally remove cpudef_init() Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1460234267-20523-2-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=afaerber@suse.de \
--cc=imammedo@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).