mirror of https://github.com/xemu-project/xemu.git
target-i386: Do not allow to set apic-id once CPU is realized
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
310509304e
commit
8d6d4980c9
|
@ -1284,11 +1284,18 @@ static void x86_cpuid_set_apic_id(Object *obj, Visitor *v, void *opaque,
|
||||||
const char *name, Error **errp)
|
const char *name, Error **errp)
|
||||||
{
|
{
|
||||||
X86CPU *cpu = X86_CPU(obj);
|
X86CPU *cpu = X86_CPU(obj);
|
||||||
|
DeviceState *dev = DEVICE(obj);
|
||||||
const int64_t min = 0;
|
const int64_t min = 0;
|
||||||
const int64_t max = UINT32_MAX;
|
const int64_t max = UINT32_MAX;
|
||||||
Error *error = NULL;
|
Error *error = NULL;
|
||||||
int64_t value;
|
int64_t value;
|
||||||
|
|
||||||
|
if (dev->realized) {
|
||||||
|
error_setg(errp, "Attempt to set property '%s' on '%s' after "
|
||||||
|
"it was realized", name, object_get_typename(obj));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
visit_type_int(v, &value, name, &error);
|
visit_type_int(v, &value, name, &error);
|
||||||
if (error) {
|
if (error) {
|
||||||
error_propagate(errp, error);
|
error_propagate(errp, error);
|
||||||
|
|
Loading…
Reference in New Issue