[libvirt] [PATCHv3 07/12] drivers: Implement virListAllDomains for drivers using virDomainObj

Eric Blake eblake at redhat.com
Mon Jun 18 19:01:22 UTC 2012


On 06/11/2012 04:34 AM, Peter Krempa wrote:
> This patch adds support for listing all domains into drivers that use
> the common virDomainObj implementation: libxl, lxc, openvz, qemu, test,
>     uml, vmware.
> 
> For drivers that don't support managed save images the guests are
> treated as if they had none, so filtering guests that do have such an
> image on this driver succeeds and produces 0 results.
> ---
> Diff to v2:
> - removed driver specific checks now that they're not needed
> - changed flag check to use new macros
> - reordered assignment of the function pointer do driver struct
> ---
>  src/libxl/libxl_driver.c   |   20 ++++++++++++++++++++
>  src/lxc/lxc_driver.c       |   19 +++++++++++++++++++
>  src/openvz/openvz_driver.c |   19 +++++++++++++++++++
>  src/qemu/qemu_driver.c     |   19 +++++++++++++++++++
>  src/test/test_driver.c     |   19 +++++++++++++++++++
>  src/uml/uml_driver.c       |   18 ++++++++++++++++++
>  src/vmware/vmware_driver.c |   20 ++++++++++++++++++++

> +static int
> +libxlListAllDomains(virConnectPtr conn,
> +                    virDomainPtr **domains,
> +                    unsigned int flags)
> +{
> +    libxlDriverPrivatePtr driver = conn->privateData;
> +    int ret = -1;
> +
> +    virCheckFlags(VIR_CONNECT_LIST_FILTERS_ALL, 1);

s/1/-1/, otherwise you aren't properly reporting failure.


> @@ -3912,6 +3930,7 @@ static virDriver lxcDriver = {
>      .domainOpenConsole = lxcDomainOpenConsole, /* 0.8.6 */
>      .isAlive = lxcIsAlive, /* 0.9.8 */
>      .nodeSuspendForDuration = nodeSuspendForDuration, /* 0.9.8 */
> +    .listAllDomains = lxcListAllDomains, /* 0.9.13 */

Is it worth listing this line next to the other listing callbacks?

ACK with the libxl bug fixed.

-- 
Eric Blake   eblake at 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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120618/b1bb39eb/attachment-0001.sig>


More information about the libvir-list mailing list