[libvirt] [PATCH] libxl: report correct errno from virNetSocketNewConnectTCP on migration
Jim Fehlig
jfehlig at suse.com
Thu Sep 3 17:46:25 UTC 2015
On 09/03/2015 10:26 AM, Jim Fehlig wrote:
>
> Agreed. How about the following patch?
> >From a30c493bd9e20c9a7a423789a202c444a5eba344 Mon Sep 17 00:00:00 2001
> From: Jim Fehlig<jfehlig at suse.com>
> Date: Thu, 3 Sep 2015 10:14:20 -0600
> Subject: [PATCH] libxl: don't overwrite error from virNetSocketNewConnectTCP()
>
> Remove redundant error reporting libxlDomainMigrationPerform().
> virNetSocketNewConnectTCP() is perfectly capable of reporting
> sensible errors.
>
> Signed-off-by: Jim Fehlig<jfehlig at suse.com>
> ---
> src/libxl/libxl_migration.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
> index 9609e06..de2de91 100644
> --- a/src/libxl/libxl_migration.c
> +++ b/src/libxl/libxl_migration.c
> @@ -487,12 +487,8 @@ libxlDomainMigrationPerform(libxlDriverPrivatePtr driver,
> /* socket connect to dst host:port */
> if (virNetSocketNewConnectTCP(hostname, portstr,
> AF_UNSPEC,
> - &sock) < 0) {
> - virReportSystemError(saved_errno,
> - _("unable to connect to '%s:%s'"),
> - hostname, portstr);
> + &sock) < 0)
> goto cleanup;
> - }
I should try compiling before sending patches:
libxl/libxl_migration.c:475:9: error: unused variable 'saved_errno'
[-Werror=unused-variable]
int saved_errno = EINVAL;
I posted a working V2:
https://www.redhat.com/archives/libvir-list/2015-September/msg00107.html
Regards,
Jim
More information about the libvir-list
mailing list