Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
s390x: Share image between qemu instances
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jschintag committed Sep 18, 2019
1 parent 7965baa commit 7fa0a72
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions virtcontainers/device/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions virtcontainers/qemu_arch_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions virtcontainers/qemu_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7fa0a72

Please sign in to comment.