diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2edbb3fdfe417919248d2a35ce2c5879b89a776b..3b50576a2b1d1eddc5f0154e4e15e67a81eb7383 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5136,12 +5136,22 @@ virQEMUCapsFillDomainLoaderCaps(virDomainCapsLoaderPtr capsLoader, for (i = 0; i < nfirmwares; i++) { const char *filename = firmwares[i]->name; + size_t j; if (!virFileExists(filename)) { VIR_DEBUG("loader filename=%s does not exist", filename); continue; } + /* Put only unique FW images onto the list */ + for (j = 0; j < capsLoader->values.nvalues; j++) { + if (STREQ(filename, capsLoader->values.values[j])) + break; + } + + if (j != capsLoader->values.nvalues) + continue; + if (VIR_STRDUP(capsLoader->values.values[capsLoader->values.nvalues], filename) < 0) return -1;