xref: /openbmc/qemu/include/hw/virtio/virtio-md-pci.h (revision 764a6ee9)
1 /*
2  * Abstract virtio based memory device
3  *
4  * Copyright (C) 2023 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_VIRTIO_MD_PCI_H
14 #define HW_VIRTIO_MD_PCI_H
15 
16 #include "hw/virtio/virtio-pci.h"
17 #include "qom/object.h"
18 
19 /*
20  * virtio-md-pci: This extends VirtioPCIProxy.
21  */
22 #define TYPE_VIRTIO_MD_PCI "virtio-md-pci"
23 
24 OBJECT_DECLARE_TYPE(VirtIOMDPCI, VirtIOMDPCIClass, VIRTIO_MD_PCI)
25 
26 struct VirtIOMDPCIClass {
27     /* private */
28     VirtioPCIClass parent;
29 
30     /* public */
31     void (*unplug_request_check)(VirtIOMDPCI *vmd, Error **errp);
32 };
33 
34 struct VirtIOMDPCI {
35     VirtIOPCIProxy parent_obj;
36 };
37 
38 void virtio_md_pci_pre_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp);
39 void virtio_md_pci_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp);
40 void virtio_md_pci_unplug_request(VirtIOMDPCI *vmd, MachineState *ms,
41                                   Error **errp);
42 void virtio_md_pci_unplug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp);
43 
44 #endif
45