mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
COLO-compare: Add new parameter to communicate with remote colo-frame
We add the "notify_dev=chardevID" parameter. After that colo-compare can connect with remote(currently just for Xen, KVM-COLO didn't need it.) colo-frame through chardev socket, it can notify remote(Xen) colo-frame to handle checkpoint event. Signed-off-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
aa9c6fa757
commit
cf6af766f4
2 changed files with 53 additions and 1 deletions
|
@ -83,6 +83,7 @@ typedef struct CompareState {
|
|||
char *pri_indev;
|
||||
char *sec_indev;
|
||||
char *outdev;
|
||||
char *notify_dev;
|
||||
CharBackend chr_pri_in;
|
||||
CharBackend chr_sec_in;
|
||||
CharBackend chr_out;
|
||||
|
@ -897,6 +898,21 @@ static void compare_set_vnet_hdr(Object *obj,
|
|||
s->vnet_hdr = value;
|
||||
}
|
||||
|
||||
static char *compare_get_notify_dev(Object *obj, Error **errp)
|
||||
{
|
||||
CompareState *s = COLO_COMPARE(obj);
|
||||
|
||||
return g_strdup(s->notify_dev);
|
||||
}
|
||||
|
||||
static void compare_set_notify_dev(Object *obj, const char *value, Error **errp)
|
||||
{
|
||||
CompareState *s = COLO_COMPARE(obj);
|
||||
|
||||
g_free(s->notify_dev);
|
||||
s->notify_dev = g_strdup(value);
|
||||
}
|
||||
|
||||
static void compare_pri_rs_finalize(SocketReadState *pri_rs)
|
||||
{
|
||||
CompareState *s = container_of(pri_rs, CompareState, pri_rs);
|
||||
|
@ -1057,6 +1073,10 @@ static void colo_compare_init(Object *obj)
|
|||
(Object **)&s->iothread,
|
||||
object_property_allow_set_link,
|
||||
OBJ_PROP_LINK_STRONG, NULL);
|
||||
/* This parameter just for Xen COLO */
|
||||
object_property_add_str(obj, "notify_dev",
|
||||
compare_get_notify_dev, compare_set_notify_dev,
|
||||
NULL);
|
||||
|
||||
s->vnet_hdr = false;
|
||||
object_property_add_bool(obj, "vnet_hdr_support", compare_get_vnet_hdr,
|
||||
|
@ -1103,6 +1123,7 @@ static void colo_compare_finalize(Object *obj)
|
|||
g_free(s->pri_indev);
|
||||
g_free(s->sec_indev);
|
||||
g_free(s->outdev);
|
||||
g_free(s->notify_dev);
|
||||
}
|
||||
|
||||
static const TypeInfo colo_compare_info = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue