Blame SOURCES/Return-failure-for-nonexistent-domains.patch

54259b
From 98e332e2432c9cf559cd55e3ff8489f658328021 Mon Sep 17 00:00:00 2001
54259b
From: Ryan McCabe <rmccabe@redhat.com>
54259b
Date: Mon, 8 Oct 2012 10:53:13 -0400
54259b
Subject: [PATCH] fence_virt: Return failure for nonexistent domains
54259b
54259b
Return failure instead of success if a user attempts an operation
54259b
on a domain that does not exist.
54259b
54259b
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
54259b
---
54259b
 server/checkpoint.c | 4 ++--
54259b
 server/libvirt.c    | 4 ++--
54259b
 2 files changed, 4 insertions(+), 4 deletions(-)
54259b
54259b
diff --git a/server/checkpoint.c b/server/checkpoint.c
54259b
index 408003f..3ac7e6b 100644
54259b
--- a/server/checkpoint.c
54259b
+++ b/server/checkpoint.c
54259b
@@ -393,7 +393,7 @@ do_off(const char *vm_name)
54259b
 
54259b
 		if (vdp)
54259b
 			virDomainFree(vdp);
54259b
-		return 0;
54259b
+		return 1;
54259b
 	}
54259b
 
54259b
 	syslog(LOG_NOTICE, "Destroying domain %s\n", vm_name);
54259b
@@ -452,7 +452,7 @@ do_reboot(const char *vm_name)
54259b
 			   "do - domain does not exist\n");
54259b
 		if (vdp)
54259b
 			virDomainFree(vdp);
54259b
-		return 0;
54259b
+		return 1;
54259b
 	}
54259b
 
54259b
 	syslog(LOG_NOTICE, "Rebooting domain %s\n", vm_name);
54259b
diff --git a/server/libvirt.c b/server/libvirt.c
54259b
index ac93f18..12bb8ad 100644
54259b
--- a/server/libvirt.c
54259b
+++ b/server/libvirt.c
54259b
@@ -178,7 +178,7 @@ libvirt_off(const char *vm_name, const char *src,
54259b
 
54259b
 		if (vdp)
54259b
 			virDomainFree(vdp);
54259b
-		return 0;
54259b
+		return 1;
54259b
 	}
54259b
 
54259b
 	syslog(LOG_NOTICE, "Destroying domain %s\n", vm_name);
54259b
@@ -320,7 +320,7 @@ libvirt_reboot(const char *vm_name, const char *src,
54259b
 			   "do - domain does not exist\n");
54259b
 		if (vdp)
54259b
 			virDomainFree(vdp);
54259b
-		return 0;
54259b
+		return 1;
54259b
 	}
54259b
 
54259b
 	syslog(LOG_NOTICE, "Rebooting domain %s\n", vm_name);
54259b
-- 
54259b
1.7.11.7
54259b