mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 12:09:58 +00:00
3e866365e1
A new vhost user message is added to allow QEMU to ask to vhost user backend to broadcast a fake RARP after live migration for guest without GUEST_ANNOUNCE capability. This new message is sent only if the backend supports the new VHOST_USER_PROTOCOL_F_RARP protocol feature. The payload of this new message is the MAC address of the guest (not known by the backend). The MAC address is copied in the first 6 bytes of a u64 to avoid to create a new payload message type. This new message has no equivalent ioctl so a new callback is added in the userOps structure to send the request. Upon reception of this new message the vhost user backend must generate and broadcast a fake RARP request to notify the migration is terminated. Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com> [Rebased and fixed checkpatch errors - Marc-André] Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
35 lines
1.1 KiB
C
35 lines
1.1 KiB
C
#ifndef VHOST_NET_H
|
|
#define VHOST_NET_H
|
|
|
|
#include "net/net.h"
|
|
#include "hw/virtio/vhost-backend.h"
|
|
|
|
struct vhost_net;
|
|
typedef struct vhost_net VHostNetState;
|
|
|
|
typedef struct VhostNetOptions {
|
|
VhostBackendType backend_type;
|
|
NetClientState *net_backend;
|
|
void *opaque;
|
|
} VhostNetOptions;
|
|
|
|
uint64_t vhost_net_get_max_queues(VHostNetState *net);
|
|
struct vhost_net *vhost_net_init(VhostNetOptions *options);
|
|
|
|
int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, int total_queues);
|
|
void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, int total_queues);
|
|
|
|
void vhost_net_cleanup(VHostNetState *net);
|
|
|
|
uint64_t vhost_net_get_features(VHostNetState *net, uint64_t features);
|
|
void vhost_net_ack_features(VHostNetState *net, uint64_t features);
|
|
|
|
bool vhost_net_virtqueue_pending(VHostNetState *net, int n);
|
|
void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
|
|
int idx, bool mask);
|
|
int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr);
|
|
VHostNetState *get_vhost_net(NetClientState *nc);
|
|
|
|
int vhost_set_vring_enable(NetClientState * nc, int enable);
|
|
#endif
|