]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Remove '\n' from vhostuser ifname
authorYalei Li <274268859@qq.com>
Fri, 5 Feb 2021 03:10:51 +0000 (11:10 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 5 Feb 2021 08:57:14 +0000 (09:57 +0100)
commitb29c86ae1042fc44e7c86f3519f048a696e68afe
tree3170645ce7a0b228d49412b1b7498cc6c9814da2
parentc0ae2ca081c37ce2420d0c500619e989fab9949b
util: Remove '\n' from vhostuser ifname

When deleting the vhostuserclient interface, OVS prompts that the interface does not exist,
Through the XML file, I found that the "target dev" has a '\n', results in an XML parsing error.

XML file:

<target dev='vm-20ac9c030a47
'/>

That is because 'ovs-vsctl' returns a newline result, always come with a '\n',
and the vircommandrun function puts it in ifname.

So virNetDevOpenvswitchGetVhostuserIfname should remove '\n' from ifname.

Signed-off-by: Yalei Li <liyl43@chinatelecom.cn>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virnetdevopenvswitch.c