On Wed, Mar 05, 2014 at 12:00:59PM +0000, qiaonuohan(a)cn.fujitsu.com wrote:
On 03/04/2014 07:41 PM, Daniel P. Berrange wrote:
>> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
>> index b724f82..605b0d1 100644
>> --- a/src/test/test_driver.c
>> +++ b/src/test/test_driver.c
>> @@ -2427,9 +2427,10 @@ testDomainRestore(virConnectPtr conn,
>> return testDomainRestoreFlags(conn, path, NULL, 0);
>> }
>>
>> -static int testDomainCoreDump(virDomainPtr domain,
>> - const char *to,
>> - unsigned int flags)
>> +static int testDomainCoreDumpWithFormat(virDomainPtr domain,
>> + const char *to,
>> + unsigned int dumpformat,
>> + unsigned int flags)
>> {
>> testConnPtr privconn = domain->conn->privateData;
>> int fd = -1;
>> @@ -2479,6 +2480,12 @@ static int testDomainCoreDump(virDomainPtr domain,
>> }
>> }
>>
>> + if (dumpformat> VIR_DUMP_FORMAT_KDUMP_SNAPPY) {
>> + virReportSystemError(errno,
>> + _("invalid value of dumpformat: %d"),
dumpformat);
>> + goto cleanup;
>> + }
>
> This should be done in the libvirt.c entry point, comparing against
> VIR_DUMP_FORMAT_LAST
>
Is it OK, if I change the check to following one
+ /* dump the core of "domain" to file "to" */
+ if (virDomainCoreDumpWithFormat(domain, to, dumpformat, flags) < 0) {
+ goto cleanup;
+ }
Huh, I don't really see what you mean here.
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|