conf: Improve virDomainChrTargetDefFormat()
conf: Improve virDomainChrTargetDefFormat()

Make the switch statement type-aware, avoid calling
virDomainChrTargetTypeToString() more than once and check its
return value before using it.

Signed-off-by: Andrea Bolognani <3ada0bee826c753786fdbba72243dfba997094cf@redhat.com>
Reviewed-by: Pavel Hrdina <d4772d05997b8abf035041e3b4f4996380ea7e7a@redhat.com>

fabianfreyer/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,eskultety/libvirt,libvirt/libvirt,eskultety/libvirt,crobinso/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,zippy2/libvirt,eskultety/libvirt,olafhering/libvirt,jfehlig/libvirt,olafhering/libvirt,libvirt/libvirt,nertpinx/libvirt,eskultety/libvirt,nertpinx/libvirt,jardasgit/libvirt,andreabolognani/libvirt,libvirt/libvirt,andreabolognani/libvirt,crobinso/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,olafhering/libvirt,jardasgit/libvirt,zippy2/libvirt,zippy2/libvirt,jfehlig/libvirt,crobinso/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,crobinso/libvirt,nertpinx/libvirt,andreabolognani/libvirt,libvirt/libvirt,olafhering/libvirt,eskultety/libvirt,jfehlig/libvirt,zippy2/libvirt