mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 14:54:19 +01:00
disk: Add --share-rw option for hotplugging disks
With qemu 2.10, a write lock was added for qcow images that prevents the same image to be passed more than once. This can be over-ridden using the --share-rw option which is desired for raw images. This solves an issue with running Kata with devicemapper using the privileged mode as in this case all devices on the host are passed to the container using the block device associated with the rootfs, causing it to be passed twice to qemu. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
@@ -438,11 +438,11 @@ func TestQMPDeviceAdd(t *testing.T) {
|
||||
buf.AddCommand("device_add", nil, "return", nil)
|
||||
cfg := QMPConfig{Logger: qmpTestLogger{}}
|
||||
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
||||
checkVersion(t, connectedCh)
|
||||
q.version = checkVersion(t, connectedCh)
|
||||
blockdevID := fmt.Sprintf("drive_%s", volumeUUID)
|
||||
devID := fmt.Sprintf("device_%s", volumeUUID)
|
||||
err := q.ExecuteDeviceAdd(context.Background(), blockdevID, devID,
|
||||
"virtio-blk-pci", "")
|
||||
"virtio-blk-pci", "", true)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error %v", err)
|
||||
}
|
||||
@@ -463,11 +463,11 @@ func TestQMPSCSIDeviceAdd(t *testing.T) {
|
||||
buf.AddCommand("device_add", nil, "return", nil)
|
||||
cfg := QMPConfig{Logger: qmpTestLogger{}}
|
||||
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
||||
checkVersion(t, connectedCh)
|
||||
q.version = checkVersion(t, connectedCh)
|
||||
blockdevID := fmt.Sprintf("drive_%s", volumeUUID)
|
||||
devID := fmt.Sprintf("device_%s", volumeUUID)
|
||||
err := q.ExecuteSCSIDeviceAdd(context.Background(), blockdevID, devID,
|
||||
"scsi-hd", "scsi0.0", 1, 2)
|
||||
"scsi-hd", "scsi0.0", 1, 2, true)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error %v", err)
|
||||
}
|
||||
@@ -881,11 +881,11 @@ func TestQMPPCIDeviceAdd(t *testing.T) {
|
||||
buf.AddCommand("device_add", nil, "return", nil)
|
||||
cfg := QMPConfig{Logger: qmpTestLogger{}}
|
||||
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
||||
checkVersion(t, connectedCh)
|
||||
q.version = checkVersion(t, connectedCh)
|
||||
blockdevID := fmt.Sprintf("drive_%s", volumeUUID)
|
||||
devID := fmt.Sprintf("device_%s", volumeUUID)
|
||||
err := q.ExecutePCIDeviceAdd(context.Background(), blockdevID, devID,
|
||||
"virtio-blk-pci", "0x1", "")
|
||||
"virtio-blk-pci", "0x1", "", true)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user