Re: [PATCH] examples: Resurrect domsuspend example

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

 



On 12/13/2013 07:22 AM, Michal Privoznik wrote:
> This partially reverts 5eb4b04211 and 62774afb6ba8.
> 
> Rewrite the domsuspend example from scratch. This time do it right.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  .gitignore                      |   1 +
>  Makefile.am                     |   4 +-
>  cfg.mk                          |   2 +-
>  configure.ac                    |   1 +
>  examples/domsuspend/Makefile.am |  27 ++++
>  examples/domsuspend/suspend.c   | 276 ++++++++++++++++++++++++++++++++++++++++
>  libvirt.spec.in                 |   3 +-
>  7 files changed, 310 insertions(+), 4 deletions(-)
>  create mode 100644 examples/domsuspend/Makefile.am
>  create mode 100644 examples/domsuspend/suspend.c
> 

> +
> +#include <errno.h>
> +#include <getopt.h>
> +#include <libvirt/libvirt.h>
> +#include <libvirt/virterror.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <string.h>
> +#include <unistd.h>
> +
> +int debug = 0;

Should this variable be marked static?  Also, C guarantees it will be
zero-initialized (whether static or global) without an initializer,
because it is not automatic scope.

> +        case 'h':
> +            print_usage(argv[0]);
> +            exit(EXIT_SUCCESS);
> +            break;

Unreachable break might make Coverity unhappy.


> +
> +    default:
> +        /* In all other states domain can't be suspended */
> +        ERROR("Domain is not state where it can be suspended: %d",

s/not/not in a/

ACK with nits fixed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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