[libvirt] [RFC PATCHv2 4/5] smartcard: add domain conf support

Eric Blake eblake at redhat.com
Fri Jan 14 17:58:25 UTC 2011


On 01/14/2011 05:29 AM, Daniel P. Berrange wrote:
>> +    case VIR_DOMAIN_SMARTCARD_TYPE_HOST_CERTIFICATES:
>> +        i = 0;
>> +        for (cur = node->children;
>> +             cur && cur->type == XML_ELEMENT_NODE &&
>> +                 xmlStrEqual(cur->name, BAD_CAST "certificate");
>> +             cur = cur->next) {
>> +            def->data.cert.file[i++] = (char *)xmlNodeGetContent(cur);
>> +        }
> 
> I think xmlNodeGetContent can return NULL. We should likely also
> validate that it starts with a '/', so people can't just supply
> whitespace or random garbage.

Will make that change.  Also, given the qemu command line constraints,
the file cannot contain ',' (any other character can be parsed fine), so
I'm updating patch 5/5 to reject unusable filenames (while keeping the
overall domain_conf generic in allowing any filename).

>> +    case VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH:
>> +        type = virXMLPropString(node, "type");
>> +        if (type == NULL)
>> +            def->data.passthru.type = VIR_DOMAIN_CHR_TYPE_TCP;
> 
> I'm not sure that we should be defaulting to TCP here,
> rather than making 'type' compulsory.

Hmm.  My v1 proposal had the type attribute be mandatory for
mode='passthrough', and I had changed it to be optional in v2; but it's
easy enough to go back to having type be mandatory for v3.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110114/d6b5920b/attachment-0001.sig>


More information about the libvir-list mailing list