hw/xen: Make XenDevOps structures const
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 10 May 2024 09:36:51 +0000 (11:36 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 4 Jun 2024 09:53:43 +0000 (11:53 +0200)
Keep XenDevOps structures in .rodata.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Paul Durrant <paul@xen.org>
Message-Id: <20240510104908.76908-5-philmd@linaro.org>

hw/9pfs/xen-9p-backend.c
hw/display/xenfb.c
hw/usb/xen-usb.c
include/hw/xen/xen-legacy-backend.h

index a3ac53f989e14bcc9a03392ce947ed4da6544519..79359d911a778f54e266286de618247f49c1b166 100644 (file)
@@ -513,7 +513,7 @@ static void xen_9pfs_alloc(struct XenLegacyDevice *xendev)
     xenstore_write_be_int(xendev, "max-ring-page-order", MAX_RING_ORDER);
 }
 
-static struct XenDevOps xen_9pfs_ops = {
+static const struct XenDevOps xen_9pfs_ops = {
     .size       = sizeof(Xen9pfsDev),
     .flags      = DEVOPS_FLAG_NEED_GNTDEV,
     .alloc      = xen_9pfs_alloc,
index 27536bfce0cb50a34b6dc7fb2a9225582257d5fc..b6d370bdf6f54e653e2e587adb7e9004790fa41e 100644 (file)
@@ -972,7 +972,7 @@ static void fb_event(struct XenLegacyDevice *xendev)
 
 /* -------------------------------------------------------------------- */
 
-static struct XenDevOps xen_kbdmouse_ops = {
+static const struct XenDevOps xen_kbdmouse_ops = {
     .size       = sizeof(struct XenInput),
     .init       = input_init,
     .initialise = input_initialise,
@@ -981,7 +981,7 @@ static struct XenDevOps xen_kbdmouse_ops = {
     .event      = input_event,
 };
 
-struct XenDevOps xen_framebuffer_ops = {
+const struct XenDevOps xen_framebuffer_ops = {
     .size       = sizeof(struct XenFB),
     .init       = fb_init,
     .initialise = fb_initialise,
index 416623f956ad8c4b0e53027b6f23e93f3e7cfa81..13901625c0c89fc3333ebf80d38565565a46fce8 100644 (file)
@@ -1083,7 +1083,7 @@ static void usbback_event(struct XenLegacyDevice *xendev)
     qemu_bh_schedule(usbif->bh);
 }
 
-static struct XenDevOps xen_usb_ops = {
+static const struct XenDevOps xen_usb_ops = {
     .size            = sizeof(struct usbback_info),
     .flags           = DEVOPS_FLAG_NEED_GNTDEV,
     .init            = usbback_init,
index 62623ecb30b1f190010be8b2f7e21600e8cf9aa9..e55a14057fbf5f4c2675c954b33376428f438768 100644 (file)
@@ -67,7 +67,7 @@ static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev,
 }
 
 /* backend drivers not included in all machines */
-extern struct XenDevOps xen_framebuffer_ops;  /* xenfb.c */
+extern const struct XenDevOps xen_framebuffer_ops;  /* xenfb.c */
 
 /* configuration (aka xenbus setup) */
 void xen_config_cleanup(void);