[libvirt] [PATCH] openvz: detect when a domain was shut down from the inside

Eric Blake eblake at redhat.com
Mon Aug 1 20:40:09 UTC 2011


On 07/29/2011 02:41 AM, Jean-Baptiste Rouault wrote:
> This patch adds an internal function openvzGetVEStatus to
> get the real state of the domain. This function is used in
> various places in the driver, in particular to detect when
> the domain has been shut down by the user with the "halt"
> command.
> ---
>   src/openvz/openvz_driver.c |   76 +++++++++++++++++++++++++++++++++++++++-----
>   1 files changed, 68 insertions(+), 8 deletions(-)

Posted awfully late after 0.9.4 RC1, but it can be argued that this is 
relatively limited-scope (openvz-only) and a bug fix, so I don't feel 
bad about pushing it.

>
> diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
> index 4e7cb03..3b3b079 100644
> --- a/src/openvz/openvz_driver.c
> +++ b/src/openvz/openvz_driver.c
> @@ -72,6 +72,7 @@ static int openvzDomainSetVcpusInternal(virDomainObjPtr vm,
>                                           unsigned int nvcpus);
>   static int openvzDomainSetMemoryInternal(virDomainObjPtr vm,
>                                            unsigned long memory);
> +static int openvzGetVEStatus(virDomainObjPtr vm, int *status, int *reason);

I'm not going to change the patch for this, but I generally like sorting 
static functions topologically so as not to have to do forward 
declarations, when possible (and this case is possible).

You failed 'make syntax-check' with some trailing spaces, and you used a 
// comment instead of /**/, but once those were fixed:

ACK and pushed.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list