From: "Daniel P. Berrange" To: libvir-list@redhat.com Date: Mon, 7 Oct 2013 14:06:47 +0100 Message-Id: <1381151211-27111-3-git-send-email-berrange@redhat.com> In-Reply-To: <1381151211-27111-1-git-send-email-berrange@redhat.com> References: <1381151211-27111-1-git-send-email-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/6] Remove unused 'opts' field from LXC basic mounts struct X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Oct 2013 13:06:57 -0000 From: "Daniel P. Berrange" The virLXCBasicMountInfo struct contains a 'char *opts' field passed onto the mount() syscall. Every entry in the list sets this to NULL though, so it can be removed to simplify life. Signed-off-by: Daniel P. Berrange --- src/lxc/lxc_container.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index b1f429c..3c89ed7 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -752,7 +752,6 @@ typedef struct { const char *src; const char *dst; const char *type; - const char *opts; int mflags; } virLXCBasicMountInfo; @@ -763,16 +762,16 @@ static const virLXCBasicMountInfo lxcBasicMounts[] = { * mount point in the main OS becomes readonly too which is not what * we want. Hence some things have two entries here. */ - { "proc", "/proc", "proc", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV }, - { "/proc/sys", "/proc/sys", NULL, NULL, MS_BIND }, - { "/proc/sys", "/proc/sys", NULL, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY }, - { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV }, - { "sysfs", "/sys", "sysfs", NULL, MS_BIND|MS_REMOUNT|MS_RDONLY }, - { "securityfs", "/sys/kernel/security", "securityfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV }, - { "securityfs", "/sys/kernel/security", "securityfs", NULL, MS_BIND|MS_REMOUNT|MS_RDONLY }, + { "proc", "/proc", "proc", MS_NOSUID|MS_NOEXEC|MS_NODEV }, + { "/proc/sys", "/proc/sys", NULL, MS_BIND }, + { "/proc/sys", "/proc/sys", NULL, MS_BIND|MS_REMOUNT|MS_RDONLY }, + { "sysfs", "/sys", "sysfs", MS_NOSUID|MS_NOEXEC|MS_NODEV }, + { "sysfs", "/sys", "sysfs", MS_BIND|MS_REMOUNT|MS_RDONLY }, + { "securityfs", "/sys/kernel/security", "securityfs", MS_NOSUID|MS_NOEXEC|MS_NODEV }, + { "securityfs", "/sys/kernel/security", "securityfs", MS_BIND|MS_REMOUNT|MS_RDONLY }, #if WITH_SELINUX - { SELINUX_MOUNT, SELINUX_MOUNT, "selinuxfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV }, - { SELINUX_MOUNT, SELINUX_MOUNT, NULL, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY }, + { SELINUX_MOUNT, SELINUX_MOUNT, "selinuxfs", MS_NOSUID|MS_NOEXEC|MS_NODEV }, + { SELINUX_MOUNT, SELINUX_MOUNT, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY }, #endif }; @@ -882,13 +881,13 @@ static int lxcContainerMountBasicFS(bool userns_enabled) goto cleanup; } - VIR_DEBUG("Mount %s on %s type=%s flags=%x, opts=%s", - srcpath, mnt->dst, mnt->type, mnt->mflags, mnt->opts); - if (mount(srcpath, mnt->dst, mnt->type, mnt->mflags, mnt->opts) < 0) { + 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) { virReportSystemError(errno, - _("Failed to mount %s on %s type %s flags=%x opts=%s"), + _("Failed to mount %s on %s type %s flags=%x"), srcpath, mnt->dst, NULLSTR(mnt->type), - mnt->mflags, NULLSTR(mnt->opts)); + mnt->mflags); goto cleanup; } } -- 1.8.3.1