Re: Issue with libvirtd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/10/2017 07:48 AM, Faysal Ali wrote:
> Hi Michal,

[It is usually good idea to keep the list CCed - it may help others
finding a solution to their problems]

> 
> Well I have created my little python/libivrt app to manage my virtual
> machines. I am using python socket to check libivrt port availability, and
> the error End of file while reading data: Input/output error* only happens
> whenever that python socket script is trigger.
> 
> Here is the script of python socket
> 
> import libvirt, socket, sys
> 
> hostname='kvm09'
> port = 16509
> 
> try:
>       socket_host = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>       socket_host.settimeout(1)
>       socket_host.connect((hostname, port))
>       socket_host.close()
>       print 'true'
> except Exception as err:
>       print err

Ah, I haven't expected this. Of course your are seeing the error
message. Libvirt has its own protocol on the top of TCP and since you
are connecting and dying immediately - without sending any valid libvirt
packet, the daemon logs an error. This is perfectly expected.

Also, this is *not* how you connect to libvirt. You want to open a
libvirt connection:

conn = libvirt.open(uri)
dom = conn.lookupByName(name)
...

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux