[PATCH v2 29/58] vhost-user-gpu: Move QOM macro to header

Eduardo Habkost posted 58 patches 5 years, 5 months ago
There is a newer version of this series
[PATCH v2 29/58] vhost-user-gpu: Move QOM macro to header
Posted by Eduardo Habkost 5 years, 5 months ago
Move the VHOST_USER_GPU type checking macro to virtio-gpu.h,
close to the TYPE_VHOST_USER_GPU #define.

This will make future conversion to OBJECT_DECLARE* easier.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes series v1 -> v2: new patch in series v2

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
---
 include/hw/virtio/virtio-gpu.h | 2 ++
 hw/display/vhost-user-gpu.c    | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 6dd57f2025..7517438e10 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -36,6 +36,8 @@
         OBJECT_CHECK(VirtIOGPU, (obj), TYPE_VIRTIO_GPU)
 
 #define TYPE_VHOST_USER_GPU "vhost-user-gpu"
+#define VHOST_USER_GPU(obj)                                    \
+    OBJECT_CHECK(VhostUserGPU, (obj), TYPE_VHOST_USER_GPU)
 
 #define VIRTIO_ID_GPU 16
 
diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c
index 4cdaee1bde..51f1747c4a 100644
--- a/hw/display/vhost-user-gpu.c
+++ b/hw/display/vhost-user-gpu.c
@@ -17,9 +17,6 @@
 #include "qapi/error.h"
 #include "migration/blocker.h"
 
-#define VHOST_USER_GPU(obj)                                    \
-    OBJECT_CHECK(VhostUserGPU, (obj), TYPE_VHOST_USER_GPU)
-
 typedef enum VhostUserGpuRequest {
     VHOST_USER_GPU_NONE = 0,
     VHOST_USER_GPU_GET_PROTOCOL_FEATURES,
-- 
2.26.2


Re: [PATCH v2 29/58] vhost-user-gpu: Move QOM macro to header
Posted by Gerd Hoffmann 5 years, 5 months ago
On Wed, Aug 19, 2020 at 08:12:07PM -0400, Eduardo Habkost wrote:
> Move the VHOST_USER_GPU type checking macro to virtio-gpu.h,
> close to the TYPE_VHOST_USER_GPU #define.
> 
> This will make future conversion to OBJECT_DECLARE* easier.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>


Re: [PATCH v2 29/58] vhost-user-gpu: Move QOM macro to header
Posted by Daniel P. Berrangé 5 years, 5 months ago
On Wed, Aug 19, 2020 at 08:12:07PM -0400, Eduardo Habkost wrote:
> Move the VHOST_USER_GPU type checking macro to virtio-gpu.h,
> close to the TYPE_VHOST_USER_GPU #define.
> 
> This will make future conversion to OBJECT_DECLARE* easier.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes series v1 -> v2: new patch in series v2
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  include/hw/virtio/virtio-gpu.h | 2 ++
>  hw/display/vhost-user-gpu.c    | 3 ---
>  2 files changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|