]> xenbits.xensource.com Git - libvirt.git/commitdiff
Remove pointless 'srcpath' variable in lxcContainerMountBasicFS
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 7 Oct 2013 11:13:15 +0000 (12:13 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 5 Nov 2013 07:51:47 +0000 (15:51 +0800)
The 'srcpath' variable is initialized from 'mnt->src' and never
changed thereafter. Some places continue to use 'mnt->src' and
others use 'srcpath'. Remove the pointless 'srcpath' variable
and use 'mnt->src' everywhere.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/lxc/lxc_container.c

index 5a28cef64b8130d5369a925b30c2a4a2071769d7..bb4c27b208ac7f8e525c2da09d6a9b85cc6860f6 100644 (file)
@@ -855,16 +855,13 @@ static int lxcContainerMountBasicFS(bool userns_enabled)
 
     for (i = 0; i < ARRAY_CARDINALITY(lxcBasicMounts); i++) {
         virLXCBasicMountInfo const *mnt = &lxcBasicMounts[i];
-        const char *srcpath = NULL;
 
         VIR_DEBUG("Processing %s -> %s",
                   mnt->src, mnt->dst);
 
-        srcpath = mnt->src;
-
         /* Skip if mount doesn't exist in source */
-        if ((srcpath[0] == '/') &&
-            (access(srcpath, R_OK) < 0))
+        if ((mnt->src[0] == '/') &&
+            (access(mnt->src, R_OK) < 0))
             continue;
 
 #if WITH_SELINUX
@@ -884,11 +881,11 @@ static int lxcContainerMountBasicFS(bool userns_enabled)
         }
 
         VIR_DEBUG("Mount %s on %s type=%s flags=%x",
-                  srcpath, mnt->dst, mnt->type, mnt->mflags);
-        if (mount(srcpath, mnt->dst, mnt->type, mnt->mflags, NULL) < 0) {
+                  mnt->src, mnt->dst, mnt->type, mnt->mflags);
+        if (mount(mnt->src, mnt->dst, mnt->type, mnt->mflags, NULL) < 0) {
             virReportSystemError(errno,
                                  _("Failed to mount %s on %s type %s flags=%x"),
-                                 srcpath, mnt->dst, NULLSTR(mnt->type),
+                                 mnt->src, mnt->dst, NULLSTR(mnt->type),
                                  mnt->mflags);
             goto cleanup;
         }