[libvirt] [PATCH 1/7] conf: Remove incorrect check when encoding shmem audit message

John Ferlan jferlan at redhat.com
Mon Oct 10 15:42:12 UTC 2016


Remove the !size check since size is initialized to NULL and thus
causing the condition to always be true

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/conf/domain_audit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index fd20ace..2423f34 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -983,7 +983,7 @@ virDomainAuditShmem(virDomainObjPtr vm,
 
     virUUIDFormat(vm->def->uuid, uuidstr);
 
-    if (!vmname || !src || !size || !shmem ||
+    if (!vmname || !src || !shmem ||
         virAsprintfQuiet(&size, "%llu", def->size) < 0) {
         VIR_WARN("OOM while encoding audit message");
         goto cleanup;
@@ -997,7 +997,7 @@ virDomainAuditShmem(virDomainObjPtr vm,
 
     VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success,
               "virt=%s resrc=shmem reason=%s %s uuid=%s size=%s %s %s",
-              virt, reason, vmname, uuidstr, size ?: "?", shmem, src);
+              virt, reason, vmname, uuidstr, size, shmem, src);
 
  cleanup:
     VIR_FREE(vmname);
-- 
2.7.4




More information about the libvir-list mailing list