From: Mark Wu Date: Fri, 22 Apr 2011 09:45:33 +0000 (+0200) Subject: Make crash and live flags mutually exclusive in virDomainCoreDump X-Git-Tag: v0.9.1~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9b46a0d0462e41691d9b132338c0f2ae38c152d;p=thirdparty%2Flibvirt.git Make crash and live flags mutually exclusive in virDomainCoreDump They don't make any sense when used together. --- diff --git a/AUTHORS b/AUTHORS index d530e0474f..10124ee5cf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -167,6 +167,7 @@ Patches have also been contributed by: Jesse Cook Alexander Todorov Richard Laager + Mark Wu [....send patches to get your name here....] diff --git a/src/libvirt.c b/src/libvirt.c index 10c3cdf42f..e74e9774ef 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -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;