Re: [PATCH] esx: Move CURL handling code to it's own type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/4/22 Eric Blake <eblake@xxxxxxxxxx>:
> On 04/10/2011 07:39 AM, Matthias Bolte wrote:
>> ---
>> Âsrc/esx/esx_driver.c | Â Â4 +-
>> Âsrc/esx/esx_vi.c   | Â348 ++++++++++++++++++++++++++------------------------
>> Âsrc/esx/esx_vi.h   |  29 +++-
>> Â3 files changed, 205 insertions(+), 176 deletions(-)
>>
>> +++ b/src/esx/esx_vi.h
>> @@ -82,6 +82,7 @@ typedef enum _esxVI_APIVersion esxVI_APIVersion;
>> Âtypedef enum _esxVI_ProductVersion esxVI_ProductVersion;
>> Âtypedef enum _esxVI_Occurrence esxVI_Occurrence;
>> Âtypedef struct _esxVI_ParsedHostCpuIdInfo esxVI_ParsedHostCpuIdInfo;
>> +typedef struct _esxVI_CURL esxVI_CURL;
>> Âtypedef struct _esxVI_Context esxVI_Context;
>> Âtypedef struct _esxVI_Response esxVI_Response;
>> Âtypedef struct _esxVI_Enumeration esxVI_Enumeration;
>> @@ -142,16 +143,32 @@ struct _esxVI_ParsedHostCpuIdInfo {
>>
>>
>> Â/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
>> + * CURL
>> + */
>> +
>> +struct _esxVI_CURL {
>> + Â ÂCURL *handle;
>> + Â ÂvirMutex lock;
>> + Â Âstruct curl_slist *headers;
>> + Â Âchar error[CURL_ERROR_SIZE];
>> +};
>> +
>> +int esxVI_CURL_Alloc(esxVI_CURL **curl);
>> +void esxVI_CURL_Free(esxVI_CURL **curl);
>> +int esxVI_CURL_Connect(esxVI_CURL *curl, esxUtil_ParsedUri *parsedUri);
>> +int esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content);
>> +int esxVI_CURL_Upload(esxVI_CURL *curl, const char *url, const char *content);
>
> A new type...
>
>> +
>> +
>> +
>> +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
>> Â * Context
>> Â */
>>
>> Âstruct _esxVI_Context {
>> + Â ÂesxVI_CURL *curl;
>> Â Â Âchar *url;
>> Â Â Âchar *ipAddress;
>> - Â ÂCURL *curl_handle;
>> - Â Âstruct curl_slist *curl_headers;
>> - Â Âchar curl_error[CURL_ERROR_SIZE];
>> - Â ÂvirMutex curl_lock;
>> Â Â Âchar *username;
>
> extracted from several fields of a larger type, and the rest of the
> patch looks like mechanical fallout to the different naming to get to
> the same fields.
>
> Looks like a reasonable refactoring, and nothing really caught my eye as
> suspicious.
>
> ACK.
>

Thanks, pushed.

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]