mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
conf: Avoid extra scope when formatting 'smm' feature
Use an early break and remove the temporary variable. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d1164bfdca
commit
c7637521d6
@ -27814,27 +27814,26 @@ virDomainDefFormatFeatures(virBufferPtr buf,
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_FEATURE_SMM:
|
||||
if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||
virTristateSwitch state = def->features[i];
|
||||
if (def->features[i] == VIR_TRISTATE_SWITCH_ABSENT)
|
||||
break;
|
||||
|
||||
virBufferAsprintf(&tmpAttrBuf, " state='%s'",
|
||||
virTristateSwitchTypeToString(state));
|
||||
virBufferAsprintf(&tmpAttrBuf, " state='%s'",
|
||||
virTristateSwitchTypeToString(def->features[i]));
|
||||
|
||||
if (state == VIR_TRISTATE_SWITCH_ON &&
|
||||
def->tseg_specified) {
|
||||
const char *unit;
|
||||
unsigned long long short_size = virFormatIntPretty(def->tseg_size,
|
||||
&unit);
|
||||
if (def->features[i] == VIR_TRISTATE_SWITCH_ON &&
|
||||
def->tseg_specified) {
|
||||
const char *unit;
|
||||
unsigned long long short_size = virFormatIntPretty(def->tseg_size,
|
||||
&unit);
|
||||
|
||||
virBufferSetChildIndent(&tmpChildBuf, buf);
|
||||
virBufferAsprintf(&tmpChildBuf, "<tseg unit='%s'>%llu</tseg>\n",
|
||||
unit, short_size);
|
||||
}
|
||||
|
||||
if (virXMLFormatElement(buf, "smm", &tmpAttrBuf, &tmpChildBuf) < 0)
|
||||
return -1;
|
||||
virBufferSetChildIndent(&tmpChildBuf, buf);
|
||||
virBufferAsprintf(&tmpChildBuf, "<tseg unit='%s'>%llu</tseg>\n",
|
||||
unit, short_size);
|
||||
}
|
||||
|
||||
if (virXMLFormatElement(buf, "smm", &tmpAttrBuf, &tmpChildBuf) < 0)
|
||||
return -1;
|
||||
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_FEATURE_APIC:
|
||||
|
Loading…
x
Reference in New Issue
Block a user