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

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


On 03/05/2014 08:42 PM, Daniel P. Berrange wrote:
> On Wed, Mar 05, 2014 at 12:00:59PM +0000, qiaonuohan at 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.

parameter of testXXX should be used, or it won't go through make. My computer
output the following message. I just want to check is it OK to use
virDomainCoreDumpWithFormat here.

<cut>
...
   CC     qemu/libvirt_driver_qemu_impl_la-qemu_capabilities.lo
   CC     qemu/libvirt_driver_qemu_impl_la-qemu_command.lo
   CC     qemu/libvirt_driver_qemu_impl_la-qemu_domain.lo
cc1: warnings being treated as errors
test/test_driver.c: In function 'testDomainCoreDumpWithFormat':
test/test_driver.c:2432: error: unused parameter 'dumpformat' [-Wunused-parameter]
make[3]: *** [test/libvirt_driver_test_la-test_driver.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/work/qemu/libvirt/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/work/qemu/libvirt/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/work/qemu/libvirt'
make: *** [all] Error 2
<cut>

>
> Regards,
> Daniel


-- 
Regards
Qiao Nuohan




More information about the libvir-list mailing list