mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-01 06:27:16 +00:00
conf: Fix smm=off handling
We have to always store the state of the feature in the
virDomainDef struct, otherwise
<smm state='off'/>
will incorrectly be interpreted as if the <smm> element was not
present.
Fixes: eeb94215b0
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a6ea77e0a5
commit
b6705cdefb
@ -17676,8 +17676,12 @@ virDomainFeaturesDefParse(virDomainDef *def,
|
|||||||
VIR_XML_PROP_NONE, &state) < 0)
|
VIR_XML_PROP_NONE, &state) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if ((state == VIR_TRISTATE_SWITCH_ABSENT) ||
|
if (state == VIR_TRISTATE_SWITCH_ABSENT)
|
||||||
(state == VIR_TRISTATE_SWITCH_ON)) {
|
state = VIR_TRISTATE_SWITCH_ON;
|
||||||
|
|
||||||
|
def->features[val] = state;
|
||||||
|
|
||||||
|
if (state == VIR_TRISTATE_SWITCH_ON) {
|
||||||
int rv = virParseScaledValue("string(./features/smm/tseg)",
|
int rv = virParseScaledValue("string(./features/smm/tseg)",
|
||||||
"string(./features/smm/tseg/@unit)",
|
"string(./features/smm/tseg/@unit)",
|
||||||
ctxt,
|
ctxt,
|
||||||
@ -17688,7 +17692,6 @@ virDomainFeaturesDefParse(virDomainDef *def,
|
|||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
def->features[val] = VIR_TRISTATE_SWITCH_ON;
|
|
||||||
def->tseg_specified = rv != 0;
|
def->tseg_specified = rv != 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
|
|||||||
-name guest=QEMUGuest1,debug-threads=on \
|
-name guest=QEMUGuest1,debug-threads=on \
|
||||||
-S \
|
-S \
|
||||||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \
|
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \
|
||||||
-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram \
|
-machine q35,usb=off,smm=off,dump-guest-core=off,memory-backend=pc.ram \
|
||||||
-accel tcg \
|
-accel tcg \
|
||||||
-cpu qemu64 \
|
-cpu qemu64 \
|
||||||
-m 214 \
|
-m 214 \
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
<type arch='x86_64' machine='q35'>hvm</type>
|
<type arch='x86_64' machine='q35'>hvm</type>
|
||||||
<boot dev='hd'/>
|
<boot dev='hd'/>
|
||||||
</os>
|
</os>
|
||||||
|
<features>
|
||||||
|
<smm state='off'/>
|
||||||
|
</features>
|
||||||
<cpu mode='custom' match='exact' check='none'>
|
<cpu mode='custom' match='exact' check='none'>
|
||||||
<model fallback='forbid'>qemu64</model>
|
<model fallback='forbid'>qemu64</model>
|
||||||
</cpu>
|
</cpu>
|
||||||
|
Loading…
Reference in New Issue
Block a user