Make crash and live flags mutually exclusive in virDomainCoreDump

They don't make any sense when used together.
This commit is contained in:
Mark Wu 2011-04-22 11:45:33 +02:00 committed by Jiri Denemark
parent bf5e3f6598
commit d9b46a0d04
2 changed files with 8 additions and 1 deletions

View File

@ -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....]

View 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;