From: lhh@sourceware.org <lhh@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/fence/agents/xvm fence_xvmd.c xml.c
Date: 19 Nov 2007 17:03:28 -0000 [thread overview]
Message-ID: <20071119170328.30349.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: lhh at sourceware.org 2007-11-19 17:03:27
Modified files:
fence/agents/xvm: fence_xvmd.c xml.c
Log message:
Ancillary NOCLUSTER mode fixes for fence_xvmd
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/xvm/fence_xvmd.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.8&r2=1.4.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/xvm/xml.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.3&r2=1.1.2.4
--- cluster/fence/agents/xvm/fence_xvmd.c 2007/11/14 18:41:27 1.4.2.8
+++ cluster/fence/agents/xvm/fence_xvmd.c 2007/11/19 17:03:27 1.4.2.9
@@ -219,7 +219,8 @@
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;
@@ -227,7 +228,7 @@
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;
}
@@ -246,6 +247,12 @@
break;
case FENCE_OFF:
printf("Destroying domain %s...\n", (char *)req->domain);
+ if (!vdp && (flags & F_NOCLUSTER)) {
+ dbg_printf(2, "[OFF + NOCLUSTER] Nothing to do - "
+ "domain does not exist\n");
+ response = 0;
+ break;
+ }
dbg_printf(2, "[OFF] Calling virDomainDestroy\n");
ret = virDomainDestroy(vdp);
@@ -263,6 +270,14 @@
case FENCE_REBOOT:
printf("Rebooting domain %s...\n",
(char *)req->domain);
+
+ if (!vdp && (flags & F_NOCLUSTER)) {
+ dbg_printf(2, "[REBOOT + NOCLUSTER] Nothing to do - "
+ "domain does not exist\n");
+ response = 0;
+ break;
+ }
+
domain_desc = virDomainGetXMLDesc(vdp, 0);
if (domain_desc) {
@@ -283,10 +298,10 @@
"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;
@@ -652,7 +667,7 @@
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");
--- cluster/fence/agents/xvm/xml.c 2007/10/10 16:14:15 1.1.2.3
+++ cluster/fence/agents/xvm/xml.c 2007/11/19 17:03:27 1.1.2.4
@@ -82,6 +82,8 @@
flip_graphics_port(doc);
os_node = get_os_node(doc);
+ if (!os_node)
+ return -1;
curr = os_node->children;
while (curr) {
reply other threads:[~2007-11-19 17:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071119170328.30349.qmail@sourceware.org \
--to=lhh@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.