mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
conf: Avoid formatting empty redirfilter element
If the redirfilter has no usbdev sub-elements, then do not format anything rather than formatting an empty pair of elements: <redirfilter> </redirfilter> Signed-off-by: Luyao Huang <lhuang@redhat.com>
This commit is contained in:
parent
3502f79198
commit
733950c21c
@ -20626,6 +20626,10 @@ virDomainRedirFilterDefFormat(virBufferPtr buf,
|
||||
{
|
||||
size_t i;
|
||||
|
||||
/* no need format an empty redirfilter */
|
||||
if (filter->nusbdevs == 0)
|
||||
return 0;
|
||||
|
||||
virBufferAddLit(buf, "<redirfilter>\n");
|
||||
virBufferAdjustIndent(buf, 2);
|
||||
for (i = 0; i < filter->nusbdevs; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user