]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
lxc: Avoid Coverity SIZEOF_MISMATCH
authorJohn Ferlan <jferlan@redhat.com>
Tue, 1 Sep 2015 11:08:47 +0000 (07:08 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 4 Sep 2015 19:19:04 +0000 (15:19 -0400)
Commit id '692e9fac7' used virProcessSetNamespaces instead of inlining
the similar functionality; however, Coverity notes that the function
prototype expects a size_t value and not an enum and complains. So,
just typecast the enum as a size_t to avoid the noise.

src/lxc/lxc_container.c

index a433552cbfe58d16c4b1e8a541af3aaabc2e166f..6dc2ec768ffea14bff1ce483556d9f4c51c700dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2014 Red Hat, Inc.
+ * Copyright (C) 2008-2015 Red Hat, Inc.
  * Copyright (C) 2008 IBM Corp.
  * Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
  *
@@ -2151,7 +2151,8 @@ static int lxcContainerDropCapabilities(virDomainDefPtr def ATTRIBUTE_UNUSED,
 static int lxcAttachNS(int *ns_fd)
 {
     if (ns_fd &&
-        virProcessSetNamespaces(VIR_LXC_DOMAIN_NAMESPACE_LAST, ns_fd) < 0)
+        virProcessSetNamespaces((size_t)VIR_LXC_DOMAIN_NAMESPACE_LAST,
+                                ns_fd) < 0)
         return -1;
     return 0;
 }