blk-dev: hotplug readonly if applicable

If a block based volume is read only, let's make sure we add as a RO
device

Fixes: #1246

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
This commit is contained in:
Eric Ernst
2021-01-12 14:30:19 -08:00
committed by Eric Ernst
parent 12777b26e4
commit 789fd7c1c6
4 changed files with 12 additions and 7 deletions

View File

@@ -669,6 +669,7 @@ func (c *Container) createBlockDevices() error {
DevType: "b",
Major: int64(unix.Major(stat.Rdev)),
Minor: int64(unix.Minor(stat.Rdev)),
ReadOnly: m.ReadOnly,
}
// check whether source can be used as a pmem device
} else if di, err = config.PmemDeviceInfo(m.Source, m.Destination); err != nil {