mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-09 22:36:29 +00:00
reds: Move RedsState typedef to red-common.h
This allows to stop using struct RedsState * rather than RedsState * in headers which cannot include reds.h. This also allows to remove the duplicate RedsState typedef in reds.h and reds-stream.h which is causing issues with older gcc versions.
This commit is contained in:
parent
852a9824a1
commit
e37f97a9f8
@ -119,8 +119,6 @@ void red_char_device_set_callbacks(RedCharDevice *dev,
|
||||
*
|
||||
* */
|
||||
|
||||
struct RedsState;
|
||||
|
||||
/* buffer that is used for writing to the device */
|
||||
typedef struct RedCharDeviceWriteBuffer {
|
||||
RingItem link;
|
||||
@ -170,7 +168,7 @@ struct RedCharDeviceCallbacks {
|
||||
};
|
||||
|
||||
RedCharDevice *red_char_device_create(SpiceCharDeviceInstance *sin,
|
||||
struct RedsState *reds,
|
||||
RedsState *reds,
|
||||
uint32_t client_tokens_interval,
|
||||
uint32_t self_tokens,
|
||||
RedCharDeviceCallbacks *cbs,
|
||||
@ -253,10 +251,10 @@ void red_char_device_write_buffer_release(RedCharDevice *dev,
|
||||
|
||||
/* api for specific char devices */
|
||||
|
||||
RedCharDevice *spicevmc_device_connect(struct RedsState *reds,
|
||||
RedCharDevice *spicevmc_device_connect(RedsState *reds,
|
||||
SpiceCharDeviceInstance *sin,
|
||||
uint8_t channel_type);
|
||||
void spicevmc_device_disconnect(struct RedsState *reds,
|
||||
void spicevmc_device_disconnect(RedsState *reds,
|
||||
SpiceCharDeviceInstance *char_device);
|
||||
|
||||
SpiceCharDeviceInterface *spice_char_device_get_interface(SpiceCharDeviceInstance *instance);
|
||||
|
||||
@ -32,8 +32,6 @@
|
||||
#define MAIN_CHANNEL_RECEIVE_BUF_SIZE \
|
||||
(4096 + (REDS_AGENT_WINDOW_SIZE + REDS_NUM_INTERNAL_AGENT_MESSAGES) * SPICE_AGENT_MAX_DATA_SIZE)
|
||||
|
||||
struct RedsState;
|
||||
|
||||
struct RedsMigSpice {
|
||||
char *host;
|
||||
char *cert_subject;
|
||||
@ -50,7 +48,7 @@ typedef struct MainChannel {
|
||||
} MainChannel;
|
||||
|
||||
|
||||
MainChannel *main_channel_new(struct RedsState *reds);
|
||||
MainChannel *main_channel_new(RedsState *reds);
|
||||
RedClient *main_channel_get_client_by_link_id(MainChannel *main_chan, uint32_t link_id);
|
||||
/* This is a 'clone' from the reds.h Channel.link callback to allow passing link_id */
|
||||
MainChannelClient *main_channel_link(MainChannel *, RedClient *client,
|
||||
|
||||
@ -47,8 +47,6 @@
|
||||
The intention is to move towards one channel interface gradually.
|
||||
At the final stage, this interface shouldn't be exposed. Only RedChannel will use it. */
|
||||
|
||||
struct RedsState;
|
||||
|
||||
typedef struct SpiceDataHeaderOpaque SpiceDataHeaderOpaque;
|
||||
|
||||
typedef uint16_t (*get_msg_type_proc)(SpiceDataHeaderOpaque *header);
|
||||
@ -339,7 +337,7 @@ struct RedChannel {
|
||||
|
||||
// TODO: when different channel_clients are in different threads from Channel -> need to protect!
|
||||
pthread_t thread_id;
|
||||
struct RedsState *reds;
|
||||
RedsState *reds;
|
||||
#ifdef RED_STATISTICS
|
||||
StatNodeRef stat;
|
||||
uint64_t *out_bytes_counter;
|
||||
@ -362,7 +360,7 @@ struct RedChannel {
|
||||
/* if one of the callbacks should cause disconnect, use red_channel_shutdown and don't
|
||||
* explicitly destroy the channel */
|
||||
RedChannel *red_channel_create(int size,
|
||||
struct RedsState *reds,
|
||||
RedsState *reds,
|
||||
const SpiceCoreInterfaceInternal *core,
|
||||
uint32_t type, uint32_t id,
|
||||
int handle_acks,
|
||||
@ -373,7 +371,7 @@ RedChannel *red_channel_create(int size,
|
||||
/* alternative constructor, meant for marshaller based (inputs,main) channels,
|
||||
* will become default eventually */
|
||||
RedChannel *red_channel_create_parser(int size,
|
||||
struct RedsState *reds,
|
||||
RedsState *reds,
|
||||
const SpiceCoreInterfaceInternal *core,
|
||||
uint32_t type, uint32_t id,
|
||||
int handle_acks,
|
||||
@ -396,7 +394,7 @@ RedChannelClient *red_channel_client_create(int size, RedChannel *channel, RedCl
|
||||
// TODO: tmp, for channels that don't use RedChannel yet (e.g., snd channel), but
|
||||
// do use the client callbacks. So the channel clients are not connected (the channel doesn't
|
||||
// have list of them, but they do have a link to the channel, and the client has a list of them)
|
||||
RedChannel *red_channel_create_dummy(int size, struct RedsState *reds, uint32_t type, uint32_t id);
|
||||
RedChannel *red_channel_create_dummy(int size, RedsState *reds, uint32_t type, uint32_t id);
|
||||
RedChannelClient *red_channel_client_create_dummy(int size,
|
||||
RedChannel *channel,
|
||||
RedClient *client,
|
||||
@ -569,7 +567,7 @@ void red_channel_apply_clients(RedChannel *channel, channel_client_callback v);
|
||||
struct RedsState* red_channel_get_server(RedChannel *channel);
|
||||
|
||||
struct RedClient {
|
||||
struct RedsState *reds;
|
||||
RedsState *reds;
|
||||
RingItem link;
|
||||
Ring channels;
|
||||
int channels_num;
|
||||
@ -591,7 +589,7 @@ struct RedClient {
|
||||
int refs;
|
||||
};
|
||||
|
||||
RedClient *red_client_new(struct RedsState *reds, int migrated);
|
||||
RedClient *red_client_new(RedsState *reds, int migrated);
|
||||
|
||||
/*
|
||||
* disconnects all the client's channels (should be called from the client's thread)
|
||||
|
||||
@ -58,4 +58,6 @@ struct SpiceCoreInterfaceInternal {
|
||||
|
||||
extern SpiceCoreInterfaceInternal event_loop_core;
|
||||
|
||||
typedef struct RedsState RedsState;
|
||||
|
||||
#endif
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
#include "spice.h"
|
||||
#include "common/mem.h"
|
||||
#include "red-common.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
@ -28,7 +29,6 @@
|
||||
typedef void (*AsyncReadDone)(void *opaque);
|
||||
typedef void (*AsyncReadError)(void *opaque, int err);
|
||||
|
||||
typedef struct RedsState RedsState;
|
||||
typedef struct RedsStream RedsStream;
|
||||
typedef struct RedsStreamPrivate RedsStreamPrivate;
|
||||
|
||||
|
||||
@ -32,8 +32,6 @@
|
||||
#include "main-dispatcher.h"
|
||||
#include "migration-protocol.h"
|
||||
|
||||
typedef struct RedsState RedsState;
|
||||
|
||||
static inline QXLInterface * qxl_get_interface(QXLInstance *qxl)
|
||||
{
|
||||
return SPICE_CONTAINEROF(qxl->base.sif, QXLInterface, base);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user