]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/virtio: move stubs out of stubs/
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Apr 2024 15:53:23 +0000 (17:53 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 18 Apr 2024 09:17:27 +0000 (11:17 +0200)
Since the virtio memory device stubs are needed exactly when the
Kconfig symbol is not enabled, they can be placed in hw/virtio/ and
conditionalized on CONFIG_VIRTIO_MD.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240408155330.522792-12-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/virtio/meson.build
hw/virtio/virtio-md-stubs.c [new file with mode: 0644]
stubs/meson.build
stubs/virtio-md-pci.c [deleted file]

index d7f18c96e60ec39698867ee808a4955acef82a22..621fc65454c7eb4794bf2ec20d31f2ad7748c4a6 100644 (file)
@@ -87,6 +87,8 @@ specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
 system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss)
 system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
 system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c'))
+system_ss.add(when: 'CONFIG_VIRTIO_MD', if_false: files('virtio-md-stubs.c'))
+
 system_ss.add(files('virtio-hmp-cmds.c'))
 
 specific_ss.add_all(when: 'CONFIG_VIRTIO', if_true: specific_virtio_ss)
diff --git a/hw/virtio/virtio-md-stubs.c b/hw/virtio/virtio-md-stubs.c
new file mode 100644 (file)
index 0000000..ce5bba0
--- /dev/null
@@ -0,0 +1,24 @@
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "hw/virtio/virtio-md-pci.h"
+
+void virtio_md_pci_pre_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)
+{
+    error_setg(errp, "virtio based memory devices not supported");
+}
+
+void virtio_md_pci_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)
+{
+    error_setg(errp, "virtio based memory devices not supported");
+}
+
+void virtio_md_pci_unplug_request(VirtIOMDPCI *vmd, MachineState *ms,
+                                  Error **errp)
+{
+    error_setg(errp, "virtio based memory devices not supported");
+}
+
+void virtio_md_pci_unplug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)
+{
+    error_setg(errp, "virtio based memory devices not supported");
+}
index 45616afbfaa5f9517723a35aaecf6379dd8c26f4..60e32d363fa49b7608aa610a8c0acf8ebd09c00b 100644 (file)
@@ -57,7 +57,6 @@ if have_system
   stub_ss.add(files('fw_cfg.c'))
   stub_ss.add(files('semihost.c'))
   stub_ss.add(files('xen-hw-stub.c'))
-  stub_ss.add(files('virtio-md-pci.c'))
 else
   stub_ss.add(files('qdev.c'))
 endif
diff --git a/stubs/virtio-md-pci.c b/stubs/virtio-md-pci.c
deleted file mode 100644 (file)
index ce5bba0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "qemu/osdep.h"
-#include "qapi/error.h"
-#include "hw/virtio/virtio-md-pci.h"
-
-void virtio_md_pci_pre_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)
-{
-    error_setg(errp, "virtio based memory devices not supported");
-}
-
-void virtio_md_pci_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)
-{
-    error_setg(errp, "virtio based memory devices not supported");
-}
-
-void virtio_md_pci_unplug_request(VirtIOMDPCI *vmd, MachineState *ms,
-                                  Error **errp)
-{
-    error_setg(errp, "virtio based memory devices not supported");
-}
-
-void virtio_md_pci_unplug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)
-{
-    error_setg(errp, "virtio based memory devices not supported");
-}