On 05/06/2013 07:26 AM, bigclouds wrote:
hi,all my demo waiting all the time. vdsm can neither connect vm channel. --------------vdsm.log-------------- vmChannels::103::vdsm::(_handle_unconnected) Trying to connect fileno 18.- ----------------------my demo--------- import os, sys import time import socket import logging sys.path.append("/usr/share/vdsm") from vmChannels import Listener import threading import guestIF import supermcvda import json _guestSocketFile = "/var/lib/libvirt/qemu/channels/winxp.com.redhat.rhevm.vdsm" _sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) _sock.setblocking(1)
It should be setblocking(0) Besides that, you need to have a guest agent running on the virtual machine if you want this to work.
try: _sock.connect(_guestSocketFile) except Exception as err: print err exit(1) args={'__name__':'log-off'} message = (json.dumps(args) + '\n').encode('utf8')*time.sleep(1) _sock.send(message) print _sock.recv(2 ** 10)*
vdsm-devel mailing list vdsm-devel@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel