From: John Snow <jsnow@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Laszlo Ersek <lersek@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Marcel Apfelbaum <marcel.a@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/3] osdep: Rename qemu_{get, set}_version() to qemu_{, set_}hw_version()
Date: Tue, 22 Sep 2015 16:21:47 -0400 [thread overview]
Message-ID: <5601B85B.2070408@redhat.com> (raw)
In-Reply-To: <1442952987-20187-3-git-send-email-ehabkost@redhat.com>
On 09/22/2015 04:16 PM, Eduardo Habkost wrote:
> This makes the purpose of the function clearer: it is not about the
> version of QEMU that's running, but the version string exposed in the
> emulated hardware.
>
> Cc: Andrzej Zaborowski <balrogg@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: John Snow <jsnow@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> hw/arm/nseries.c | 2 +-
> hw/ide/core.c | 2 +-
> hw/scsi/scsi-bus.c | 2 +-
> hw/scsi/scsi-disk.c | 2 +-
> include/qemu/osdep.h | 4 ++--
> target-i386/cpu.c | 2 +-
> util/osdep.c | 10 +++++-----
> vl.c | 2 +-
> 8 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
> index a659e85..ce05ffc 100644
> --- a/hw/arm/nseries.c
> +++ b/hw/arm/nseries.c
> @@ -1275,7 +1275,7 @@ static int n8x0_atag_setup(void *p, int model)
> strcpy((void *) w, "hw-build"); /* char component[12] */
> w += 6;
> strcpy((void *) w, "QEMU ");
> - pstrcat((void *) w, 12, qemu_get_version()); /* char version[12] */
> + pstrcat((void *) w, 12, qemu_hw_version()); /* char version[12] */
> w += 6;
>
> tag = (model == 810) ? "1.1.10-qemu" : "1.1.6-qemu";
> diff --git a/hw/ide/core.c b/hw/ide/core.c
> index 50449ca..c503c69 100644
> --- a/hw/ide/core.c
> +++ b/hw/ide/core.c
> @@ -2313,7 +2313,7 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDEDriveKind kind,
> if (version) {
> pstrcpy(s->version, sizeof(s->version), version);
> } else {
> - pstrcpy(s->version, sizeof(s->version), qemu_get_version());
> + pstrcpy(s->version, sizeof(s->version), qemu_hw_version());
> }
>
> ide_reset(s);
> diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
> index ffac8f4..3997007 100644
> --- a/hw/scsi/scsi-bus.c
> +++ b/hw/scsi/scsi-bus.c
> @@ -453,7 +453,7 @@ static bool scsi_target_emulate_inquiry(SCSITargetReq *r)
> r->buf[7] = 0x10 | (r->req.bus->info->tcq ? 0x02 : 0); /* Sync, TCQ. */
> memcpy(&r->buf[8], "QEMU ", 8);
> memcpy(&r->buf[16], "QEMU TARGET ", 16);
> - pstrcpy((char *) &r->buf[32], 4, qemu_get_version());
> + pstrcpy((char *) &r->buf[32], 4, qemu_hw_version());
> }
> return true;
> }
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index bada9a7..707e734 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -2315,7 +2315,7 @@ static void scsi_realize(SCSIDevice *dev, Error **errp)
> }
>
> if (!s->version) {
> - s->version = g_strdup(qemu_get_version());
> + s->version = g_strdup(qemu_hw_version());
> }
> if (!s->vendor) {
> s->vendor = g_strdup("QEMU");
> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> index ab3c876..b4ee266 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -243,8 +243,8 @@ static inline void qemu_timersub(const struct timeval *val1,
>
> void qemu_set_cloexec(int fd);
>
> -void qemu_set_version(const char *);
> -const char *qemu_get_version(void);
> +void qemu_set_hw_version(const char *);
> +const char *qemu_hw_version(void);
>
> void fips_set_state(bool requested);
> bool fips_get_state(void);
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 7c52714..f9284d5 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -2231,7 +2231,7 @@ void x86_cpudef_setup(void)
> pstrcpy(def->model_id, sizeof(def->model_id),
> "QEMU Virtual CPU version ");
> pstrcat(def->model_id, sizeof(def->model_id),
> - qemu_get_version());
> + qemu_hw_version());
> break;
> }
> }
> diff --git a/util/osdep.c b/util/osdep.c
> index 0092bb6..80c6bfe 100644
> --- a/util/osdep.c
> +++ b/util/osdep.c
> @@ -52,7 +52,7 @@ extern int madvise(caddr_t, size_t, int);
>
> static bool fips_enabled = false;
>
> -static const char *qemu_version = QEMU_VERSION;
> +static const char *hw_version = QEMU_VERSION;
>
> int socket_set_cork(int fd, int v)
> {
> @@ -311,14 +311,14 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
> return ret;
> }
>
> -void qemu_set_version(const char *version)
> +void qemu_set_hw_version(const char *version)
> {
> - qemu_version = version;
> + hw_version = version;
> }
>
> -const char *qemu_get_version(void)
> +const char *qemu_hw_version(void)
> {
> - return qemu_version;
> + return hw_version;
> }
>
> void fips_set_state(bool requested)
> diff --git a/vl.c b/vl.c
> index 3c6480d..204fb08 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -4078,7 +4078,7 @@ int main(int argc, char **argv, char **envp)
> cpu_exec_init_all();
>
> if (machine_class->hw_version) {
> - qemu_set_version(machine_class->hw_version);
> + qemu_set_hw_version(machine_class->hw_version);
> }
>
> /* Init CPU def lists, based on config
>
Reviewed-by: John Snow <jsnow@redhat.com>
next prev parent reply other threads:[~2015-09-22 20:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 20:16 [Qemu-devel] [PATCH 0/3] pc: Set hw_version on all machine classes Eduardo Habkost
2015-09-22 20:16 ` [Qemu-devel] [PATCH 1/3] " Eduardo Habkost
2015-09-22 20:26 ` Laszlo Ersek
2015-09-22 20:34 ` Eduardo Habkost
2015-09-22 20:16 ` [Qemu-devel] [PATCH 2/3] osdep: Rename qemu_{get, set}_version() to qemu_{, set_}hw_version() Eduardo Habkost
2015-09-22 20:21 ` John Snow [this message]
2015-09-22 20:16 ` [Qemu-devel] [PATCH 3/3] megasas: Use qemu_hw_version() instead of QEMU_VERSION Eduardo Habkost
2015-09-22 20:21 ` Hannes Reinecke
2015-09-22 20:33 ` Laszlo Ersek
2015-09-22 20:36 ` Eduardo Habkost
2015-09-23 8:04 ` [Qemu-devel] [PATCH 0/3] pc: Set hw_version on all machine classes Igor Mammedov
2015-09-23 10:37 ` Laszlo Ersek
2015-09-23 11:47 ` Igor Mammedov
2015-09-23 12:31 ` Laszlo Ersek
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=5601B85B.2070408@redhat.com \
--to=jsnow@redhat.com \
--cc=ehabkost@redhat.com \
--cc=lersek@redhat.com \
--cc=marcel.a@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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).