Re: [libvirt-glib v7 3/5] gconfig: Add GVirConfigDomainHostdevPci

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 22, 2016 at 01:43:35PM +0100, Zeeshan Ali (Khattak) wrote:
> +gboolean gvir_config_domain_hostdev_pci_get_rom_bar(GVirConfigDomainHostdevPci *hostdev)
> +{
> +    xmlNodePtr hostdev_node;
> +    xmlNodePtr rom_node;
> +    const gchar *bar_str;
> +
> +    g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_HOSTDEV_PCI(hostdev), FALSE);
> +
> +    hostdev_node = gvir_config_object_get_xml_node(GVIR_CONFIG_OBJECT(hostdev));
> +    g_return_val_if_fail(hostdev_node != NULL, FALSE);
> +
> +    rom_node = gvir_config_xml_get_element(hostdev_node, "rom", NULL);
> +    if (!rom_node || !(rom_node->children))
> +        /* When containing rom node is missing, default value is TRUE for newer Qemu */
> +        return TRUE;
> +
> +    bar_str = gvir_config_xml_get_attribute_content(rom_node, "bar");
> +    return (g_strcmp0(bar_str, "on"));
> +}

Still the same question as
https://www.redhat.com/archives/libvir-list/2016-July/msg00644.html
Can't it become:

gboolean gvir_config_domain_hostdev_pci_get_rom_bar(GVirConfigDomainHostdevPci *hostdev)
{
    const gchar *bar_str;

    g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_HOSTDEV_PCI(hostdev), FALSE);

    bar_str = gvir_config_object_get_attribute(GVIR_CONFIG_OBJECT(hostdev), "rom", "bar");
    return (g_strcmp0(bar_str, "on") == 0);
}

Christophe

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]