aboutsummaryrefslogtreecommitdiff
path: root/hw/remote
diff options
context:
space:
mode:
Diffstat (limited to 'hw/remote')
-rw-r--r--hw/remote/iommu.c4
-rw-r--r--hw/remote/machine.c6
-rw-r--r--hw/remote/memory.c1
-rw-r--r--hw/remote/proxy-memory-listener.c3
-rw-r--r--hw/remote/proxy.c10
-rw-r--r--hw/remote/remote-obj.c10
-rw-r--r--hw/remote/vfio-user-obj.c19
7 files changed, 32 insertions, 21 deletions
diff --git a/hw/remote/iommu.c b/hw/remote/iommu.c
index 7c56aad..3e0758a 100644
--- a/hw/remote/iommu.c
+++ b/hw/remote/iommu.c
@@ -13,8 +13,8 @@
#include "hw/remote/iommu.h"
#include "hw/pci/pci_bus.h"
#include "hw/pci/pci.h"
-#include "exec/memory.h"
-#include "exec/address-spaces.h"
+#include "system/memory.h"
+#include "system/address-spaces.h"
#include "trace.h"
/**
diff --git a/hw/remote/machine.c b/hw/remote/machine.c
index fdc6c44..e4b4783 100644
--- a/hw/remote/machine.c
+++ b/hw/remote/machine.c
@@ -16,7 +16,7 @@
#include "qemu/osdep.h"
#include "hw/remote/machine.h"
-#include "exec/memory.h"
+#include "system/memory.h"
#include "qapi/error.h"
#include "hw/pci/pci_host.h"
#include "hw/remote/iohub.h"
@@ -121,7 +121,7 @@ static void remote_machine_dev_unplug_cb(HotplugHandler *hotplug_dev,
}
}
-static void remote_machine_class_init(ObjectClass *oc, void *data)
+static void remote_machine_class_init(ObjectClass *oc, const void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
@@ -146,7 +146,7 @@ static const TypeInfo remote_machine = {
.instance_size = sizeof(RemoteMachineState),
.instance_init = remote_machine_instance_init,
.class_init = remote_machine_class_init,
- .interfaces = (InterfaceInfo[]) {
+ .interfaces = (const InterfaceInfo[]) {
{ TYPE_HOTPLUG_HANDLER },
{ }
}
diff --git a/hw/remote/memory.c b/hw/remote/memory.c
index 6d60da9..8195aa5 100644
--- a/hw/remote/memory.c
+++ b/hw/remote/memory.c
@@ -11,7 +11,6 @@
#include "qemu/osdep.h"
#include "hw/remote/memory.h"
-#include "exec/ram_addr.h"
#include "qapi/error.h"
static void remote_sysmem_reset(void)
diff --git a/hw/remote/proxy-memory-listener.c b/hw/remote/proxy-memory-listener.c
index a926f61..e1a52d2 100644
--- a/hw/remote/proxy-memory-listener.c
+++ b/hw/remote/proxy-memory-listener.c
@@ -10,9 +10,8 @@
#include "qemu/int128.h"
#include "qemu/range.h"
-#include "exec/memory.h"
+#include "system/memory.h"
#include "exec/cpu-common.h"
-#include "exec/ram_addr.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "hw/remote/mpqemu-link.h"
diff --git a/hw/remote/proxy.c b/hw/remote/proxy.c
index 96d831a..18e0f7a 100644
--- a/hw/remote/proxy.c
+++ b/hw/remote/proxy.c
@@ -112,8 +112,12 @@ static void pci_proxy_dev_realize(PCIDevice *device, Error **errp)
return;
}
+ if (!qio_channel_set_blocking(dev->ioc, true, errp)) {
+ object_unref(dev->ioc);
+ return;
+ }
+
qemu_mutex_init(&dev->io_mutex);
- qio_channel_set_blocking(dev->ioc, true, NULL);
pci_conf[PCI_LATENCY_TIMER] = 0xff;
pci_conf[PCI_INTERRUPT_PIN] = 0x01;
@@ -195,7 +199,7 @@ static const Property proxy_properties[] = {
DEFINE_PROP_STRING("fd", PCIProxyDev, fd),
};
-static void pci_proxy_dev_class_init(ObjectClass *klass, void *data)
+static void pci_proxy_dev_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
@@ -215,7 +219,7 @@ static const TypeInfo pci_proxy_dev_type_info = {
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PCIProxyDev),
.class_init = pci_proxy_dev_class_init,
- .interfaces = (InterfaceInfo[]) {
+ .interfaces = (const InterfaceInfo[]) {
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ },
},
diff --git a/hw/remote/remote-obj.c b/hw/remote/remote-obj.c
index 2f25f92..3402068 100644
--- a/hw/remote/remote-obj.c
+++ b/hw/remote/remote-obj.c
@@ -107,7 +107,11 @@ static void remote_object_machine_done(Notifier *notifier, void *data)
error_report_err(err);
return;
}
- qio_channel_set_blocking(ioc, false, NULL);
+ if (!qio_channel_set_blocking(ioc, false, &err)) {
+ error_report_err(err);
+ object_unref(OBJECT(ioc));
+ return;
+ }
o->dev = dev;
@@ -163,7 +167,7 @@ static void remote_object_finalize(Object *obj)
g_free(o->devid);
}
-static void remote_object_class_init(ObjectClass *klass, void *data)
+static void remote_object_class_init(ObjectClass *klass, const void *data)
{
RemoteObjectClass *k = REMOTE_OBJECT_CLASS(klass);
@@ -188,7 +192,7 @@ static const TypeInfo remote_object_info = {
.instance_finalize = remote_object_finalize,
.class_size = sizeof(RemoteObjectClass),
.class_init = remote_object_class_init,
- .interfaces = (InterfaceInfo[]) {
+ .interfaces = (const InterfaceInfo[]) {
{ TYPE_USER_CREATABLE },
{ }
}
diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c
index 6e51a92..216b487 100644
--- a/hw/remote/vfio-user-obj.c
+++ b/hw/remote/vfio-user-obj.c
@@ -57,7 +57,7 @@
#include "hw/qdev-core.h"
#include "hw/pci/pci.h"
#include "qemu/timer.h"
-#include "exec/memory.h"
+#include "system/memory.h"
#include "hw/pci/msi.h"
#include "hw/pci/msix.h"
#include "hw/remote/vfio-user-obj.h"
@@ -75,12 +75,17 @@ OBJECT_DECLARE_TYPE(VfuObject, VfuObjectClass, VFU_OBJECT)
*/
#define VFU_OBJECT_ERROR(o, fmt, ...) \
{ \
+ error_report((fmt), ## __VA_ARGS__); \
if (vfu_object_auto_shutdown()) { \
- error_setg(&error_abort, (fmt), ## __VA_ARGS__); \
- } else { \
- error_report((fmt), ## __VA_ARGS__); \
+ /* \
+ * FIXME This looks inappropriate. The error is serious \
+ * enough programming error to warrant aborting the process \
+ * when auto-shutdown is enabled, yet harmless enough to \
+ * permit carrying on when it's disabled. Makes no sense. \
+ */ \
+ abort(); \
} \
- } \
+ }
struct VfuObjectClass {
ObjectClass parent_class;
@@ -917,7 +922,7 @@ static void vfu_object_finalize(Object *obj)
}
}
-static void vfu_object_class_init(ObjectClass *klass, void *data)
+static void vfu_object_class_init(ObjectClass *klass, const void *data)
{
VfuObjectClass *k = VFU_OBJECT_CLASS(klass);
@@ -944,7 +949,7 @@ static const TypeInfo vfu_object_info = {
.instance_finalize = vfu_object_finalize,
.class_size = sizeof(VfuObjectClass),
.class_init = vfu_object_class_init,
- .interfaces = (InterfaceInfo[]) {
+ .interfaces = (const InterfaceInfo[]) {
{ TYPE_USER_CREATABLE },
{ }
}