Lines Matching refs:port
279 def __init__(self, port, data, event, quiet=False): argument
287 self.port = port
303 self.idx += self.port.send(self.data)
316 def __init__(self, port, event, queues, blocklen=1024): argument
324 self.port = port
346 ret = select.select([], [self.port.sock], [], 1.0)
359 idx = self.port.sock.send(buf)
369 self.port.is_open = False
370 self.port.open()
372 idx = self.port.sock.send(buf)
391 def __init__(self, port, event, blocklen=1024, quiet=False): argument
399 self.port = port
400 self._port_timeout = self.port.gettimeout()
401 self.port.settimeout(0.1)
414 self.idx += len(self.port.recv(self.blocklen))
417 self.port.settimeout(self._port_timeout)
429 def __init__(self, port, buffer, event, blocklen=1024, sendlen=0): argument
438 self.port = port
452 ret = select.select([self.port.sock], [], [], 1.0)
454 buf = self.port.sock.recv(self.blocklen)
513 self.port.is_open = False
514 self.port.open()
801 def topen(vm, port): argument
808 on_guest("virt.open('%s')" % (port.name), vm, 10)
809 port.open()
821 def tmulti_open(vm, port): argument
828 on_guest("virt.close('%s')" % (port.name), vm, 10)
829 on_guest("virt.open('%s')" % (port.name), vm, 10)
830 (match, data) = _on_guest("virt.open('%s')" % (port.name), vm, 10)
832 if port.port_type == "yes": #is console?
843 port.open()
846 def tclose(vm, port): argument
853 on_guest("virt.close('%s')" % (port.name), vm, 10)
854 port.close()
857 def tpolling(vm, port): argument
865 on_guest("virt.poll('%s', %s)" % (port.name, select.POLLOUT), vm,
869 port.sock.sendall("test")
871 on_guest("virt.poll('%s', %s)" % (port.name, test), vm, 10)
875 port.close()
877 on_guest("virt.poll('%s', %s)" % (port.name, test), vm, 10)
880 on_guest("virt.recv('%s', 4, 1024, False)" % (port.name), vm, 10)
881 on_guest("virt.poll('%s', %s)" % (port.name, select.POLLHUP), vm,
885 port.open()
887 on_guest("virt.poll('%s', %s)" % (port.name, select.POLLOUT), vm,
891 def tsigio(vm, port): argument
898 if port.is_open:
899 port.close()
903 (port.name) , vm, 10)
904 on_guest("virt.get_sigio_poll_return('%s')" % (port.name) , vm, 10)
908 (port.name), vm, 10)
909 port.open()
911 (port.name) , vm, 10)[0]
917 " select.POLLIN)" % (port.name), vm, 10)
918 port.sock.sendall("0123456789")
919 on_guest("virt.get_sigio_poll_return('%s')" % (port.name) , vm, 10)
923 " select.POLLIN)" % (port.name), vm, 10)
924 port.close()
925 on_guest("virt.get_sigio_poll_return('%s')" % (port.name) , vm, 10)
929 " select.POLLIN)" % (port.name), vm, 10)
930 port.open()
931 on_guest("virt.get_sigio_poll_return('%s')" % (port.name) , vm, 10)
934 on_guest("virt.clean_port('%s')" % (port.name), vm, 10)
935 port.close()
937 % (port.name), vm, 10)
938 port.open()
939 on_guest("virt.get_sigio_poll_return('%s')" % (port.name) , vm, 10)
943 (port.name) , vm, 10)
946 def tlseek(vm, port): argument
954 on_guest("virt.lseek('%s', 0, 0)" % (port.name), vm, 10)
957 def trw_host_offline(vm, port): argument
964 if port.is_open:
965 port.close()
967 on_guest("virt.recv('%s', 0, 1024, False)" % port.name, vm, 10)
968 match, tmp = _on_guest("virt.send('%s', 10, True)" % port.name,
975 port.open()
977 if (port.sock.recv(1024) < 10):
983 def trw_host_offline_big_data(vm, port): argument
990 if port.is_open:
991 port.close()
993 port.clean_port()
994 port.close()
995 on_guest("virt.clean_port('%s'),1024" % port.name, vm, 10)
997 "is_static=True)" % port.name, vm, 30)
1005 port.open()
1009 ret = select.select([port.sock], [], [], 10.0)
1011 rlen += len(port.sock.recv(((4096))))
1018 def trw_notconnect_guest(vm, port, consoles): argument
1027 if not port.is_open:
1028 port.open()
1030 port.close()
1031 port.open()
1033 port.sock.settimeout(20.0)
1042 sent1 += port.sock.send("a")
1051 logging.info("Open and then close port %s" % (port.name))
1055 on_guest("virt.close('%s')" % (port.name), vm, 10)
1059 port.sock.settimeout(20.0)
1065 sent2 = port.sock.send("a")
1076 port.sock.settimeout(None)
1083 def trw_blocking_mode(vm, port): argument
1091 if not port.is_open:
1092 port.open()
1093 on_guest("virt.blocking('%s', True)" % port.name, vm, 10)
1096 port.name, vm, 10)
1103 port.sock.sendall("1234567890")
1108 def trw_nonblocking_mode(vm, port): argument
1116 if not port.is_open:
1117 port.open()
1118 on_guest("virt.blocking('%s', False)" % port.name, vm, 10)
1121 port.name, vm, 10)
1131 port.sock.sendall("1234567890")
1132 on_guest("virt.recv('%s', 10, 1024, False)" % port.name, vm, 10)
1253 for port in ports:
1254 port.open()
1256 for port in ports[1:]:
1257 on_guest("virt.close('%s')" % (port.name), vm, 2)
1258 on_guest("virt.open('%s')" % (port.name), vm, 2)
1261 % port.path)
1476 port = "serialport-"
1479 port = "console-"
1481 port += "%d%d" % (pciid, id)
1486 % (port_type, pciid, port, port))
1487 ports_name.append([ port, console])
1501 port = filter(lambda x: x[0].endswith("-%d%d" % (pciid, id)),
1504 % (port[0][0]))
1505 ports_name.remove(port[0])
1779 port = consoles[param][0]
1781 if not port.is_open:
1782 port.open()
1793 (port.name, buf_len), vm, 10)
1794 thread = ThSend(port.sock, data, exit_event)
1812 (port.name, select.POLLIN), vm, 10)[0]:
1815 _guest_exit_threads(vm, [port], [])
1832 on_guest("virt.send_loop_init('%s', %d)" % (port.name, buf_len),
1834 thread = ThRecv(port.sock, exit_event, buf_len)
1870 for port in ctype:
1871 openned = port.is_open
1872 port.clean_port()
1873 on_guest("virt.clean_port('%s'),1024" % port.name, vm, 10)
1875 port.close()
1876 on_guest("virt.close('%s'),1024" % port.name, vm, 10)