[libvirt] [PATCHv2 2/2] Check if systemd is running before creating machines

Eric Blake eblake at redhat.com
Mon Mar 3 19:57:53 UTC 2014


On 03/03/2014 08:47 AM, Ján Tomko wrote:
> If systemd is installed, but not the init system,

Took me a couple reads to understand this.  It would be easier with
s/not/is not/

> systemd-machined fails with an unhelpful error message:
> Launch helper exited with unknown return code 1
> 
> Currently we only check if the "machine1" service is
> available (in ListActivatableNames).
> Also check if "systemd1" service is registered with DBus
> (ListNames).
> 
> This fixes https://bugs.gentoo.org/show_bug.cgi?id=493246#c22
> ---

ACK.

>  
> +/**
> + * virDBusIsServiceRegistered
> + * @name: service name
> + *
> + * Retruns 0 if service is registered, -1 on fatal error, or -2 if service is not registered
> + */
> +int virDBusIsServiceRegistered(const char *name)

2 lines, if desired.

> +{
> +    int ret = virDBusIsServiceInList("ListNames", name);
> +
> +    VIR_DEBUG("Service %s is %sregistered", name, ret ? "not " : "");

Translation nightmare.  But this string isn't marked for translation, so
it's okay to hard-code English grammar into the ?:.

-- 
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: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140303/7580e6f0/attachment-0001.sig>


More information about the libvir-list mailing list