mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-24 17:01:43 +00:00
s/CoreInterface/SpiceCoreInterface/
This commit is contained in:
parent
30c740201d
commit
10e6d8b53c
@ -228,7 +228,8 @@ static void red_channel_peer_on_out_msg_done(void *opaque)
|
||||
}
|
||||
}
|
||||
|
||||
RedChannel *red_channel_create(int size, RedsStreamContext *peer, CoreInterface *core,
|
||||
RedChannel *red_channel_create(int size, RedsStreamContext *peer,
|
||||
SpiceCoreInterface *core,
|
||||
int migrate, int handle_acks,
|
||||
channel_configure_socket_proc config_socket,
|
||||
channel_disconnect_proc disconnect,
|
||||
|
||||
@ -101,7 +101,7 @@ typedef void (*channel_release_pipe_item_proc)(RedChannel *channel,
|
||||
|
||||
struct RedChannel {
|
||||
RedsStreamContext *peer;
|
||||
CoreInterface *core;
|
||||
SpiceCoreInterface *core;
|
||||
int migrate;
|
||||
int handle_acks;
|
||||
|
||||
@ -141,7 +141,8 @@ 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, RedsStreamContext *peer, CoreInterface *core,
|
||||
RedChannel *red_channel_create(int size, RedsStreamContext *peer,
|
||||
SpiceCoreInterface *core,
|
||||
int migrate, int handle_acks,
|
||||
channel_configure_socket_proc config_socket,
|
||||
channel_disconnect_proc disconnect,
|
||||
|
||||
@ -534,7 +534,7 @@ struct TunnelWorker {
|
||||
Channel channel_interface; // for reds
|
||||
TunnelChannel *channel;
|
||||
|
||||
CoreInterface *core_interface;
|
||||
SpiceCoreInterface *core_interface;
|
||||
NetWireInterface *vlan_interface;
|
||||
RedSlirpNetworkInterface tunnel_interface;
|
||||
RedSlirpNetworkInterface null_interface;
|
||||
@ -970,7 +970,8 @@ static void tunnel_send_packet(void *opaque_tunnel, const uint8_t *pkt, int pkt_
|
||||
net_slirp_input(pkt, pkt_len);
|
||||
}
|
||||
|
||||
void *red_tunnel_attach(CoreInterface *core_interface, NetWireInterface *vlan_interface)
|
||||
void *red_tunnel_attach(SpiceCoreInterface *core_interface,
|
||||
NetWireInterface *vlan_interface)
|
||||
{
|
||||
TunnelWorker *worker = spice_new0(TunnelWorker, 1);
|
||||
|
||||
|
||||
@ -24,6 +24,6 @@
|
||||
|
||||
#include "vd_interface.h"
|
||||
|
||||
void *red_tunnel_attach(CoreInterface *core_interface, NetWireInterface *vlan_interface);
|
||||
void *red_tunnel_attach(SpiceCoreInterface *core_interface, NetWireInterface *vlan_interface);
|
||||
|
||||
#endif
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
#include "red_tunnel_worker.h"
|
||||
#endif
|
||||
|
||||
CoreInterface *core = NULL;
|
||||
SpiceCoreInterface *core = NULL;
|
||||
static MigrationInterface *mig = NULL;
|
||||
static KeyboardInterface *keyboard = NULL;
|
||||
static MouseInterface *mouse = NULL;
|
||||
@ -4267,11 +4267,11 @@ static void init_vd_agent_resources()
|
||||
|
||||
const char *version_string = VERSION;
|
||||
|
||||
static void do_spice_init(CoreInterface *core_interface)
|
||||
static void do_spice_init(SpiceCoreInterface *core_interface)
|
||||
{
|
||||
red_printf("starting %s", version_string);
|
||||
|
||||
if (core_interface->base.major_version != VD_INTERFACE_CORE_MAJOR) {
|
||||
if (core_interface->base.major_version != SPICE_INTERFACE_CORE_MAJOR) {
|
||||
red_error("bad core interface version");
|
||||
}
|
||||
core = core_interface;
|
||||
@ -4335,12 +4335,6 @@ static void do_spice_init(CoreInterface *core_interface)
|
||||
atexit(reds_exit);
|
||||
}
|
||||
|
||||
__visible__ void spice_init(CoreInterface *core_interface)
|
||||
{
|
||||
spice_server_new();
|
||||
do_spice_init(core_interface);
|
||||
}
|
||||
|
||||
/* new interface */
|
||||
__visible__ SpiceServer *spice_server_new(void)
|
||||
{
|
||||
@ -4351,7 +4345,7 @@ __visible__ SpiceServer *spice_server_new(void)
|
||||
return reds;
|
||||
}
|
||||
|
||||
__visible__ int spice_server_init(SpiceServer *s, CoreInterface *core)
|
||||
__visible__ int spice_server_init(SpiceServer *s, SpiceCoreInterface *core)
|
||||
{
|
||||
ASSERT(reds == s);
|
||||
do_spice_init(core);
|
||||
|
||||
@ -67,7 +67,7 @@ void reds_set_client_mouse_allowed(int is_client_mouse_allowed,
|
||||
void reds_register_channel(Channel *channel);
|
||||
void reds_unregister_channel(Channel *channel);
|
||||
|
||||
extern struct CoreInterface *core;
|
||||
extern struct SpiceCoreInterface *core;
|
||||
extern uint64_t bitrate_per_sec;
|
||||
|
||||
#define IS_LOW_BANDWIDTH() (bitrate_per_sec < 10 * 1024 * 1024)
|
||||
|
||||
@ -21,13 +21,10 @@
|
||||
#include <sys/socket.h>
|
||||
#include "vd_interface.h"
|
||||
|
||||
/* old interface */
|
||||
void spice_init(CoreInterface *core);
|
||||
|
||||
/* new interface */
|
||||
typedef struct RedsState SpiceServer;
|
||||
SpiceServer *spice_server_new(void);
|
||||
int spice_server_init(SpiceServer *s, CoreInterface *core);
|
||||
int spice_server_init(SpiceServer *s, SpiceCoreInterface *core);
|
||||
void spice_server_destroy(SpiceServer *s);
|
||||
|
||||
#define SPICE_ADDR_FLAG_IPV4_ONLY (1 << 0)
|
||||
|
||||
@ -50,14 +50,10 @@ struct SpiceBaseInstance {
|
||||
SpiceBaseInterface *sif;
|
||||
};
|
||||
|
||||
#define VD_INTERFACE_CORE "core"
|
||||
#define VD_INTERFACE_CORE_MAJOR 1
|
||||
#define VD_INTERFACE_CORE_MINOR 2
|
||||
typedef struct CoreInterface CoreInterface;
|
||||
typedef enum {
|
||||
VD_INTERFACE_ADDING,
|
||||
VD_INTERFACE_REMOVING,
|
||||
} SpiceBaseInterfaceChangeType;
|
||||
#define SPICE_INTERFACE_CORE "core"
|
||||
#define SPICE_INTERFACE_CORE_MAJOR 1
|
||||
#define SPICE_INTERFACE_CORE_MINOR 2
|
||||
typedef struct SpiceCoreInterface SpiceCoreInterface;
|
||||
|
||||
typedef enum {
|
||||
VD_LOG_ERROR = 1,
|
||||
@ -65,9 +61,6 @@ typedef enum {
|
||||
VD_LOG_INFO,
|
||||
} LogLevel;
|
||||
|
||||
typedef void (*vd_interface_change_notifier_t)(void *opaque, SpiceBaseInterface *interface,
|
||||
SpiceBaseInterfaceChangeType change);
|
||||
|
||||
#define SPICE_WATCH_EVENT_READ (1 << 0)
|
||||
#define SPICE_WATCH_EVENT_WRITE (1 << 1)
|
||||
|
||||
@ -77,7 +70,7 @@ typedef void (*SpiceWatchFunc)(int fd, int event, void *opaque);
|
||||
typedef struct SpiceTimer SpiceTimer;
|
||||
typedef void (*SpiceTimerFunc)(void *opaque);
|
||||
|
||||
struct CoreInterface {
|
||||
struct SpiceCoreInterface {
|
||||
SpiceBaseInterface base;
|
||||
|
||||
SpiceTimer *(*timer_add)(SpiceTimerFunc func, void *opaque);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user