mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
tests: qemuxml2xml: Simplify adding to the status XML expect string generator
Unindent the static XML block and move around the autoindent calls so that further additions don't have to add more of them. Also rename the string holding the static XML section.
This commit is contained in:
parent
cb1e4ca203
commit
41b28943da
@ -81,23 +81,23 @@ static const char testStatusXMLPrefixHeader[] =
|
|||||||
" <taint flag='high-privileges'/>\n"
|
" <taint flag='high-privileges'/>\n"
|
||||||
" <monitor path='/var/lib/libvirt/qemu/test.monitor' json='1' type='unix'/>\n";
|
" <monitor path='/var/lib/libvirt/qemu/test.monitor' json='1' type='unix'/>\n";
|
||||||
|
|
||||||
static const char testStatusXMLPrefixFooter[] =
|
static const char testStatusXMLPrefixBodyStatic[] =
|
||||||
" <qemuCaps>\n"
|
"<qemuCaps>\n"
|
||||||
" <flag name='vnet-hdr'/>\n"
|
" <flag name='vnet-hdr'/>\n"
|
||||||
" <flag name='qxl.vgamem_mb'/>\n"
|
" <flag name='qxl.vgamem_mb'/>\n"
|
||||||
" <flag name='qxl-vga.vgamem_mb'/>\n"
|
" <flag name='qxl-vga.vgamem_mb'/>\n"
|
||||||
" <flag name='pc-dimm'/>\n"
|
" <flag name='pc-dimm'/>\n"
|
||||||
" </qemuCaps>\n"
|
"</qemuCaps>\n"
|
||||||
" <devices>\n"
|
"<devices>\n"
|
||||||
" <device alias='balloon0'/>\n"
|
" <device alias='balloon0'/>\n"
|
||||||
" <device alias='video0'/>\n"
|
" <device alias='video0'/>\n"
|
||||||
" <device alias='serial0'/>\n"
|
" <device alias='serial0'/>\n"
|
||||||
" <device alias='net0'/>\n"
|
" <device alias='net0'/>\n"
|
||||||
" <device alias='usb'/>\n"
|
" <device alias='usb'/>\n"
|
||||||
" </devices>\n"
|
"</devices>\n"
|
||||||
" <numad nodeset='0-2' cpuset='1,3'/>\n"
|
"<numad nodeset='0-2' cpuset='1,3'/>\n"
|
||||||
" <libDir path='/tmp'/>\n"
|
"<libDir path='/tmp'/>\n"
|
||||||
" <channelTargetDir path='/tmp/channel'/>\n";
|
"<channelTargetDir path='/tmp/channel'/>\n";
|
||||||
|
|
||||||
static const char testStatusXMLSuffix[] =
|
static const char testStatusXMLSuffix[] =
|
||||||
"</domstatus>\n";
|
"</domstatus>\n";
|
||||||
@ -134,8 +134,9 @@ testGetStatusXMLPrefix(const struct testInfo *data)
|
|||||||
|
|
||||||
testGetStatuXMLPrefixVcpus(&buf, data);
|
testGetStatuXMLPrefixVcpus(&buf, data);
|
||||||
|
|
||||||
|
virBufferAddStr(&buf, testStatusXMLPrefixBodyStatic);
|
||||||
|
|
||||||
virBufferAdjustIndent(&buf, -2);
|
virBufferAdjustIndent(&buf, -2);
|
||||||
virBufferAdd(&buf, testStatusXMLPrefixFooter, -1);
|
|
||||||
|
|
||||||
return virBufferContentAndReset(&buf);
|
return virBufferContentAndReset(&buf);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user