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