diff --git a/virtcontainers/device/config/config.go b/virtcontainers/device/config/config.go index 4eda53b997..9a30134576 100644 --- a/virtcontainers/device/config/config.go +++ b/virtcontainers/device/config/config.go @@ -144,6 +144,9 @@ type BlockDrive struct { // DevNo identifies the css bus id for virtio-blk-ccw DevNo string + + // ShareRW enables multiple qemu instances to share the File + ShareRW bool } // VFIODeviceType indicates VFIO device type diff --git a/virtcontainers/qemu_arch_base.go b/virtcontainers/qemu_arch_base.go index 64792ba613..4408648bc1 100644 --- a/virtcontainers/qemu_arch_base.go +++ b/virtcontainers/qemu_arch_base.go @@ -548,6 +548,7 @@ func genericBlockDevice(drive config.BlockDrive, nestedRun bool) (govmmQemu.Bloc Format: govmmQemu.BlockDeviceFormat(drive.Format), Interface: "none", DisableModern: nestedRun, + ShareRW: drive.ShareRW, }, nil } diff --git a/virtcontainers/qemu_s390x.go b/virtcontainers/qemu_s390x.go index 26cfb1e1a1..c5d0b8be00 100644 --- a/virtcontainers/qemu_s390x.go +++ b/virtcontainers/qemu_s390x.go @@ -131,6 +131,7 @@ func (q *qemuS390x) appendImage(devices []govmmQemu.Device, path string) ([]govm if err != nil { return nil, err } + drive.ShareRW = true devices, err = q.appendBlockDevice(devices, drive) if err != nil { return nil, err