mirror of
https://github.com/qemu/qemu.git
synced 2024-11-24 19:33:39 +08:00
osdep: Rename qemu_{get, set}_version() to qemu_{, set_}hw_version()
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> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <1446233769-7892-3-git-send-email-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
de796d93f5
commit
35c2c8dc8c
@ -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";
|
||||
|
@ -2312,7 +2312,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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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");
|
||||
|
@ -247,8 +247,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);
|
||||
|
@ -2243,7 +2243,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;
|
||||
}
|
||||
}
|
||||
|
10
util/osdep.c
10
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)
|
||||
|
Loading…
Reference in New Issue
Block a user