[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libvirt-users
Subject:    RE: libvirt remote uri format
From:       "Joe Muro" <joemuro () us ! ibm ! com>
Date:       2020-04-06 14:45:27
Message-ID: OF73298C27.65582CB0-ON85258542.004BF55C-85258542.0051111D () notes ! na ! collabserv ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


The client machine is running macOS. So that explains it. For my case,
hard-coding the socket path is not a major problem, although having libvirt
"auto-detect" the correct path would certainly be nice.

Thanks for your help.

- Joe



From:	Andrea Bolognani <abologna@redhat.com>
To:	Joe Muro <joemuro@us.ibm.com>, libvirt-users@redhat.com
Date:	04/06/2020 04:47 AM
Subject:	[EXTERNAL] Re: libvirt remote uri format



On Fri, 2020-04-03 at 19:37 -0500, Joe Muro wrote:
> Hi,
>
> I am using python libvirt api to get domain information. When using a uri
without specifying the socket path, an error occurs.
>
> uri = "qemu+ssh://myuser@some.kvm.host/system"
> conn = libvirt.open(uri)
>
> This results in the following:
>
> libvirt: XML-RPC error : internal error: received hangup event on socket
>
> If I append the socket path to the URI, it works. e.g.
>
> qemu
+ssh://myuser@some.kvm.host/system?socket=/var/run/libvirt/libvirt-sock
>
> Is this the recommended way to construct an ssh uri? My concern is that
the socket path may be different when connecting to different libvirt
hosts.
>
> remote host is ubuntu 20.04 running libvirtd (libvirt) 6.0.0 under
systemd

Is the client machine running macOS by any chance?

There is a long-standing issue where that platform will use different
paths for certain resources, including the libvirtd socket, and the
way it currently works is that the default socket path is chosen by
the client, so any mismatch will result in something like the above.

The plan is to replace our use of nc with a custom virt-nc helper
that will link against libvirt on the host side and will thus be able
to use the default socket path appropriate for the system; however,
as far as I'm aware nobody is currently working on it.

--
Andrea Bolognani / Red Hat / Virtualization




[Attachment #5 (unknown)]

<html><body><p><font size="2">The client machine is running macOS. So that explains \
it. For my case, hard-coding the socket path is not a major problem, although having \
libvirt &quot;auto-detect&quot; the correct path would certainly be nice. \
</font><br><br><font size="2">Thanks for your help.</font><br><br><font size="2">- \
Joe</font><br><br><img width="16" height="16" \
src="cid:1__=0ABB0FD1DFD873CC8f9e8a93df938690918c0AB@" border="0" alt="Inactive hide \
details for Andrea Bolognani ---04/06/2020 04:47:04 AM---On Fri, 2020-04-03 at 19:37 \
-0500, Joe Muro wrote: &gt; Hi,"><font size="2" color="#424282">Andrea Bolognani \
---04/06/2020 04:47:04 AM---On Fri, 2020-04-03 at 19:37 -0500, Joe Muro wrote: &gt; \
Hi,</font><br><br><font size="2" color="#5F5F5F">From:        </font><font \
size="2">Andrea Bolognani &lt;abologna@redhat.com&gt;</font><br><font size="2" \
color="#5F5F5F">To:        </font><font size="2">Joe Muro &lt;joemuro@us.ibm.com&gt;, \
libvirt-users@redhat.com</font><br><font size="2" color="#5F5F5F">Date:        \
</font><font size="2">04/06/2020 04:47 AM</font><br><font size="2" \
color="#5F5F5F">Subject:        </font><font size="2">[EXTERNAL] Re: libvirt remote \
uri format</font><br><hr width="100%" size="2" align="left" noshade \
style="color:#8091A5; "><br><br><br><tt><font size="2">On Fri, 2020-04-03 at 19:37 \
-0500, Joe Muro wrote:<br>&gt; Hi,<br>&gt; <br>&gt; I am using python libvirt api to \
get domain information. When using a uri without specifying the socket path, an error \
occurs. <br>&gt; <br>&gt; uri = \
&quot;qemu+ssh://myuser@some.kvm.host/system&quot;<br>&gt; conn = \
libvirt.open(uri)<br>&gt; <br>&gt; This results in the following:<br>&gt; <br>&gt; \
libvirt: XML-RPC error : internal error: received hangup event on socket<br>&gt; \
<br>&gt; If I append the socket path to the URI, it works. e.g. <br>&gt; <br>&gt; \
qemu+ssh://myuser@some.kvm.host/system?socket=/var/run/libvirt/libvirt-sock <br>&gt; \
<br>&gt; Is this the recommended way to construct an ssh uri? My concern is that the \
socket path may be different when connecting to different libvirt hosts.<br>&gt; \
<br>&gt; remote host is ubuntu 20.04 running libvirtd (libvirt) 6.0.0 under \
systemd<br><br>Is the client machine running macOS by any chance?<br><br>There is a \
long-standing issue where that platform will use different<br>paths for certain \
resources, including the libvirtd socket, and the<br>way it currently works is that \
the default socket path is chosen by<br>the client, so any mismatch will result in \
something like the above.<br><br>The plan is to replace our use of nc with a custom \
virt-nc helper<br>that will link against libvirt on the host side and will thus be \
able<br>to use the default socket path appropriate for the system; however,<br>as far \
as I'm aware nobody is currently working on it.<br><br>-- <br>Andrea Bolognani / Red \
Hat / Virtualization<br><br></font></tt><br><br><BR> </body></html>


["graycol.gif" (image/gif)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic