]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Make crash and live flags mutually exclusive in virDomainCoreDump
authorMark Wu <dwu@redhat.com>
Fri, 22 Apr 2011 09:45:33 +0000 (11:45 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 26 Apr 2011 11:37:21 +0000 (13:37 +0200)
They don't make any sense when used together.

AUTHORS
src/libvirt.c

diff --git a/AUTHORS b/AUTHORS
index d530e0474f9d6ea5f687a83dd2a23b9467a7a0e2..10124ee5cf8dc550957d939b12101ccb6f5ee637 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -167,6 +167,7 @@ Patches have also been contributed by:
   Jesse Cook           <code.crashenx@gmail.com>
   Alexander Todorov    <atodorov@otb.bg>
   Richard Laager       <rlaager@wiktel.com>
+  Mark Wu              <dwu@redhat.com>
 
   [....send patches to get your name here....]
 
index 10c3cdf42f69e8801b2657222f9fc1f81d3cc7ea..e74e9774ef4a4cf96128d1f9d30af4dea0fe9d96 100644 (file)
@@ -2347,7 +2347,7 @@ error:
  * virDomainCoreDump:
  * @domain: a domain object
  * @to: path for the core file
- * @flags: extra flags, currently unused
+ * @flags: an OR'ed set of virDomainCoreDumpFlags
  *
  * This method will dump the core of a domain on a given file for analysis.
  * Note that for remote Xen Daemon the file path will be interpreted in
@@ -2379,6 +2379,12 @@ virDomainCoreDump(virDomainPtr domain, const char *to, int flags)
         goto error;
     }
 
+    if ((flags & VIR_DUMP_CRASH) && (flags & VIR_DUMP_LIVE)) {
+        virLibDomainError(VIR_ERR_INVALID_ARG,
+                          _("crash and live flags are mutually exclusive"));
+        goto error;
+    }
+
     if (conn->driver->domainCoreDump) {
         int ret;
         char *absolute_to;