Overview
Comment: | Fix byte/string issues in send_command |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
df1b3337bc7cbac2e13f451df17bccea |
User & Date: | vitus on 2019-09-21 17:02:27 |
Other Links: | manifest | tags |
Context
2019-10-01
| ||
19:29 | Made debian package ver 0.8. Removed lintian warining. Converted find_free_port to python3 check-in: 5bd9419845 user: vitus tags: trunk | |
2019-09-21
| ||
17:02 | Fix byte/string issues in send_command check-in: df1b3337bc user: vitus tags: trunk | |
2019-09-20
| ||
21:40 | Converted to python3 check-in: 0141f28d64 user: vitus tags: trunk | |
Changes
Modified vws from [d2f776edc6] to [6a51b18933].
︙ | |||
55 56 57 58 59 60 61 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | - + - + - + | # There can be stray (qemu) prompt in the socket. Try to drain # it try: sock.recv(64, socket.MSG_DONTWAIT) except socket.error as ex: if ex.errno != errno.EAGAIN and ex.errno != errno.EWOULDBLOCK: raise ex |
︙ | |||
106 107 108 109 110 111 112 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | - + | return lst def parse_arp(iface): """ Returns map which maps mac addresses to IPs for specified interface" """ addr_map = {} |
︙ | |||
143 144 145 146 147 148 149 | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | - + | answer = send_command(sock, "info block") return re.search(": /tmp", answer) is not None def read_netinfo(filename): """ Reads network information from start script """ with open(filename, "r") as f: for line in f: |
︙ | |||
435 436 437 438 439 440 441 | 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 | - - - - - - - - + + + + + + + + - + - + - - | f["uri"] = uri[uri.rindex(":")+1:] f.update(get_netinfo(sock)) sock.shutdown(socket.SHUT_RDWR) sock.close() f["state"] = "running" return f |
︙ | |||
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 | 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | + + + + - + | os.system("qemu-img create -f qcow2 -b \"%s\" \"%s\"" % (newnames[i], i)) os.chmod(i, 0o664) return 0 def cmd_snapshots(options): """ vws snapshots - list existing snapshots """ if not options.stopped: print("Cannot list snapshots of running VW", file=sys.stderr) sys.exit(1) os.chdir(options.dir) drives = get_drives(options.dir) lst = [] info = {} with os.popen("qemu-img info --backing-chain " + drives[0], "r") as f: for line in f: if line.find(": ") != -1: var, val = line.strip().split(": ") if val != "": info[var] = val elif line[0] == '\n': lst.append(info) info = {} if info: |
︙ |