[libvirt] [PATCH] cgroup: Don't fail to start a VM when DBus isn't compiled in or running

Eric Blake eblake at redhat.com
Fri Aug 30 20:31:29 UTC 2013


On 08/14/2013 07:39 AM, Peter Krempa wrote:
> The systemd code to create cgroups has fallback means built in, but
> fails to engage them if a host isn't running DBus or libvirtd is
> compiled without DBus (yes, you still don't need to run DBus).
> 
> This patch changes the return value in case DBus isn't available to so
> that the fallback code can be activated and cgroups are created
> manually.
> ---
>  src/util/virsystemd.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

ACK, and worth having in 1.1.2.

> 
> diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
> index 251b846..25fcf96 100644
> --- a/src/util/virsystemd.c
> +++ b/src/util/virsystemd.c
> @@ -145,8 +145,10 @@ int virSystemdCreateMachine(const char *name,
>      char *username = NULL;
>      char *slicename = NULL;
> 
> -    if (!(conn = virDBusGetSystemBus()))
> -        return -1;
> +    if (!(conn = virDBusGetSystemBus())) {
> +        virResetLastError();
> +        return -2;
> +    }
> 
>      if (privileged) {
>          if (virAsprintf(&machinename, "%s-%s", drivername, name) < 0)
> 

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


More information about the libvir-list mailing list