Bug 1035403

Summary: libvirt does not mount multiple bind mounts if one target begins with the other target
Product: Red Hat Enterprise Linux 7 Reporter: Daniel Berrangé <berrange>
Component: libvirtAssignee: Daniel Berrangé <berrange>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: acathrow, ajia, dwalsh, dyuan, gsun, hliu, lsu, mzhan, weizhan, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.1.1-14.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1033278 Environment:
Last Closed: 2014-06-13 13:25:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Daniel Berrangé 2013-11-27 16:40:28 UTC
+++ This bug was initially created as a clone of Bug #1033278 +++

We are trying to setup a virt-sandbox-service where we are mounting over /etc/aliases and /etc/aliases.db

When we setup the container, /etc/aliases gets mounted but /etc/aliases.db does not.

I experimented with /etc/dan and /etc/dan_long and saw the same behaviour, once I changed to use /etc/dan1 and /etc/dan_long both containers worked.  

virsh edit

shows the correct xml.

Here is the command we were using to set this up.

virt-sandbox-service create --copy -N dhcp,mac='52:54:00:ec:b6:c4',source=virb\
r1 -m host-bind:/etc/aliases.db=/containers/$name/etc/aliases.db -m host-bind:/\
etc/aliases=/containers/$name/etc/aliases -m host-bind:/etc/resolv.conf=/contai\
ners/$name/etc/resolv.conf --unitfile postfix.service -p /var/lib/libvirt/files\
ystems $name

--- Additional comment from Daniel Berrange on 2013-11-27 16:39:45 GMT ---

Fix posted upstream

https://www.redhat.com/archives/libvir-list/2013-November/msg01257.html

Comment 4 Hao Liu 2013-12-09 14:37:09 UTC
This bug is VERIFIED.

Verification Steps:

1. Make the source to be mounted on host.
# mkdir -p /containers/lxc-vm/etc/                  
# echo "I'm test!" > /containers/lxc-vm/etc/test     
# echo "I'm test.new!" > /containers/lxc-vm/etc/test.new

2. Create and start VM with source files mounted.
# virt-sandbox-service create --copy -m host-bind:/home/test.new=/containers/lxc-vm/etc/test.new -m host-bind:/home/test=/containers/lxc-vm/etc/test --unitfile postfix.service -p /var/lib/libvirt/filesystems lxc-vm
# virsh -c lxc:/// start lxc-vm

3. Check files.
# virt-sandbox-service execute lxc-vm ls /home/
test
test.new
# virt-sandbox-service execute lxc-vm cat /home/test
I'm test!
# virt-sandbox-service execute lxc-vm cat /home/test.new
On libvirt-1.1.1-13:
<empty line>
On libvirt-1.1.1-14:
I'm test.new!
# virt-sandbox-service execute lxc-vm mount | grep test
On libvirt-1.1.1-13:
/dev/mapper/rhel-root on /home/test type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
On libvirt-1.1.1-14:
/dev/mapper/rhel-root on /home/test.new type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/mapper/rhel-root on /home/test type xfs (rw,relatime,seclabel,attr2,inode64,noquota)

4. Clean up.
# virsh -c lxc:/// destroy lxc-vm
# virt-sandbox-service delete lxc-vm
# rm -rf /containers/

So this fix if verified.

Comment 5 Ludek Smid 2014-06-13 13:25:27 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.