s390x: Share image between qemu instances

This commit enables the `share-rw` flag for the image file in s390x.
This enables multiple instances of qemu to share the same image.

Fixes: #2049

Signed-off-by: Jan Schintag <jan.schintag@de.ibm.com>
This commit is contained in:
Jan Schintag 2019-09-16 10:25:19 +02:00
parent 7965baab62
commit 7fa0a72f2e
3 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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