[libvirt] [PATCH 07/10] Support virDomainOpenConsole with QEMU

Eric Blake eblake at redhat.com
Tue Nov 2 16:32:10 UTC 2010


On 11/01/2010 03:39 PM, Eric Blake wrote:
>> +        for (i = 0 ; !chr && i < vm->def->nserials ; i++) {
>> +            if (STREQ(devname, vm->def->serials[i]->info.alias))
>> +                chr = vm->def->serials[i];
>> +        }
> 
> Are we guaranteed that all devices will have a non-NULL and unique
> alias,

You answered this...

>> +    if (!chr) {
>> +        qemuReportError(VIR_ERR_INTERNAL_ERROR,
>> +                        _("cannot find character device %s"), devname);
> 
> NULLSTR(devname)
> 
>> +        goto cleanup;
>> +    }
>> +
>> +    if (chr->type != VIR_DOMAIN_CHR_TYPE_PTY) {
>> +        qemuReportError(VIR_ERR_INTERNAL_ERROR,
>> +                        _("character device %s is not using a PTY"), devname);
> 
> NULLSTR(devname)

But these two fixes still need to be made, since devname is allowed to
be NULL.  ACK, with those fixes.

-- 
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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101102/adb3e7de/attachment-0001.sig>


More information about the libvir-list mailing list