aboutsummaryrefslogtreecommitdiff
path: root/contrib/vhost-user-gpu/vugpu.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2021-02-04 14:52:15 +0400
committerGerd Hoffmann <kraxel@redhat.com>2021-02-04 15:58:54 +0100
commit72e631c6ac72363924f6c7030a99a7900d15451e (patch)
tree0e15e514be6dad1ab8a00ab82245907a33950631 /contrib/vhost-user-gpu/vugpu.h
parent1f83ea8dbd9b9698767770746b92ff7a9ccb9636 (diff)
vhost-user-gpu: use an extandable state enum for commands
Introduce a pending state for commands which aren't finished yet, but are being handled. See following patch. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210204105232.834642-4-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'contrib/vhost-user-gpu/vugpu.h')
-rw-r--r--contrib/vhost-user-gpu/vugpu.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h
index 86f3ac86aa..04d5615812 100644
--- a/contrib/vhost-user-gpu/vugpu.h
+++ b/contrib/vhost-user-gpu/vugpu.h
@@ -129,12 +129,18 @@ typedef struct VuGpu {
QTAILQ_HEAD(, virtio_gpu_ctrl_command) fenceq;
} VuGpu;
+enum {
+ VG_CMD_STATE_NEW,
+ VG_CMD_STATE_PENDING,
+ VG_CMD_STATE_FINISHED,
+};
+
struct virtio_gpu_ctrl_command {
VuVirtqElement elem;
VuVirtq *vq;
struct virtio_gpu_ctrl_hdr cmd_hdr;
uint32_t error;
- bool finished;
+ int state;
QTAILQ_ENTRY(virtio_gpu_ctrl_command) next;
};