mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: Add support for keepalive messages during p2p migration
This commit is contained in:
parent
6e945da567
commit
1e62643719
@ -52,6 +52,8 @@ module Libvirtd_qemu =
|
|||||||
| int_entry "max_processes"
|
| int_entry "max_processes"
|
||||||
| str_entry "lock_manager"
|
| str_entry "lock_manager"
|
||||||
| int_entry "max_queued"
|
| int_entry "max_queued"
|
||||||
|
| int_entry "keepalive_interval"
|
||||||
|
| int_entry "keepalive_count"
|
||||||
|
|
||||||
(* Each enty in the config is one of the following three ... *)
|
(* Each enty in the config is one of the following three ... *)
|
||||||
let entry = vnc_entry
|
let entry = vnc_entry
|
||||||
|
@ -317,3 +317,25 @@
|
|||||||
# Note, that job lock is per domain.
|
# Note, that job lock is per domain.
|
||||||
#
|
#
|
||||||
# max_queued = 0
|
# max_queued = 0
|
||||||
|
|
||||||
|
###################################################################
|
||||||
|
# Keepalive protocol:
|
||||||
|
# This allows qemu driver to detect broken connections to remote
|
||||||
|
# libvirtd during peer-to-peer migration. A keepalive message is
|
||||||
|
# sent to the deamon after keepalive_interval seconds of inactivity
|
||||||
|
# to check if the deamon is still responding; keepalive_count is a
|
||||||
|
# maximum number of keepalive messages that are allowed to be sent
|
||||||
|
# to the deamon without getting any response before the connection
|
||||||
|
# is considered broken. In other words, the connection is
|
||||||
|
# automatically closed approximately after
|
||||||
|
# keepalive_interval * (keepalive_count + 1) seconds since the last
|
||||||
|
# message received from the deamon. If keepalive_interval is set to
|
||||||
|
# -1, qemu driver will not send keepalive requests during
|
||||||
|
# peer-to-peer migration; however, the remote libvirtd can still
|
||||||
|
# send them and source libvirtd will send responses. When
|
||||||
|
# keepalive_count is set to 0, connections will be automatically
|
||||||
|
# closed after keepalive_interval seconds of inactivity without
|
||||||
|
# sending any keepalive messages.
|
||||||
|
#
|
||||||
|
#keepalive_interval = 5
|
||||||
|
#keepalive_count = 5
|
||||||
|
@ -115,6 +115,9 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
|
|||||||
virLockManagerPluginNew("nop", NULL, 0)))
|
virLockManagerPluginNew("nop", NULL, 0)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
driver->keepAliveInterval = 5;
|
||||||
|
driver->keepAliveCount = 5;
|
||||||
|
|
||||||
/* Just check the file is readable before opening it, otherwise
|
/* Just check the file is readable before opening it, otherwise
|
||||||
* libvirt emits an error.
|
* libvirt emits an error.
|
||||||
*/
|
*/
|
||||||
@ -460,6 +463,14 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
|
|||||||
CHECK_TYPE("max_queued", VIR_CONF_LONG);
|
CHECK_TYPE("max_queued", VIR_CONF_LONG);
|
||||||
if (p) driver->max_queued = p->l;
|
if (p) driver->max_queued = p->l;
|
||||||
|
|
||||||
|
p = virConfGetValue(conf, "keepalive_interval");
|
||||||
|
CHECK_TYPE("keepalive_interval", VIR_CONF_LONG);
|
||||||
|
if (p) driver->keepAliveInterval = p->l;
|
||||||
|
|
||||||
|
p = virConfGetValue(conf, "keepalive_count");
|
||||||
|
CHECK_TYPE("keepalive_count", VIR_CONF_LONG);
|
||||||
|
if (p) driver->keepAliveCount = p->l;
|
||||||
|
|
||||||
virConfFree (conf);
|
virConfFree (conf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,9 @@ struct qemud_driver {
|
|||||||
* of guests which will be automatically killed
|
* of guests which will be automatically killed
|
||||||
* when the virConnectPtr is closed*/
|
* when the virConnectPtr is closed*/
|
||||||
virHashTablePtr autodestroy;
|
virHashTablePtr autodestroy;
|
||||||
|
|
||||||
|
int keepAliveInterval;
|
||||||
|
unsigned int keepAliveCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _qemuDomainCmdlineDef qemuDomainCmdlineDef;
|
typedef struct _qemuDomainCmdlineDef qemuDomainCmdlineDef;
|
||||||
|
@ -2222,6 +2222,10 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (virConnectSetKeepAlive(dconn, driver->keepAliveInterval,
|
||||||
|
driver->keepAliveCount) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
qemuDomainObjEnterRemoteWithDriver(driver, vm);
|
qemuDomainObjEnterRemoteWithDriver(driver, vm);
|
||||||
p2p = VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
|
p2p = VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn,
|
||||||
VIR_DRV_FEATURE_MIGRATION_P2P);
|
VIR_DRV_FEATURE_MIGRATION_P2P);
|
||||||
|
@ -115,6 +115,9 @@ vnc_auto_unix_socket = 1
|
|||||||
max_processes = 12345
|
max_processes = 12345
|
||||||
|
|
||||||
lock_manager = \"fcntl\"
|
lock_manager = \"fcntl\"
|
||||||
|
|
||||||
|
keepalive_interval = 1
|
||||||
|
keepalive_count = 42
|
||||||
"
|
"
|
||||||
|
|
||||||
test Libvirtd_qemu.lns get conf =
|
test Libvirtd_qemu.lns get conf =
|
||||||
@ -240,3 +243,6 @@ lock_manager = \"fcntl\"
|
|||||||
{ "max_processes" = "12345" }
|
{ "max_processes" = "12345" }
|
||||||
{ "#empty" }
|
{ "#empty" }
|
||||||
{ "lock_manager" = "fcntl" }
|
{ "lock_manager" = "fcntl" }
|
||||||
|
{ "#empty" }
|
||||||
|
{ "keepalive_interval" = "1" }
|
||||||
|
{ "keepalive_count" = "42" }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user