Pass source VM UUID (if known) to backend
Some backends (not yet implemented) which talk to management layers will have mappings for what VMs can control what other VMs. So, the source VM UUID of the original request needs to be sent along with the target VM UUID to the management layer for arbitration. Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
This commit is contained in:
parent
c8f8fc2900
commit
2635e075b9
@ -1,6 +1,6 @@
|
||||
/* */
|
||||
#define PLUGIN_VERSION_LISTENER ((double)0.1)
|
||||
#define PLUGIN_VERSION_BACKEND ((double)0.1)
|
||||
#define PLUGIN_VERSION_LISTENER ((double)0.2)
|
||||
#define PLUGIN_VERSION_BACKEND ((double)0.2)
|
||||
|
||||
#define LISTENER_VER_SYM listener_plugin_version
|
||||
#define BACKEND_VER_SYM backend_plugin_version
|
||||
@ -26,18 +26,18 @@ typedef int (*fence_null_callback)(const char *vm_name,
|
||||
|
||||
/* Turn the VM 'off'. Returns 0 to caller if successful or
|
||||
nonzero if unsuccessful. */
|
||||
typedef int (*fence_off_callback)(const char *vm_name, uint32_t seqno,
|
||||
void *priv);
|
||||
typedef int (*fence_off_callback)(const char *vm_name, const char *src,
|
||||
uint32_t seqno, void *priv);
|
||||
|
||||
/* Turn the VM 'on'. Returns 0 to caller if successful or
|
||||
nonzero if unsuccessful. */
|
||||
typedef int (*fence_on_callback)(const char *vm_name, uint32_t seqno,
|
||||
void *priv);
|
||||
typedef int (*fence_on_callback)(const char *vm_name, const char *src,
|
||||
uint32_t seqno, void *priv);
|
||||
|
||||
/* Reboot a VM. Returns 0 to caller if successful or
|
||||
nonzero if unsuccessful. */
|
||||
typedef int (*fence_reboot_callback)(const char *vm_name, uint32_t seqno,
|
||||
void *priv);
|
||||
typedef int (*fence_reboot_callback)(const char *vm_name, const char *src,
|
||||
uint32_t seqno, void *priv);
|
||||
|
||||
/* Get status of a VM. Returns 0 to caller if VM is alive or
|
||||
nonzero if VM is not alive. */
|
||||
|
@ -602,7 +602,8 @@ checkpoint_null(const char *vm_name, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
checkpoint_off(const char *vm_name, uint32_t seqno, void *priv)
|
||||
checkpoint_off(const char *vm_name, const char *src,
|
||||
uint32_t seqno, void *priv)
|
||||
{
|
||||
VALIDATE(priv);
|
||||
printf("[CKPT] OFF operation on %s seq %d\n", vm_name, seqno);
|
||||
@ -612,7 +613,8 @@ checkpoint_off(const char *vm_name, uint32_t seqno, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
checkpoint_on(const char *vm_name, uint32_t seqno, void *priv)
|
||||
checkpoint_on(const char *vm_name, const char *src,
|
||||
uint32_t seqno, void *priv)
|
||||
{
|
||||
VALIDATE(priv);
|
||||
printf("[CKPT] ON operation on %s seq %d\n", vm_name, seqno);
|
||||
@ -642,7 +644,8 @@ checkpoint_status(const char *vm_name, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
checkpoint_reboot(const char *vm_name, uint32_t seqno, void *priv)
|
||||
checkpoint_reboot(const char *vm_name, const char *src,
|
||||
uint32_t seqno, void *priv)
|
||||
{
|
||||
VALIDATE(priv);
|
||||
printf("[CKPT] REBOOT operation on %s seq %d\n", vm_name, seqno);
|
||||
|
@ -176,7 +176,7 @@ lq_null(const char *vm_name, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
lq_off(const char *vm_name, uint32_t seqno, void *priv)
|
||||
lq_off(const char *vm_name, const char *src, uint32_t seqno, void *priv)
|
||||
{
|
||||
VALIDATE(priv);
|
||||
printf("[libvirt-qpid] OFF operation on %s\n", vm_name);
|
||||
@ -188,7 +188,7 @@ lq_off(const char *vm_name, uint32_t seqno, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
lq_on(const char *vm_name, uint32_t seqno, void *priv)
|
||||
lq_on(const char *vm_name, const char *src, uint32_t seqno, void *priv)
|
||||
{
|
||||
VALIDATE(priv);
|
||||
printf("[libvirt-qpid] ON operation on %s\n", vm_name);
|
||||
@ -218,15 +218,15 @@ lq_status(const char *vm_name, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
lq_reboot(const char *vm_name, uint32_t seqno, void *priv)
|
||||
lq_reboot(const char *vm_name, const char *src, uint32_t seqno, void *priv)
|
||||
{
|
||||
VALIDATE(priv);
|
||||
printf("[libvirt-qpid] REBOOT operation on %s\n", vm_name);
|
||||
|
||||
if (lq_off(vm_name, seqno, priv) != 0)
|
||||
if (lq_off(vm_name, src, seqno, priv) != 0)
|
||||
return 1;
|
||||
sleep(1);
|
||||
lq_on(vm_name, seqno, priv);
|
||||
lq_on(vm_name, src, seqno, priv);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -149,7 +149,8 @@ libvirt_null(const char *vm_name, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
libvirt_off(const char *vm_name, uint32_t seqno, void *priv)
|
||||
libvirt_off(const char *vm_name, const char *src,
|
||||
uint32_t seqno, void *priv)
|
||||
{
|
||||
struct libvirt_info *info = (struct libvirt_info *)priv;
|
||||
virDomainPtr vdp;
|
||||
@ -198,7 +199,8 @@ libvirt_off(const char *vm_name, uint32_t seqno, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
libvirt_on(const char *vm_name, uint32_t seqno, void *priv)
|
||||
libvirt_on(const char *vm_name, const char *src,
|
||||
uint32_t seqno, void *priv)
|
||||
{
|
||||
struct libvirt_info *info = (struct libvirt_info *)priv;
|
||||
virDomainPtr vdp;
|
||||
@ -288,7 +290,8 @@ libvirt_status(const char *vm_name, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
libvirt_reboot(const char *vm_name, uint32_t seqno, void *priv)
|
||||
libvirt_reboot(const char *vm_name, const char *src,
|
||||
uint32_t seqno, void *priv)
|
||||
{
|
||||
struct libvirt_info *info = (struct libvirt_info *)priv;
|
||||
virDomainPtr vdp, nvdp;
|
||||
|
@ -250,15 +250,15 @@ do_fence_request_tcp(fence_req_t *req, mcast_info *info)
|
||||
response = info->cb->null((char *)req->domain, info->priv);
|
||||
break;
|
||||
case FENCE_ON:
|
||||
response = info->cb->on((char *)req->domain, req->seqno,
|
||||
response = info->cb->on((char *)req->domain, NULL, req->seqno,
|
||||
info->priv);
|
||||
break;
|
||||
case FENCE_OFF:
|
||||
response = info->cb->off((char *)req->domain, req->seqno,
|
||||
response = info->cb->off((char *)req->domain, NULL, req->seqno,
|
||||
info->priv);
|
||||
break;
|
||||
case FENCE_REBOOT:
|
||||
response = info->cb->reboot((char *)req->domain, req->seqno,
|
||||
response = info->cb->reboot((char *)req->domain, NULL, req->seqno,
|
||||
info->priv);
|
||||
break;
|
||||
case FENCE_STATUS:
|
||||
|
@ -61,7 +61,7 @@ null_null(const char *vm_name, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
null_off(const char *vm_name, uint32_t seqno, void *priv)
|
||||
null_off(const char *vm_name, const char *src, uint32_t seqno, void *priv)
|
||||
{
|
||||
VALIDATE(priv);
|
||||
printf("[Null] OFF operation on %s\n", vm_name);
|
||||
@ -71,7 +71,7 @@ null_off(const char *vm_name, uint32_t seqno, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
null_on(const char *vm_name, uint32_t seqno, void *priv)
|
||||
null_on(const char *vm_name, const char *src, uint32_t seqno, void *priv)
|
||||
{
|
||||
VALIDATE(priv);
|
||||
printf("[Null] ON operation on %s\n", vm_name);
|
||||
@ -103,7 +103,7 @@ null_status(const char *vm_name, void *priv)
|
||||
|
||||
|
||||
static int
|
||||
null_reboot(const char *vm_name, uint32_t seqno, void *priv)
|
||||
null_reboot(const char *vm_name, const char *src, uint32_t seqno, void *priv)
|
||||
{
|
||||
VALIDATE(priv);
|
||||
printf("[Null] REBOOT operation on %s\n", vm_name);
|
||||
|
@ -178,8 +178,8 @@ do_fence_request(int fd, const char *src, serial_req_t *req, serial_info *info)
|
||||
response = RESP_PERM;
|
||||
break;
|
||||
}
|
||||
response = info->cb->on((char *)req->domain, req->seqno,
|
||||
info->priv);
|
||||
response = info->cb->on((char *)req->domain, src,
|
||||
req->seqno, info->priv);
|
||||
break;
|
||||
case FENCE_OFF:
|
||||
if (static_map_check(info->maps, src,
|
||||
@ -187,8 +187,8 @@ do_fence_request(int fd, const char *src, serial_req_t *req, serial_info *info)
|
||||
response = RESP_PERM;
|
||||
break;
|
||||
}
|
||||
response = info->cb->off((char *)req->domain, req->seqno,
|
||||
info->priv);
|
||||
response = info->cb->off((char *)req->domain, src,
|
||||
req->seqno, info->priv);
|
||||
break;
|
||||
case FENCE_REBOOT:
|
||||
if (static_map_check(info->maps, src,
|
||||
@ -196,8 +196,8 @@ do_fence_request(int fd, const char *src, serial_req_t *req, serial_info *info)
|
||||
response = RESP_PERM;
|
||||
break;
|
||||
}
|
||||
response = info->cb->reboot((char *)req->domain, req->seqno,
|
||||
info->priv);
|
||||
response = info->cb->reboot((char *)req->domain, src,
|
||||
req->seqno, info->priv);
|
||||
break;
|
||||
case FENCE_STATUS:
|
||||
response = info->cb->status((char *)req->domain, info->priv);
|
||||
|
Loading…
Reference in New Issue
Block a user