qemu_capabilities: Expose qemu <-> libvirt arch translators

In some cases, the string representing architecture is different
in qemu and libvirt. That is the reason why we have
virQEMUCapsArchFromString() and virQEMUCapsArchToString(). So
far, we did not need them outside of qemu_capabilities code, but
this will change shortly. Expose them then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Michal Privoznik 2019-02-26 10:42:38 +01:00
parent 23018c0823
commit 849a0cfef1
2 changed files with 5 additions and 2 deletions

View File

@ -616,7 +616,7 @@ static int virQEMUCapsOnceInit(void)
VIR_ONCE_GLOBAL_INIT(virQEMUCaps);
static virArch virQEMUCapsArchFromString(const char *arch)
virArch virQEMUCapsArchFromString(const char *arch)
{
if (STREQ(arch, "i386"))
return VIR_ARCH_I686;
@ -629,7 +629,7 @@ static virArch virQEMUCapsArchFromString(const char *arch)
}
static const char *virQEMUCapsArchToString(virArch arch)
const char *virQEMUCapsArchToString(virArch arch)
{
if (arch == VIR_ARCH_I686)
return "i386";

View File

@ -643,4 +643,7 @@ bool virQEMUCapsCPUFilterFeatures(const char *name,
virSEVCapabilityPtr
virQEMUCapsGetSEVCapabilities(virQEMUCapsPtr qemuCaps);
virArch virQEMUCapsArchFromString(const char *arch);
const char *virQEMUCapsArchToString(virArch arch);
#endif /* LIBVIRT_QEMU_CAPABILITIES_H */