[PATCH] virtio-mem: Fix definition of VirtIOMEMClass

Zhenzhong Duan posted 1 patch 5 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250604084757.4035354-1-zhenzhong.duan@intel.com
Maintainers: David Hildenbrand <david@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>
include/hw/virtio/virtio-mem.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] virtio-mem: Fix definition of VirtIOMEMClass
Posted by Zhenzhong Duan 5 months, 2 weeks ago
Parent of VirtIOMEMClass is VirtioDeviceClass rather than VirtIODevice.

Fixes: 910b25766b33 ("virtio-mem: Paravirtualized memory hot(un)plug")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 include/hw/virtio/virtio-mem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/virtio/virtio-mem.h b/include/hw/virtio/virtio-mem.h
index bc4f787772..93fdf9e432 100644
--- a/include/hw/virtio/virtio-mem.h
+++ b/include/hw/virtio/virtio-mem.h
@@ -134,7 +134,7 @@ struct VirtioMemSystemReset {
 
 struct VirtIOMEMClass {
     /* private */
-    VirtIODevice parent;
+    VirtioDeviceClass parent;
 
     /* public */
     void (*fill_device_info)(const VirtIOMEM *vmen, VirtioMEMDeviceInfo *vi);
-- 
2.34.1
Re: [PATCH] virtio-mem: Fix definition of VirtIOMEMClass
Posted by Philippe Mathieu-Daudé 5 months, 2 weeks ago
On 4/6/25 10:47, Zhenzhong Duan wrote:
> Parent of VirtIOMEMClass is VirtioDeviceClass rather than VirtIODevice.
> 
> Fixes: 910b25766b33 ("virtio-mem: Paravirtualized memory hot(un)plug")
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
>   include/hw/virtio/virtio-mem.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/virtio/virtio-mem.h b/include/hw/virtio/virtio-mem.h
> index bc4f787772..93fdf9e432 100644
> --- a/include/hw/virtio/virtio-mem.h
> +++ b/include/hw/virtio/virtio-mem.h
> @@ -134,7 +134,7 @@ struct VirtioMemSystemReset {
>   
>   struct VirtIOMEMClass {
>       /* private */
> -    VirtIODevice parent;
> +    VirtioDeviceClass parent;

Ouch, nice catch.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Re: [PATCH] virtio-mem: Fix definition of VirtIOMEMClass
Posted by David Hildenbrand 5 months, 2 weeks ago
On 04.06.25 10:47, Zhenzhong Duan wrote:
> Parent of VirtIOMEMClass is VirtioDeviceClass rather than VirtIODevice.
> 
> Fixes: 910b25766b33 ("virtio-mem: Paravirtualized memory hot(un)plug")
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
>   include/hw/virtio/virtio-mem.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/virtio/virtio-mem.h b/include/hw/virtio/virtio-mem.h
> index bc4f787772..93fdf9e432 100644
> --- a/include/hw/virtio/virtio-mem.h
> +++ b/include/hw/virtio/virtio-mem.h
> @@ -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!

-- 
Cheers,

David / dhildenb
Re: [PATCH] virtio-mem: Fix definition of VirtIOMEMClass
Posted by David Hildenbrand 5 months, 2 weeks ago
On 04.06.25 10:47, Zhenzhong Duan wrote:
> Parent of VirtIOMEMClass is VirtioDeviceClass rather than VirtIODevice.
> 
> Fixes: 910b25766b33 ("virtio-mem: Paravirtualized memory hot(un)plug")
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
>   include/hw/virtio/virtio-mem.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/virtio/virtio-mem.h b/include/hw/virtio/virtio-mem.h
> index bc4f787772..93fdf9e432 100644
> --- a/include/hw/virtio/virtio-mem.h
> +++ b/include/hw/virtio/virtio-mem.h
> @@ -134,7 +134,7 @@ struct VirtioMemSystemReset {
>   
>   struct VirtIOMEMClass {
>       /* private */
> -    VirtIODevice parent;
> +    VirtioDeviceClass parent;

Reviewed-by: David Hildenbrand <david@redhat.com>

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?

-- 
Cheers,

David / dhildenb