From 3594855094653dbb0aab37c27d44cd118e59dad2 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Thu, 9 Jan 2020 14:59:03 +0100 Subject: [PATCH] s390x: fix refactoring On s390x we need to set the devno that's why we need a custom appendBlkDevice function. Fixes: #2384 Signed-off-by: Alice Frosi --- virtcontainers/qemu_s390x.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/virtcontainers/qemu_s390x.go b/virtcontainers/qemu_s390x.go index b3532e285a..253fe9f12c 100644 --- a/virtcontainers/qemu_s390x.go +++ b/virtcontainers/qemu_s390x.go @@ -125,7 +125,19 @@ func (q *qemuS390x) appendConsole(devices []govmmQemu.Device, path string) ([]go return devices, nil } +func (q *qemuS390x) appendImage(devices []govmmQemu.Device, path string) ([]govmmQemu.Device, error) { + drive, err := genericImage(path) + if err != nil { + return nil, err + } + return q.appendCCWBlockDevice(devices, drive) +} + func (q *qemuS390x) appendBlockDevice(devices []govmmQemu.Device, drive config.BlockDrive) ([]govmmQemu.Device, error) { + return q.appendCCWBlockDevice(devices, drive) +} + +func (q *qemuS390x) appendCCWBlockDevice(devices []govmmQemu.Device, drive config.BlockDrive) ([]govmmQemu.Device, error) { d, err := genericBlockDevice(drive, false) if err != nil { return devices, fmt.Errorf("Failed to append blk-dev %v", err)