Merge pull request #184 from erikh/slave_mounts

Allow mounts to be supplied with the MS_SLAVE option.
This commit is contained in:
Michael Crosby 2014-09-09 10:34:34 -07:00
commit 84ad9386a0
1 changed files with 5 additions and 0 deletions

View File

@ -17,6 +17,7 @@ type Mount struct {
Writable bool `json:"writable,omitempty"`
Relabel string `json:"relabel,omitempty"` // Relabel source if set, "z" indicates shared, "Z" indicates unshared
Private bool `json:"private,omitempty"`
Slave bool `json:"slave,omitempty"`
}
func (m *Mount) Mount(rootfs, mountLabel string) error {
@ -40,6 +41,10 @@ func (m *Mount) bindMount(rootfs, mountLabel string) error {
flags = flags | syscall.MS_RDONLY
}
if m.Slave {
flags = flags | syscall.MS_SLAVE
}
stat, err := os.Stat(m.Source)
if err != nil {
return err