Re: [PATCH v2] vz: implementation of domainReboot callback

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

 



On Thu, 2015-11-19 at 15:16 +0300, Mikhail Feoktistov wrote:
> Diff from v1.
> 1. Add virCheckFlags() call in vzDomainReboot
> 

ACKed and pushed.

Could you, please, put such notes below '---' delimiter? So that it will not
appear in a commit message.

Also I think at some point we will need to add ability to use non-default flags,
like VIR_DOMAIN_REBOOT_ACPI_POWER_BTN for VMs and VIR_DOMAIN_REBOOT_INITCTL for
containers, but since it's not clear now, which ones, let's have support of
default flags only.

> ---
>  src/vz/vz_driver.c | 8 ++++++++
>  src/vz/vz_sdk.c    | 8 ++++++++
>  src/vz/vz_sdk.h    | 1 +
>  3 files changed, 17 insertions(+)
> 
> diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
> index 0a968b9..39f58a4 100644
> --- a/src/vz/vz_driver.c
> +++ b/src/vz/vz_driver.c
> @@ -923,6 +923,13 @@ static int vzDomainShutdown(virDomainPtr domain)
>      return prlsdkDomainChangeState(domain, prlsdkStop);
>  }
>  
> +static int vzDomainReboot(virDomainPtr domain,
> +                          unsigned int flags)
> +{
> +    virCheckFlags(0, -1);
> +    return prlsdkDomainChangeState(domain, prlsdkRestart);
> +}
> +
>  static int vzDomainIsActive(virDomainPtr domain)
>  {
>      virDomainObjPtr dom = NULL;
> @@ -1486,6 +1493,7 @@ static virHypervisorDriver vzDriver = {
>      .domainShutdown = vzDomainShutdown, /* 0.10.0 */
>      .domainCreate = vzDomainCreate,    /* 0.10.0 */
>      .domainCreateWithFlags = vzDomainCreateWithFlags, /* 1.2.10 */
> +    .domainReboot = vzDomainReboot, /* 1.2.22 */
>      .domainDefineXML = vzDomainDefineXML,      /* 0.10.0 */
>      .domainDefineXMLFlags = vzDomainDefineXMLFlags, /* 1.2.12 */
>      .domainUndefine = vzDomainUndefine, /* 1.2.10 */
> diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
> index 89c9e89..bf71e96 100644
> --- a/src/vz/vz_sdk.c
> +++ b/src/vz/vz_sdk.c
> @@ -1831,6 +1831,14 @@ PRL_RESULT prlsdkSuspend(PRL_HANDLE sdkdom)
>      return waitJob(job);
>  }
>  
> +PRL_RESULT prlsdkRestart(PRL_HANDLE sdkdom)
> +{
> +    PRL_HANDLE job = PRL_INVALID_HANDLE;
> +
> +    job = PrlVm_Restart(sdkdom);
> +    return waitJob(job);
> +}
> +
>  int
>  prlsdkDomainChangeStateLocked(vzConnPtr privconn,
>                                virDomainObjPtr dom,
> diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h
> index ebe4591..88ee7d9 100644
> --- a/src/vz/vz_sdk.h
> +++ b/src/vz/vz_sdk.h
> @@ -41,6 +41,7 @@ PRL_RESULT prlsdkStop(PRL_HANDLE sdkdom);
>  PRL_RESULT prlsdkPause(PRL_HANDLE sdkdom);
>  PRL_RESULT prlsdkResume(PRL_HANDLE sdkdom);
>  PRL_RESULT prlsdkSuspend(PRL_HANDLE sdkdom);
> +PRL_RESULT prlsdkRestart(PRL_HANDLE sdkdom);
>  
>  typedef PRL_RESULT (*prlsdkChangeStateFunc)(PRL_HANDLE sdkdom);
>  int
-- 
Dmitry Guryanov

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