xref: /openbmc/qemu/hw/s390x/virtio-ccw-md.h (revision aa3a285b5bc56a4208b3b57d4a55291e9c260107)
1*88d86f6fSDavid Hildenbrand /*
2*88d86f6fSDavid Hildenbrand  * Virtio CCW support for abstract virtio based memory device
3*88d86f6fSDavid Hildenbrand  *
4*88d86f6fSDavid Hildenbrand  * Copyright (C) 2024 Red Hat, Inc.
5*88d86f6fSDavid Hildenbrand  *
6*88d86f6fSDavid Hildenbrand  * Authors:
7*88d86f6fSDavid Hildenbrand  *  David Hildenbrand <david@redhat.com>
8*88d86f6fSDavid Hildenbrand  *
9*88d86f6fSDavid Hildenbrand  * This work is licensed under the terms of the GNU GPL, version 2.
10*88d86f6fSDavid Hildenbrand  * See the COPYING file in the top-level directory.
11*88d86f6fSDavid Hildenbrand  */
12*88d86f6fSDavid Hildenbrand 
13*88d86f6fSDavid Hildenbrand #ifndef HW_S390X_VIRTIO_CCW_MD_H
14*88d86f6fSDavid Hildenbrand #define HW_S390X_VIRTIO_CCW_MD_H
15*88d86f6fSDavid Hildenbrand 
16*88d86f6fSDavid Hildenbrand #include "virtio-ccw.h"
17*88d86f6fSDavid Hildenbrand #include "qom/object.h"
18*88d86f6fSDavid Hildenbrand 
19*88d86f6fSDavid Hildenbrand /*
20*88d86f6fSDavid Hildenbrand  * virtio-md-ccw: This extends VirtioCcwDevice.
21*88d86f6fSDavid Hildenbrand  */
22*88d86f6fSDavid Hildenbrand #define TYPE_VIRTIO_MD_CCW "virtio-md-ccw"
23*88d86f6fSDavid Hildenbrand 
24*88d86f6fSDavid Hildenbrand OBJECT_DECLARE_TYPE(VirtIOMDCcw, VirtIOMDCcwClass, VIRTIO_MD_CCW)
25*88d86f6fSDavid Hildenbrand 
26*88d86f6fSDavid Hildenbrand struct VirtIOMDCcwClass {
27*88d86f6fSDavid Hildenbrand     /* private */
28*88d86f6fSDavid Hildenbrand     VirtIOCCWDeviceClass parent;
29*88d86f6fSDavid Hildenbrand 
30*88d86f6fSDavid Hildenbrand     /* public */
31*88d86f6fSDavid Hildenbrand     void (*unplug_request_check)(VirtIOMDCcw *vmd, Error **errp);
32*88d86f6fSDavid Hildenbrand };
33*88d86f6fSDavid Hildenbrand 
34*88d86f6fSDavid Hildenbrand struct VirtIOMDCcw {
35*88d86f6fSDavid Hildenbrand     VirtioCcwDevice parent_obj;
36*88d86f6fSDavid Hildenbrand };
37*88d86f6fSDavid Hildenbrand 
38*88d86f6fSDavid Hildenbrand void virtio_ccw_md_pre_plug(VirtIOMDCcw *vmd, MachineState *ms, Error **errp);
39*88d86f6fSDavid Hildenbrand void virtio_ccw_md_plug(VirtIOMDCcw *vmd, MachineState *ms, Error **errp);
40*88d86f6fSDavid Hildenbrand void virtio_ccw_md_unplug_request(VirtIOMDCcw *vmd, MachineState *ms,
41*88d86f6fSDavid Hildenbrand                                   Error **errp);
42*88d86f6fSDavid Hildenbrand void virtio_ccw_md_unplug(VirtIOMDCcw *vmd, MachineState *ms, Error **errp);
43*88d86f6fSDavid Hildenbrand 
44*88d86f6fSDavid Hildenbrand #endif /* HW_S390X_VIRTIO_CCW_MD_H */
45