[libvirt] [PATCH v2] Added new attribute accessmode to filesystem element

Harsh Bora harsh at linux.vnet.ibm.com
Thu Oct 14 13:17:28 UTC 2010


On 10/14/2010 06:40 PM, Daniel Veillard wrote:
> On Thu, Oct 14, 2010 at 04:41:51PM +0530, Harsh Prateek Bora wrote:
>> This patch introduces new attribute to filesystem element
>> to support customizable access mode for mount type.
>> Valid accessmode are: passthrough, mapped and squash.
> [...]
>> @@ -1847,6 +1853,7 @@ virDomainFSDefParseXML(xmlNodePtr node,
>>       char *type = NULL;
>>       char *source = NULL;
>>       char *target = NULL;
>> +    char *accessmode = NULL;
>>
>>       if (VIR_ALLOC(def)<  0) {
>>           virReportOOMError();
>> @@ -1864,6 +1871,17 @@ virDomainFSDefParseXML(xmlNodePtr node,
>>           def->type = VIR_DOMAIN_FS_TYPE_MOUNT;
>>       }
>>
>> +    accessmode = virXMLPropString(node, "accessmode");
>> +    if (accessmode) {
>> +        if ((def->accessmode = virDomainFSAccessModeTypeFromString(accessmode))<  0) {
>> +            virDomainReportError(VIR_ERR_INTERNAL_ERROR,
>> +                                 _("unknown accessmode '%s'"), accessmode);
>> +            goto error;
>> +        }
>> +    } else {
>> +        def->accessmode = VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH;
>> +    }
>
>    if non-NULL this was never freed because of a missing
>      VIR_FREE(accessmode);
> in the clanup: section of that routine.
>
>
>    otherwise, ACK. I was just a bit worried that if no model was given
> we always assume passthrough, but since that's what the QEMu backend
> implementation did so far and this doesn't affect other drivers, that's
> fine.
>
>    Applied and pushed with that small change,
>
>     thanks !
>
Thanks very much ! :)
> Daniel
>




More information about the libvir-list mailing list