Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

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:
Embargoed:

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.