提交 733950c2 编写于 作者: L Luyao Huang 提交者: John Ferlan

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: NLuyao Huang <lhuang@redhat.com>
上级 3502f791
......@@ -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++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册