[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 5/9] pc-bios/s390-ccw/virtio: Add a function to reset a virtio dev
From: |
Thomas Huth |
Subject: |
[PULL 5/9] pc-bios/s390-ccw/virtio: Add a function to reset a virtio device |
Date: |
Tue, 21 Jan 2025 11:56:07 +0100 |
To be able to properly silence a virtio device after using it,
we need a global function to reset the device.
Reviewed-by: Jared Rossi <jrossi@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Tested-by: Jared Rossi <jrossi@linux.ibm.com>
Message-ID: <20250116115826.192047-2-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
pc-bios/s390-ccw/virtio.h | 1 +
pc-bios/s390-ccw/virtio.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h
index 9faf3986b1..f13fa6f5fe 100644
--- a/pc-bios/s390-ccw/virtio.h
+++ b/pc-bios/s390-ccw/virtio.h
@@ -274,6 +274,7 @@ void vring_send_buf(VRing *vr, void *p, int len, int flags);
int vr_poll(VRing *vr);
int vring_wait_reply(void);
int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd);
+int virtio_reset(VDev *vdev);
int virtio_setup_ccw(VDev *vdev);
int virtio_net_init(void *mac_addr);
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 8b5a370bb3..cd6c99c7e3 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -217,6 +217,11 @@ int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd)
return 0;
}
+int virtio_reset(VDev *vdev)
+{
+ return run_ccw(vdev, CCW_CMD_VDEV_RESET, NULL, 0, false);
+}
+
int virtio_setup_ccw(VDev *vdev)
{
int i, cfg_size = 0;
@@ -235,7 +240,7 @@ int virtio_setup_ccw(VDev *vdev)
vdev->config.blk.blk_size = 0; /* mark "illegal" - setup started... */
vdev->guessed_disk_nature = VIRTIO_GDN_NONE;
- run_ccw(vdev, CCW_CMD_VDEV_RESET, NULL, 0, false);
+ virtio_reset(vdev);
status = VIRTIO_CONFIG_S_ACKNOWLEDGE;
if (run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false)) {
--
2.48.1
- [PULL 0/9] s390x and test patches 2025-01-21, Thomas Huth, 2025/01/21
- [PULL 1/9] tests/functional: Convert the kvm_xen_guest avocado test, Thomas Huth, 2025/01/21
- [PULL 2/9] MAINTAINERS: Remove myself as Avocado Framework reviewer, Thomas Huth, 2025/01/21
- [PULL 5/9] pc-bios/s390-ccw/virtio: Add a function to reset a virtio device,
Thomas Huth <=
- [PULL 6/9] pc-bios/s390-ccw: Fix boot problem with virtio-net devices, Thomas Huth, 2025/01/21
- [PULL 4/9] hw/s390x: Fix crash that occurs when inspecting older versioned machines types, Thomas Huth, 2025/01/21
- [PULL 8/9] pc-bios/s390-ccw: Abort IPL on invalid loadparm, Thomas Huth, 2025/01/21
- [PULL 3/9] crypto: fix bogus error benchmarking pbkdf on fast machines, Thomas Huth, 2025/01/21
- [PULL 7/9] pc-bios/s390-ccw/netmain: Fix error messages with regards to the TFTP server, Thomas Huth, 2025/01/21
- [PULL 9/9] pc-bios: Update the s390 bios images with the recent changes, Thomas Huth, 2025/01/21
- Re: [PULL 0/9] s390x and test patches 2025-01-21, Stefan Hajnoczi, 2025/01/21