qemu/hw/s390x/virtio-ccw-md.h
David Hildenbrand 88d86f6f1e s390x/virtio-ccw: add support for virtio based memory devices
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>
2024-12-21 15:59:59 +01:00

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 */