[Libvirt-cim] [PATCH 1 of 2] Add preliminary XML-parsing support for Xen FV domains

Jay Gagnon grendel at linux.vnet.ibm.com
Fri Jan 4 15:22:08 UTC 2008


Dan Smith wrote:
> # HG changeset patch
> # User Dan Smith <danms at us.ibm.com>
> # Date 1199395653 28800
> # Node ID 65a07575d2cfc4dfd3c1d57e0a0828c88dacf540
> # Parent  3a838dfd165b5f721687a2bb0b2e03bb0c8192b7
> Add preliminary XML-parsing support for Xen FV domains
>
> This adds a type switch for XenPV, XenFV, KVM to the struct domain.
> It also adds parsing of 'graphics' and 'emulator' devices.  Finally,
> amidst the compulsory changes to xmlgen.c are modifications to
> generate a proper <os> block for XenFV domains.  More work will need
> to be done here, but this is an example of how the domain->type switch
> will be used to select different generation routines.
>
> Signed-off-by: Dan Smith <danms at us.ibm.com>
>
> +
> +static int get_graphics_device(virDomainPtr dom, struct virt_device **dev)
> +{
> +        char *xml;
> +        int ret;
> +        struct virt_device *list = NULL;
> +
> +        xml = virDomainGetXMLDesc(dom, 0);
> +        if (!xml)
> +                return 0;
>
>   
I suppose this speaks well for the quality of the patch when this is all
I can find to complain about, but isn't that a spot where we typically
use "if (xml == NULL)" for the sake of clarity?  Using "(!xml)" for the
conditional tends to make me think of xml as an int.


-- 

-Jay




More information about the Libvirt-cim mailing list