mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00

Let's implement support for abstract virtio based memory devices, using the virtio-pci implementation as an orientation. Wire them up in the machine hotplug handler, taking care of s390x page size limitations. As we neither support virtio-mem or virtio-pmem yet, the code is effectively unused. We'll implement support for virtio-mem based on this next. Note that we won't wire up the virtio-pci variant (should currently be impossible due to lack of support for MSI-X), but we'll add a safety net to reject plugging them in the pre-plug handler. Message-ID: <20241219144115.2820241-14-david@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com>
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
/*
|
|
* Virtio CCW support for abstract virtio based memory device
|
|
*
|
|
* Copyright (C) 2024 Red Hat, Inc.
|
|
*
|
|
* Authors:
|
|
* David Hildenbrand <david@redhat.com>
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#ifndef HW_S390X_VIRTIO_CCW_MD_H
|
|
#define HW_S390X_VIRTIO_CCW_MD_H
|
|
|
|
#include "virtio-ccw.h"
|
|
#include "qom/object.h"
|
|
|
|
/*
|
|
* virtio-md-ccw: This extends VirtioCcwDevice.
|
|
*/
|
|
#define TYPE_VIRTIO_MD_CCW "virtio-md-ccw"
|
|
|
|
OBJECT_DECLARE_TYPE(VirtIOMDCcw, VirtIOMDCcwClass, VIRTIO_MD_CCW)
|
|
|
|
struct VirtIOMDCcwClass {
|
|
/* private */
|
|
VirtIOCCWDeviceClass parent;
|
|
|
|
/* public */
|
|
void (*unplug_request_check)(VirtIOMDCcw *vmd, Error **errp);
|
|
};
|
|
|
|
struct VirtIOMDCcw {
|
|
VirtioCcwDevice parent_obj;
|
|
};
|
|
|
|
void virtio_ccw_md_pre_plug(VirtIOMDCcw *vmd, MachineState *ms, Error **errp);
|
|
void virtio_ccw_md_plug(VirtIOMDCcw *vmd, MachineState *ms, Error **errp);
|
|
void virtio_ccw_md_unplug_request(VirtIOMDCcw *vmd, MachineState *ms,
|
|
Error **errp);
|
|
void virtio_ccw_md_unplug(VirtIOMDCcw *vmd, MachineState *ms, Error **errp);
|
|
|
|
#endif /* HW_S390X_VIRTIO_CCW_MD_H */
|