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:
Christophe Fergeau 2017-04-10 11:06:44 +02:00
parent ecdef4930b
commit 968f3ab3e8
2 changed files with 13 additions and 1 deletions

View File

@ -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);

View File

@ -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,