diff --git a/include/libvirt/libvirt-admin.h b/include/libvirt/libvirt-admin.h
index 9f012c1ad9f93ce42091b924ac31bca48dda96b0..411bd891bfdf150a0489c0687205e4cdd3a1d2c6 100644
--- a/include/libvirt/libvirt-admin.h
+++ b/include/libvirt/libvirt-admin.h
@@ -55,6 +55,7 @@ virAdmConnectPtr virAdmConnectOpen(const char *name, unsigned int flags);
 int virAdmConnectClose(virAdmConnectPtr conn);
 
 int virAdmConnectRef(virAdmConnectPtr conn);
+int virAdmConnectIsAlive(virAdmConnectPtr conn);
 
 int virAdmGetVersion(unsigned long long *libVer);
 
diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c
index 4a2f002ffc428fc3fc8a89396072f5dc5cd9ae76..eedbd1266807842f06233622dfc8a5b19eb7602c 100644
--- a/src/libvirt-admin.c
+++ b/src/libvirt-admin.c
@@ -420,3 +420,36 @@ virAdmGetVersion(unsigned long long *libVer)
     virDispatchError(NULL);
     return -1;
 }
+
+/**
+ * virAdmConnectIsAlive:
+ * @conn: connection to admin server
+ *
+ * Decide whether the connection to the admin server is alive or not.
+ * Connection is considered alive if the channel it is running over is not
+ * closed.
+ *
+ * Returns 1, if the connection is alive, 0 if there isn't an existing
+ * connection at all or the channel has already been closed, or -1 on error.
+ */
+int
+virAdmConnectIsAlive(virAdmConnectPtr conn)
+{
+    bool ret;
+    remoteAdminPrivPtr priv = NULL;
+
+    VIR_DEBUG("conn=%p", conn);
+
+    if (!conn)
+        return 0;
+
+    virCheckAdmConnectReturn(conn, -1);
+    virResetLastError();
+
+    priv = conn->privateData;
+    virObjectLock(priv);
+    ret = virNetClientIsOpen(priv->client);
+    virObjectUnlock(priv);
+
+    return ret;
+}
diff --git a/src/libvirt_admin_public.syms b/src/libvirt_admin_public.syms
index 5e774c2c5893feea0ac41c7bc0b838b2674f0c12..0a70bc7f4c10c356dd209487d7777cf8ba651863 100644
--- a/src/libvirt_admin_public.syms
+++ b/src/libvirt_admin_public.syms
@@ -16,4 +16,5 @@ LIBVIRT_ADMIN_1.3.0 {
         virAdmConnectClose;
         virAdmConnectRef;
         virAdmGetVersion;
+        virAdmConnectIsAlive;
 };
diff --git a/tools/virt-admin.c b/tools/virt-admin.c
index f36d2eddce1c99c7c811ac66db1e7392b3ef7757..2cfa1b1e00529d131868f266562aba170f9e7973 100644
--- a/tools/virt-admin.c
+++ b/tools/virt-admin.c
@@ -159,10 +159,10 @@ vshAdmConnectionHandler(vshControl *ctl)
 {
     vshAdmControlPtr priv = ctl->privData;
 
-    if (!priv->conn)
+    if (!virAdmConnectIsAlive(priv->conn))
         vshAdmReconnect(ctl);
 
-    if (!priv->conn) {
+    if (!virAdmConnectIsAlive(priv->conn)) {
         vshError(ctl, "%s", _("no valid connection"));
         return NULL;
     }