[libvirt] [PATCH 06/23] Replace use of openvzError with virReportError

Peter Krempa pkrempa at redhat.com
Fri Jul 20 10:18:27 UTC 2012


On 07/18/12 20:40, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> Update the OpenVZ driver to use virReportError instead of
> the openvzError custom macro
>
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>   cfg.mk                     |    1 -
>   src/openvz/openvz_conf.c   |  132 ++++++++++-----------
>   src/openvz/openvz_conf.h   |    4 -
>   src/openvz/openvz_driver.c |  282 ++++++++++++++++++++++----------------------
>   src/openvz/openvz_util.c   |    5 +-
>   5 files changed, 211 insertions(+), 213 deletions(-)
>

...

>   /* OpenVZ commands - Replace with wrapper scripts later? */
>   # define VZLIST  "/usr/sbin/vzlist"
> diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
> index 8ecd83b..8f923dc 100644
> --- a/src/openvz/openvz_driver.c
> +++ b/src/openvz/openvz_driver.c

...

> @@ -1371,21 +1373,21 @@ static virDrvOpenStatus openvzOpen(virConnectPtr conn,
>           /* If path isn't /system, then they typoed, so tell them correct path */
>           if (conn->uri->path == NULL ||
>               STRNEQ (conn->uri->path, "/system")) {
> -            openvzError(VIR_ERR_INTERNAL_ERROR,
> -                        _("unexpected OpenVZ URI path '%s', try openvz:///system"),
> +            virReportError(VIR_ERR_INTERNAL_ERROR,
> +                           _("unexpected OpenVZ URI path '%s', try openvz:///system"),
>                           conn->uri->path);

Bad indent on the last parameter.

>               return VIR_DRV_OPEN_ERROR;
>           }
>
>           if (!virFileExists("/proc/vz")) {
> -            openvzError(VIR_ERR_INTERNAL_ERROR, "%s",
> -                        _("OpenVZ control file /proc/vz does not exist"));
> +            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> +                           _("OpenVZ control file /proc/vz does not exist"));
>               return VIR_DRV_OPEN_ERROR;
>           }
>
>           if (access("/proc/vz", W_OK) < 0) {
> -            openvzError(VIR_ERR_INTERNAL_ERROR, "%s",
> -                        _("OpenVZ control file /proc/vz is not accessible"));
> +            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> +                           _("OpenVZ control file /proc/vz is not accessible"));
>               return VIR_DRV_OPEN_ERROR;
>           }
>       }

ACK with the one nit fixed.

Peter




More information about the libvir-list mailing list