[libvirt] [PATCH 0/2] Couple of coverity fixes

I went through coverity report and found these. Michal Privoznik (2): virDomainMigrateUnmanagedParams: Don't blindly dereference @dconnuri virt-host-validate-common: Print warning on missing IOMMU src/libvirt-domain.c | 2 +- src/qemu/qemu_migration.c | 2 +- tools/virt-host-validate-common.c | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) -- 2.4.10

This function may be called with @dconnuri == NULL, e.g. from virDomainMigrateToURI3() if the flags are missing VIR_MIGRATE_PEER2PEER flag. Moreover, all later functions called from here do wrap it into NULLSTR() so why not do the same here? Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/libvirt-domain.c | 2 +- src/qemu/qemu_migration.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 7290892..677a9ad 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -3428,7 +3428,7 @@ virDomainMigrateUnmanagedParams(virDomainPtr domain, unsigned int flags) { VIR_DOMAIN_DEBUG(domain, "dconnuri=%s, params=%p, nparams=%d, flags=%x", - dconnuri, params, nparams, flags); + NULLSTR(dconnuri), params, nparams, flags); VIR_TYPED_PARAMS_DEBUG(params, nparams); if ((flags & VIR_MIGRATE_PEER2PEER) && diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index bb708a3..44ca91a 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5646,7 +5646,7 @@ qemuMigrationPerform(virQEMUDriverPtr driver, cookieout, cookieoutlen, flags, resource); } else { - return qemuMigrationPerformJob(driver, conn, vm, xmlin, dconnuri, + return qemuMigrationPerformJob(driver, conn, vm, xmlin, NULL, uri, graphicsuri, listenAddress, nmigrate_disks, migrate_disks, cookiein, cookieinlen, -- 2.4.10

No only coverity warns about this, but it kind of makes sense too. We have a test whether host supports IOMMU. Some platforms don't have it, I know. But in that case we should print a message that it's unknown whether platform has it or not. Before: (no output) After: QEMU: Checking for device assignment IOMMU support : WARN (Unknown if this platform has IOMMU support) Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tools/virt-host-validate-common.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c index dd1c414..8ebf73e 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -367,9 +367,6 @@ int virHostValidateIOMMU(const char *hvname, isIntel = true; else if (virHostValidateHasCPUFlag("svm")) isAMD = true; - else - /* XXX PPC/ARM/etc support */ - return 0; virHostMsgCheck(hvname, "%s", _("for device assignment IOMMU support")); -- 2.4.10

On 01/07/2016 05:58 AM, Michal Privoznik wrote:
I went through coverity report and found these.
Michal Privoznik (2): virDomainMigrateUnmanagedParams: Don't blindly dereference @dconnuri virt-host-validate-common: Print warning on missing IOMMU
src/libvirt-domain.c | 2 +- src/qemu/qemu_migration.c | 2 +- tools/virt-host-validate-common.c | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-)
ACK to both John
participants (2)
-
John Ferlan
-
Michal Privoznik