[libvirt] [PATCHv4 10/9] virCaps: Get rid of defaultConsoleTargetType callback

Eric Blake eblake at redhat.com
Fri Mar 29 18:55:15 UTC 2013


On 03/25/2013 10:17 AM, Peter Krempa wrote:
> This patch refactors various places to allow removing of the
> defaultConsoleTargetType callback from the virCaps structure.
> 
> A new console character device target type is introduced -
> VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE - to mark that no type was
> specified in the XML. This type is at the end converted to the standard
> VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL. Other types that are
> different from this default have to be processed separately in the
> device post parse callback.
> ---
> 
> Notes:
>     Version 4:
>     - new in series
> 

> @@ -2538,6 +2554,91 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
>          return -1;
>      }
> 
> +    /*
> +     * Some really crazy backcompat stuff for consoles

No joke!  Even it if it is the same comment just moved from elsewhere

> +        /* create the serial port definition from the console definition */
> +        if (def->nserials == 0) {
> +            if (VIR_APPEND_ELEMENT(def->serials, def->nserials,
> +                                   def->consoles[0]) < 0)
> +                goto no_memory;
> +
> +            /* modify it to be a serial port */
> +            def->serials[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL;
> +            def->serials[0]->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA;
> +            def->serials[0]->target.port = 0;
> +        } else {
> +            /* if the console source does't match */

s/does't/doesn't/

ACK with the typo fix (and modulo any renaming earlier in the series)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list