Skip to contentSkip to conversation

virtio-mem: Fix definition of VirtIOMEMClass

PATCH Superseded Zhenzhong Duan 3 participants 6 messages Jun 4, 2025

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-mem: Fix definition of VirtIOMEMClass

Parent of VirtIOMEMClass is VirtioDeviceClass rather than VirtIODevice.

Fixes 910b25766b33 ("virtio-mem: Paravirtualized memory hot(un)plug")
---
 include/hw/virtio/virtio-mem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/virtio/virtio-mem.h +1 -1
index bc4f787772..93fdf9e432 100644
@@ -134,7 +134,7 @@ struct VirtioMemSystemReset {
 
 struct VirtIOMEMClass {
     /* private */
-    VirtIODevice parent;
+    VirtioDeviceClass parent;
 
     /* public */
     void (*fill_device_info)(const VirtIOMEM *vmen, VirtioMEMDeviceInfo *vi);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Zhenzhong Duan

Parent of VirtIOMEMClass is VirtioDeviceClass rather than VirtIODevice.

Fixes 910b25766b33 ("virtio-mem: Paravirtualized memory hot(un)plug")
---
  include/hw/virtio/virtio-mem.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/virtio/virtio-mem.h +0 -0
index bc4f787772..93fdf9e432 100644

include/hw/virtio/virtio-mem.h struct VirtioMemSystemReset { · line 137

Quoted 5 lines
include/hw/virtio/virtio-mem.h +1 -1
@@ -134,7 +134,7 @@ struct VirtioMemSystemReset {
 
  struct VirtIOMEMClass {
      /* private */
-    VirtIODevice parent;
+    VirtioDeviceClass parent;

I assume it's not currently a real problem because VirtIODevice is bigger than VirtioDeviceClass?

Or are you aware of any existing problems with that?

Signature · 3 lines
Cheers,

David / dhildenb
#2 lore raw
Quoted 28 lines

-----Original Message-----
From: David Hildenbrand <[email protected]>
Subject: Re: [PATCH] virtio-mem: Fix definition of VirtIOMEMClass

Quoted 13 lines · Zhenzhong Duan

Parent of VirtIOMEMClass is VirtioDeviceClass rather than VirtIODevice.

Fixes 910b25766b33 ("virtio-mem: Paravirtualized memory hot(un)plug")
---
  include/hw/virtio/virtio-mem.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/virtio/virtio-mem.h +0 -0
index bc4f787772..93fdf9e432 100644

include/hw/virtio/virtio-mem.h struct VirtioMemSystemReset { · line 137

Quoted 5 lines
include/hw/virtio/virtio-mem.h +1 -1
@@ -134,7 +134,7 @@ struct VirtioMemSystemReset {
 
  struct VirtIOMEMClass {
      /* private */
-    VirtIODevice parent;
+    VirtioDeviceClass parent;
Quoted 2 lines

I assume it's not currently a real problem because VirtIODevice is bigger than VirtioDeviceClass?

Yes, that's why we missed it.

Quoted 2 lines

Or are you aware of any existing problems with that?

No.

Zhenzhong

#3 lore raw
In reply to Zhenzhong Duan
Quoted 13 lines · Zhenzhong Duan

Parent of VirtIOMEMClass is VirtioDeviceClass rather than VirtIODevice.

Fixes 910b25766b33 ("virtio-mem: Paravirtualized memory hot(un)plug")
---
  include/hw/virtio/virtio-mem.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/virtio/virtio-mem.h +0 -0
index bc4f787772..93fdf9e432 100644

include/hw/virtio/virtio-mem.h struct VirtioMemSystemReset { · line 137

Quoted 5 lines
include/hw/virtio/virtio-mem.h +1 -1
@@ -134,7 +134,7 @@ struct VirtioMemSystemReset {
 
  struct VirtIOMEMClass {
      /* private */
-    VirtIODevice parent;
+    VirtioDeviceClass parent;

We seem to have the same problem for VirtIOPMEMClass. Can you check the other devices and send fixes? Thanks!

Signature · 3 lines
Cheers,

David / dhildenb
#4 lore raw
Quoted 21 lines

-----Original Message-----
From: David Hildenbrand <[email protected]>
Subject: Re: [PATCH] virtio-mem: Fix definition of VirtIOMEMClass

Quoted 14 lines · Zhenzhong Duan

Parent of VirtIOMEMClass is VirtioDeviceClass rather than VirtIODevice.

Fixes 910b25766b33 ("virtio-mem: Paravirtualized memory hot(un)plug")
---
  include/hw/virtio/virtio-mem.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/virtio/virtio-mem.h +0 -0
index bc4f787772..93fdf9e432 100644
@@ -134,7 +134,7 @@ struct VirtioMemSystemReset {
 
Quoted 7 lines

include/hw/virtio/virtio-mem.h struct VirtioMemSystemReset { · line 137

Quoted 4 lines
include/hw/virtio/virtio-mem.h +1 -1
  struct VirtIOMEMClass {
      /* private */
-    VirtIODevice parent;
+    VirtioDeviceClass parent;

We seem to have the same problem for VirtIOPMEMClass. Can you check the other devices and send fixes? Thanks!

Will do.

Thanks
Zhenzhong

Reviewed-by on v1 1/1
#5 lore raw
In reply to Zhenzhong Duan
Quoted 13 lines · Zhenzhong Duan

Parent of VirtIOMEMClass is VirtioDeviceClass rather than VirtIODevice.

Fixes 910b25766b33 ("virtio-mem: Paravirtualized memory hot(un)plug")
---
  include/hw/virtio/virtio-mem.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/virtio/virtio-mem.h +0 -0
index bc4f787772..93fdf9e432 100644

include/hw/virtio/virtio-mem.h struct VirtioMemSystemReset { · line 137

Quoted 5 lines
include/hw/virtio/virtio-mem.h +1 -1
@@ -134,7 +134,7 @@ struct VirtioMemSystemReset {
 
  struct VirtIOMEMClass {
      /* private */
-    VirtIODevice parent;
+    VirtioDeviceClass parent;

Ouch, nice catch.