Re: [PATCHv5 3/5] Add GVirConfigDomainHostdevPci

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

 



gconfig: prefix to add to the subject line.

On Wed, Jul 06, 2016 at 10:45:53PM +0100, Zeeshan Ali (Khattak) wrote:
> +
> +const gchar *gvir_config_domain_hostdev_pci_get_rom_file(GVirConfigDomainHostdevPci *hostdev)
> +{
> +    return gvir_config_object_get_attribute(GVIR_CONFIG_OBJECT(hostdev), "rom", "file");
> +}
> +
> +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 containain rom node is missing, default value is TRUE for newer Qemu */
> +        return TRUE;

"containain" typo

> +
> +    bar_str = gvir_config_xml_get_attribute_content(rom_node, "bar");
> +    if (g_strcmp0(bar_str, "on"))
> +        return TRUE;
> +    else
> +        return FALSE;

Wouldn't:
    bar_str = gvir_config_object_get_attribute(GVIR_CONFIG_OBJECT(hostdev), "rom", "bar");
    return (g_strcmp0(bar_str, "on") == 0)
work too (and be simpler)?

Reviewed-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

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]