Merge pull request #184 from erikh/slave_mounts
Allow mounts to be supplied with the MS_SLAVE option.
This commit is contained in:
commit
84ad9386a0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue