Re: [PATCH 3/3] Add support for shutdown / reboot APIs in LXC driver

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

 



<...>

> +static int
> +lxcDomainReboot(virDomainPtr dom,
> +                unsigned int flags)
> +{
> +    virLXCDriverPtr driver = dom->conn->privateData;
> +    virLXCDomainObjPrivatePtr priv;
> +    virDomainObjPtr vm;
> +    char *vroot = NULL;
> +    int ret = -1;
> +    int rc;
> +
> +    virCheckFlags(VIR_DOMAIN_REBOOT_INITCTL |
> +                  VIR_DOMAIN_REBOOT_SIGNAL, -1);
> +

<...>

> +
> +    if (flags == 0 ||
> +        (flags & VIR_DOMAIN_REBOOT_INITCTL)) {
> +        if ((rc = virInitctlSetRunLevel(VIR_INITCTL_RUNLEVEL_REBOOT,
> +                                        vroot)) < 0) {
> +            goto cleanup;
> +        }
> +        if (rc == 0 && flags != 0 &&
> +            ((flags & ~VIR_DOMAIN_SHUTDOWN_INITCTL) == 0)) {

               ((flags & ~VIR_DOMAIN_REBOOT_INITCTL) == 0)) {

> +            virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
> +                           _("Container does not provide an initctl pipe"));
> +            goto cleanup;
> +        }
> +    } else {
> +        rc = 0;
> +    }
> +

<...>

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