mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
Add RedCharDeviceWriteBufferPrivate
This is intended to hold the fields that only char-device.c has a use for, but for now this only adds the boilerplate for it, the next commit will move the relevant field there. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
ecdef4930b
commit
968f3ab3e8
@ -31,6 +31,9 @@
|
||||
#define RED_CHAR_DEVICE_WAIT_TOKENS_TIMEOUT 30000
|
||||
#define MAX_POOL_SIZE (10 * 64 * 1024)
|
||||
|
||||
struct RedCharDeviceWriteBufferPrivate {
|
||||
};
|
||||
|
||||
typedef struct RedCharDeviceClient RedCharDeviceClient;
|
||||
struct RedCharDeviceClient {
|
||||
RedCharDevice *dev;
|
||||
@ -539,7 +542,13 @@ static RedCharDeviceWriteBuffer *__red_char_device_write_buffer_get(
|
||||
if (ret) {
|
||||
dev->priv->cur_pool_size -= ret->buf_size;
|
||||
} else {
|
||||
ret = spice_new0(RedCharDeviceWriteBuffer, 1);
|
||||
struct RedCharDeviceWriteBufferFull {
|
||||
RedCharDeviceWriteBuffer buffer;
|
||||
RedCharDeviceWriteBufferPrivate priv;
|
||||
} *write_buf;
|
||||
write_buf = spice_new0(struct RedCharDeviceWriteBufferFull, 1);
|
||||
ret = &write_buf->buffer;
|
||||
ret->priv = &write_buf->priv;
|
||||
}
|
||||
|
||||
spice_assert(!ret->buf_used);
|
||||
|
||||
@ -146,6 +146,7 @@ GType red_char_device_get_type(void) G_GNUC_CONST;
|
||||
* */
|
||||
|
||||
/* buffer that is used for writing to the device */
|
||||
typedef struct RedCharDeviceWriteBufferPrivate RedCharDeviceWriteBufferPrivate;
|
||||
typedef struct RedCharDeviceWriteBuffer {
|
||||
int origin;
|
||||
RedClient *client; /* The client that sent the message to the device.
|
||||
@ -156,6 +157,8 @@ typedef struct RedCharDeviceWriteBuffer {
|
||||
uint32_t buf_used;
|
||||
uint32_t token_price;
|
||||
uint32_t refs;
|
||||
|
||||
RedCharDeviceWriteBufferPrivate *priv;
|
||||
} RedCharDeviceWriteBuffer;
|
||||
|
||||
void red_char_device_reset_dev_instance(RedCharDevice *dev,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user