From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4581 invoked by alias); 17 Jun 2008 19:48:13 -0000 Received: (qmail 4547 invoked by uid 9476); 17 Jun 2008 19:48:12 -0000 Date: Tue, 17 Jun 2008 19:48:00 -0000 Message-ID: <20080617194812.4531.qmail@sourceware.org> From: lhh@sourceware.org To: cluster-cvs@sources.redhat.com, cluster-devel@redhat.com Subject: Cluster Project branch, STABLE2, updated. cluster-2.03.04-16-gc09bd25 X-Git-Refname: refs/heads/STABLE2 X-Git-Reftype: branch X-Git-Oldrev: a2c34ee98442ba23aac8dd3fe6d19b22f3d65b6d X-Git-Newrev: c09bd25b65204a44bf22aaec38fc66f7be66e038 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00500.txt.bz2 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project". http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=c09bd25b65204a44bf22aaec38fc66f7be66e038 The branch, STABLE2 has been updated via c09bd25b65204a44bf22aaec38fc66f7be66e038 (commit) via 82cce806f7052ce61d1f726a0e8e8c083db01da6 (commit) via 4a7e308a068daf2ab468dda47e5f819ec05d9517 (commit) from a2c34ee98442ba23aac8dd3fe6d19b22f3d65b6d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c09bd25b65204a44bf22aaec38fc66f7be66e038 Author: Lon Hohberger Date: Mon Nov 19 17:28:33 2007 +0000 Ancillary NOCLUSTER mode fixes for fence_xvmd commit 82cce806f7052ce61d1f726a0e8e8c083db01da6 Author: Lon Hohberger Date: Mon Nov 19 17:03:27 2007 +0000 Ancillary NOCLUSTER mode fixes for fence_xvmd commit 4a7e308a068daf2ab468dda47e5f819ec05d9517 Author: Lon Hohberger Date: Tue Jun 17 15:45:45 2008 -0400 Fix #362351 - make fence_xvmd work in no-cluster mode Resolve Conflicts: fence/agents/xvm/options.c ----------------------------------------------------------------------- Summary of changes: fence/agents/xvm/fence_xvmd.c | 37 +++++++++++++++++++++++++++++++------ fence/agents/xvm/options.c | 1 - fence/agents/xvm/xml.c | 2 ++ fence/man/fence_xvmd.8 | 7 +++++++ 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/fence/agents/xvm/fence_xvmd.c b/fence/agents/xvm/fence_xvmd.c index 2715ddc..e1f6638 100644 --- a/fence/agents/xvm/fence_xvmd.c +++ b/fence/agents/xvm/fence_xvmd.c @@ -200,15 +200,17 @@ wait_domain(fence_req_t *req, virConnectPtr vp, int timeout) int do_fence_request_tcp(fence_req_t *req, fence_auth_type_t auth, - void *key, size_t key_len, virConnectPtr vp) + void *key, size_t key_len, virConnectPtr vp, + int flags) { int fd = -1, ret = -1; virDomainPtr vdp; + virDomainInfo vdi; char response = 1; char *domain_desc, *domain_desc_sanitized; size_t sz; - if (!(vdp = get_domain(req, vp))) { + if (!(vdp = get_domain(req, vp)) && (!(flags & F_NOCLUSTER))) { dbg_printf(2, "Could not find domain: %s\n", req->domain); goto out; } @@ -227,6 +229,17 @@ do_fence_request_tcp(fence_req_t *req, fence_auth_type_t auth, break; case FENCE_OFF: printf("Destroying domain %s...\n", (char *)req->domain); + if (flags & F_NOCLUSTER) { + if (!vdp || + ((virDomainGetInfo(vdp, &vdi) == 0) && + (vdi.state == VIR_DOMAIN_SHUTOFF))) { + dbg_printf(2, "[NOCLUSTER] Nothing to " + "do - domain does not exist\n"); + response = 0; + break; + } + } + dbg_printf(2, "[OFF] Calling virDomainDestroy\n"); ret = virDomainDestroy(vdp); @@ -244,6 +257,18 @@ do_fence_request_tcp(fence_req_t *req, fence_auth_type_t auth, case FENCE_REBOOT: printf("Rebooting domain %s...\n", (char *)req->domain); + + if (flags & F_NOCLUSTER) { + if (!vdp || + ((virDomainGetInfo(vdp, &vdi) == 0) && + (vdi.state == VIR_DOMAIN_SHUTOFF))) { + dbg_printf(2, "[NOCLUSTER] Nothing to " + "do - domain does not exist\n"); + response = 0; + break; + } + } + domain_desc = virDomainGetXMLDesc(vdp, 0); if (domain_desc) { @@ -264,10 +289,10 @@ do_fence_request_tcp(fence_req_t *req, fence_auth_type_t auth, "libvirt\n"); } - dbg_printf(2, "[REBOOT] Calling virDomainDestroy\n"); + dbg_printf(2, "[REBOOT] Calling virDomainDestroy(%p)\n", vdp); ret = virDomainDestroy(vdp); if (ret < 0) { - printf("virDomainDestroy() failed: %d\n", ret); + printf("virDomainDestroy() failed: %d/%d\n", ret, errno); if (domain_desc) free(domain_desc); break; @@ -286,7 +311,7 @@ do_fence_request_tcp(fence_req_t *req, fence_auth_type_t auth, } break; } - + dbg_printf(3, "Sending response to caller...\n"); if (write(fd, &response, 1) < 0) { perror("write"); @@ -633,7 +658,7 @@ xvmd_loop(cman_handle_t ch, void *h, int fd, fence_xvm_args_t *args, case AUTH_SHA512: printf("Plain TCP request\n"); do_fence_request_tcp(&data, args->auth, key, - key_len, vp); + key_len, vp, args->flags); break; default: printf("XXX Unhandled authentication\n"); diff --git a/fence/agents/xvm/options.c b/fence/agents/xvm/options.c index 5bb1d7a..616b8db 100644 --- a/fence/agents/xvm/options.c +++ b/fence/agents/xvm/options.c @@ -253,7 +253,6 @@ assign_nocluster(fence_xvm_args_t *args, struct arg_info *arg, char *value) } - /** ALL valid command line and stdin arguments for this fencing agent */ static struct arg_info _arg_info[] = { { '\xff', NULL, "agent", diff --git a/fence/agents/xvm/xml.c b/fence/agents/xvm/xml.c index f313cc4..6a0308e 100644 --- a/fence/agents/xvm/xml.c +++ b/fence/agents/xvm/xml.c @@ -82,6 +82,8 @@ cleanup_xml_doc(xmlDocPtr doc) flip_graphics_port(doc); os_node = get_os_node(doc); + if (!os_node) + return -1; curr = os_node->children; while (curr) { diff --git a/fence/man/fence_xvmd.8 b/fence/man/fence_xvmd.8 index 5da7791..5a47211 100644 --- a/fence/man/fence_xvmd.8 +++ b/fence/man/fence_xvmd.8 @@ -74,6 +74,13 @@ parameters (because they are cluster-wide), so if you need to override a configuration option contained in CCS, you must specify this parameter. \fB-V\fP +.TP +\fB-L\fP +Local-only / non-cluster mode. When used with -X, this this option +prevents fence_xvmd from operating as a clustered service, obviating +the need to configure/run CMAN on the host domain. +.TP +\fB-V\fP Print out a version message, then exit. .SH CCS PARAMETERS hooks/post-receive -- Cluster Project