Commit 93bfef4c authored by Crístian Viana's avatar Crístian Viana Committed by Anthony Liguori
Browse files

Allow machines to configure the QEMU_VERSION that's exposed via hardware



QEMU exposes its version to the guest's hardware and in some cases that is wrong
(e.g. Windows prints messages about driver updates when you switch
the QEMU version).
There is a new field now on the struct QEmuMachine, hw_version, which may
contain the version that the specific machine should report. If that field is
set, then that machine will report that version to the guest.

Signed-off-by: default avatarCrístian Viana <vianac@linux.vnet.ibm.com>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent 459ae5ea
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ typedef struct QEMUMachine {
    const char *default_machine_opts;
    GlobalProperty *compat_props;
    struct QEMUMachine *next;
    const char *hw_version;
} QEMUMachine;

int qemu_register_machine(QEMUMachine *m);
+3 −3
Original line number Diff line number Diff line
@@ -834,7 +834,7 @@ SERVICE(hid,
    ATTRIBUTE(DOC_URL,         URL("http://bellard.org/qemu/user-doc.html"))
    ATTRIBUTE(SVCNAME_PRIMARY, STRING("QEMU Bluetooth HID"))
    ATTRIBUTE(SVCDESC_PRIMARY, STRING("QEMU Keyboard/Mouse"))
    ATTRIBUTE(SVCPROV_PRIMARY, STRING("QEMU " QEMU_VERSION))
    ATTRIBUTE(SVCPROV_PRIMARY, STRING("QEMU"))

    /* Profile specific */
    ATTRIBUTE(DEVICE_RELEASE_NUMBER,	UINT16(0x0091)) /* Deprecated, remove */
@@ -908,7 +908,7 @@ SERVICE(sdp,
        LIST(UUID128(SDP_SERVER_PROFILE_ID) UINT16(0x0100))
    ))
    ATTRIBUTE(DOC_URL,         URL("http://bellard.org/qemu/user-doc.html"))
    ATTRIBUTE(SVCPROV_PRIMARY, STRING("QEMU " QEMU_VERSION))
    ATTRIBUTE(SVCPROV_PRIMARY, STRING("QEMU"))

    /* Profile specific */
    ATTRIBUTE(VERSION_NUM_LIST, LIST(UINT16(0x0100)))
@@ -931,7 +931,7 @@ SERVICE(pnp,
        LIST(UUID128(PNP_INFO_PROFILE_ID) UINT16(0x0100))
    ))
    ATTRIBUTE(DOC_URL,         URL("http://bellard.org/qemu/user-doc.html"))
    ATTRIBUTE(SVCPROV_PRIMARY, STRING("QEMU " QEMU_VERSION))
    ATTRIBUTE(SVCPROV_PRIMARY, STRING("QEMU"))

    /* Profile specific */
    ATTRIBUTE(SPECIFICATION_ID, UINT16(0x0100))
+1 −1
Original line number Diff line number Diff line
@@ -1995,7 +1995,7 @@ int ide_init_drive(IDEState *s, BlockDriverState *bs, IDEDriveKind kind,
    if (version) {
        pstrcpy(s->version, sizeof(s->version), version);
    } else {
        pstrcpy(s->version, sizeof(s->version), QEMU_VERSION);
        pstrcpy(s->version, sizeof(s->version), qemu_get_version());
    }

    ide_reset(s);
+2 −1
Original line number Diff line number Diff line
@@ -1247,7 +1247,8 @@ static int n8x0_atag_setup(void *p, int model)
    stw_raw(w ++, 24);				/* u16 len */
    strcpy((void *) w, "hw-build");		/* char component[12] */
    w += 6;
    strcpy((void *) w, "QEMU " QEMU_VERSION);	/* char version[12] */
    strcpy((void *) w, "QEMU ");
    pstrcat((void *) w, 12, qemu_get_version()); /* char version[12] */
    w += 6;

    tag = (model == 810) ? "1.1.10-qemu" : "1.1.6-qemu";
+9 −2
Original line number Diff line number Diff line
@@ -390,6 +390,7 @@ static QEMUMachine pc_machine_v1_0 = {
        PC_COMPAT_1_0,
        { /* end of list */ }
    },
    .hw_version = "1.0",
};

#define PC_COMPAT_0_15 \
@@ -404,6 +405,7 @@ static QEMUMachine pc_machine_v0_15 = {
        PC_COMPAT_0_15,
        { /* end of list */ }
    },
    .hw_version = "0.15",
};

#define PC_COMPAT_0_14 \
@@ -444,6 +446,7 @@ static QEMUMachine pc_machine_v0_14 = {
        },
        { /* end of list */ }
    },
    .hw_version = "0.14",
};

#define PC_COMPAT_0_13 \
@@ -480,6 +483,7 @@ static QEMUMachine pc_machine_v0_13 = {
        },
        { /* end of list */ }
    },
    .hw_version = "0.13",
};

#define PC_COMPAT_0_12 \
@@ -511,7 +515,8 @@ static QEMUMachine pc_machine_v0_12 = {
            .value    = stringify(0),
        },
        { /* end of list */ }
    }
    },
    .hw_version = "0.12",
};

#define PC_COMPAT_0_11 \
@@ -543,7 +548,8 @@ static QEMUMachine pc_machine_v0_11 = {
            .value    = "0.11",
        },
        { /* end of list */ }
    }
    },
    .hw_version = "0.11",
};

static QEMUMachine pc_machine_v0_10 = {
@@ -576,6 +582,7 @@ static QEMUMachine pc_machine_v0_10 = {
        },
        { /* end of list */ }
    },
    .hw_version = "0.10",
};

static QEMUMachine isapc_machine = {
Loading