From cf1a7df57748447109ffa5589f2e1d8864a72a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 22 Jun 2022 07:32:42 +0200 Subject: [PATCH] libxl: remove cleanup label from libxlDomainMigrationSrcPerform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use VIR_AUTOCLOSE for the remaining file descriptor that uses manual cleanup and remove the label. Signed-off-by: Ján Tomko Reviewed-by: Pavel Hrdina --- src/libxl/libxl_migration.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index c5ec80139f..800a6b0365 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -1183,13 +1183,13 @@ libxlDomainMigrationSrcPerform(libxlDriverPrivate *driver, char portstr[100]; g_autoptr(virURI) uri = NULL; virNetSocket *sock; - int sockfd = -1; + VIR_AUTOCLOSE sockfd = -1; int ret = -1; /* parse dst host:port from uri */ uri = virURIParse(uri_str); if (uri == NULL || uri->server == NULL || uri->port == 0) - goto cleanup; + return -1; hostname = uri->server; port = uri->port; @@ -1199,11 +1199,11 @@ libxlDomainMigrationSrcPerform(libxlDriverPrivate *driver, if (virNetSocketNewConnectTCP(hostname, portstr, AF_UNSPEC, &sock) < 0) - goto cleanup; + return -1; if (virNetSocketSetBlocking(sock, true) < 0) { virObjectUnref(sock); - goto cleanup; + return -1; } sockfd = virNetSocketDupFD(sock, true); @@ -1229,8 +1229,6 @@ libxlDomainMigrationSrcPerform(libxlDriverPrivate *driver, libxlDomainObjEndJob(driver, vm); } - cleanup: - VIR_FORCE_CLOSE(sockfd); return ret; }