diff --git a/man/virt-manager.pod b/man/virt-manager.pod index 9b0d6e7c..cc621578 100644 --- a/man/virt-manager.pod +++ b/man/virt-manager.pod @@ -62,20 +62,20 @@ The following C options are currently available: Display the wizard for creating new virtual machines -=item --show-domain-editor=UUID +=item --show-domain-editor=NAME|ID|UUID Display the dialog for editing properties of the virtual machine with -unique ID matching C +unique ID matching either the domain name, ID, or UUID -=item --show-domain-performance=UUID +=item --show-domain-performance=NAME|ID|UUID Display the dialog for monitoring performance of the virtual machine with -unique ID matching C +unique ID matching either the domain name, ID, or UUID -=item --show-domain-console=UUID +=item --show-domain-console=NAME|ID|UUID Display the virtual console of the virtual machine with -unique ID matching C +unique ID matching either the domain name, ID, or UUID =item --show-host-summary diff --git a/virt-manager b/virt-manager index 0df4485e..732d9263 100755 --- a/virt-manager +++ b/virt-manager @@ -112,11 +112,11 @@ def parse_commandline(): parser.add_argument("--show-domain-creator", action="store_true", help="Show 'New VM' wizard") - parser.add_argument("--show-domain-editor", metavar="UUID", + parser.add_argument("--show-domain-editor", metavar="NAME|ID|UUID", help="Show domain details window") - parser.add_argument("--show-domain-performance", metavar="UUID", + parser.add_argument("--show-domain-performance", metavar="NAME|ID|UUID", help="Show domain performance window") - parser.add_argument("--show-domain-console", metavar="UUID", + parser.add_argument("--show-domain-console", metavar="NAME|ID|UUID", help="Show domain graphical console window") parser.add_argument("--show-host-summary", action="store_true", help="Show connection details window") diff --git a/virtManager/engine.py b/virtManager/engine.py index 0bd50a6d..941969fd 100644 --- a/virtManager/engine.py +++ b/virtManager/engine.py @@ -731,15 +731,27 @@ class vmmEngine(vmmGObject): self.conns[uri]["windowDetails"][uuid] = obj return self.conns[uri]["windowDetails"][uuid] - def _show_vm_helper(self, src, uri, uuid, page=None, forcepage=False): + def _find_vm_by_id(self, uri, domstr): + vms = self.conns[uri]["conn"].vms + if domstr in vms: + return domstr + for vm in vms.values(): + if domstr.isdigit(): + if int(domstr) == vm.get_id(): + return vm.get_uuid() + elif domstr == vm.get_name(): + return vm.get_uuid() + + def _show_vm_helper(self, src, uri, domstr, page=None, forcepage=False): try: - if uuid not in self.conns[uri]["conn"].vms: + uuid = self._find_vm_by_id(uri, domstr) + if not uuid: # This will only happen if --show-* option was used during # virt-manager launch and an invalid UUID is passed. # The error message must be sync otherwise the user will not # know why the application ended. - self.err.show_err("%s does not have VM with UUID %s" % - (uri, uuid), modal=True) + self.err.show_err("%s does not have VM '%s'" % + (uri, domstr), modal=True) return details = self._get_details_dialog(uri, uuid)