Index: vws ================================================================== --- vws +++ vws @@ -19,11 +19,11 @@ for dirname in search_path: if not os.access(dirname, os.X_OK): continue if (name in os.listdir(dirname) and os.access(os.path.join(dirname, name, "start"), os.X_OK)): - return os.path.join(dirname, + name) + return os.path.join(dirname, name) raise ValueError("Machine %s not found." % name) def connect_vm(vm_dir): """ Connects to monitor of VM in vm_dir and returns connected socket""" @@ -109,10 +109,11 @@ def snapshot_mode(sock): """ Returns True if VM is running in snapshot mode """ answer = send_command(sock, "info block") return re.search(": /tmp", answer) is not None + # # command implementation # @@ -124,11 +125,11 @@ def cmd_start(options): """ vws start """ if options.stopped: arg = "" if options.cdrom: - arg = " -cdrom " + options.cdrom[0] + arg = " -cdrom " + os.path.abspath(options.cdrom[0]) if options.snapshot: arg = arg+" -snapshot" if options.args: arg = arg + " " + "".join(options.args) print arg @@ -230,11 +231,11 @@ sys.exit(1) if options.file is None: answer = send_command(options.sock, "eject " + options.id) else: answer = send_command(options.sock, "change %s %s" % - (options.id, options.file)) + (options.id, os.path.abspath(options.file))) print answer def find_usb(options, devices): """ Search for pattern or address given in options in the given list of devices.