Re: [libvirt] [PATCH 12/14] Re-factor pci_add reply parsing and parse domain/bus numbers

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

 



On Mon, Jul 20, 2009 at 12:51:22PM +0100, Mark McLoughlin wrote:
> The current code for parsing pci_add replies ignores the the domain and
> bus numbers. Re-write the code to rectify that.
> 
> Also, since pci_add is used for NIC hotplug as well ask disk hotplug,
> re-factor the code into a separate function.
> 
> * src/qemu_driver.c: add qemudParsePciAddReply() function which can
>   handle parsing domain and bus numbers
> ---
>  src/qemu_driver.c |  111 +++++++++++++++++++++++++++++++++++++++--------------

  Ah, okay, as raised previously I really prefer a full parsing.
but shouldn't the parsed item be saved in the Def directly, instead of
keeping the string version.


> +    VIR_FREE(reply);
> +
> +    if (virAsprintf(&dev->data.disk->pci_addr, "%.4x:%.2x:%.2x",
> +                    domain, bus, slot) < 0) {
> +        virReportOOMError(conn);
> +        return -1;
> +    }
> +

  And do that serialization only when outputting the commandlines ?

  ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
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]