mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 16:27:50 +00:00
virtio-blk: Add support for share-rw flag
This allows multiple instances of qemu to share the same file for virtio-blk device. Fixes: #108 Signed-off-by: Jan Schintag <jan.schintag@de.ibm.com>
This commit is contained in:
parent
ee460e3008
commit
cb9f640b4e
@ -728,6 +728,9 @@ type BlockDevice struct {
|
||||
|
||||
// DevNo identifies the ccw devices for s390x architecture
|
||||
DevNo string
|
||||
|
||||
// ShareRW enables multiple qemu instances to share the File
|
||||
ShareRW bool
|
||||
}
|
||||
|
||||
// Valid returns true if the BlockDevice structure is valid and complete.
|
||||
@ -766,6 +769,10 @@ func (blkdev BlockDevice) QemuParams(config *Config) []string {
|
||||
deviceParams = append(deviceParams, fmt.Sprintf(",devno=%s", blkdev.DevNo))
|
||||
}
|
||||
|
||||
if blkdev.ShareRW {
|
||||
deviceParams = append(deviceParams, fmt.Sprintf(",share-rw=on"))
|
||||
}
|
||||
|
||||
blkParams = append(blkParams, fmt.Sprintf("id=%s", blkdev.ID))
|
||||
blkParams = append(blkParams, fmt.Sprintf(",file=%s", blkdev.File))
|
||||
blkParams = append(blkParams, fmt.Sprintf(",aio=%s", blkdev.AIO))
|
||||
|
Loading…
Reference in New Issue
Block a user