[RFC] qemu_migration: Fix virConnectOpenAuth error code

Raphael Norwitz raphael.norwitz at nutanix.com
Thu Jan 6 01:33:22 UTC 2022

Today if virConnectOpenAuth fails, qemuMigrationSrcPerformPeer2Peer()
returns VIR_ERR_OPERATION_FAILED. This change switches that error code
to VIR_ERR_NO_CONNECT, which is more accurate.

This should help libvirt consumers more intellegently retry migrations
on intermittent connection failures.

CC: Bhuvnesh Jain <bhuvnesh.jain at nutanix.com>
Suggested-by: John Levon <john.levon at nutanix.com>
Signed-off-by: Raphael Norwitz <raphael.norwitz at nutanix.com>
 src/qemu/qemu_migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index b9d7d582f5..f7ced209a4 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -5145,7 +5145,7 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver,
         goto cleanup;
     if (dconn == NULL) {
-        virReportError(VIR_ERR_OPERATION_FAILED,
+        virReportError(VIR_ERR_NO_CONNECT,
                        _("Failed to connect to remote libvirt URI %s: %s"),
                        dconnuri, virGetLastErrorMessage());
         return -1;

More information about the libvir-list mailing list