[libvirt] [PATCH v4 1/3] add new virDomainCoreDumpWithFormat API

qiaonuohan at cn.fujitsu.com qiaonuohan at cn.fujitsu.com
Wed Mar 5 12:00:59 UTC 2014


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;
+    }

>
> Regards,
> Daniel


-- 
Regards
Qiao Nuohan




More information about the libvir-list mailing list