mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
cli: --pm: use predictable cli subarg names
To match the XML schema, rename these subarguments and add aliases to preserve compatibility: * suspend_to_disk -> suspend_to_disk.enabled * suspend_to_mem -> suspend_to_mem.enabled
This commit is contained in:
parent
a160fac5e8
commit
83e15a3bce
@ -352,7 +352,9 @@ Use --clock=? to see a list of all available sub options. Complete details at L<
|
||||
|
||||
=item B<--pm> OPTIONS
|
||||
|
||||
Configure guest power management features. Example suboptions include suspend_to_mem=on|off and suspend_to_disk=on|off
|
||||
Configure guest power management features. Example:
|
||||
|
||||
--pm suspend_to_memi.enabled=on,suspend_to_disk.enabled=off
|
||||
|
||||
Use --pm=? to see a list of all available sub options. Complete details at L<https://libvirt.org/formatdomain.html#elementsPowerManagement>
|
||||
|
||||
|
@ -2210,12 +2210,16 @@ class ParserClock(VirtCLIParser):
|
||||
class ParserPM(VirtCLIParser):
|
||||
cli_arg_name = "pm"
|
||||
guest_propname = "pm"
|
||||
aliases = {
|
||||
"suspend_to_mem.enabled": "suspend_to_mem",
|
||||
"suspend_to_disk.enabled": "suspend_to_disk",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def _init_class(cls, **kwargs):
|
||||
VirtCLIParser._init_class(**kwargs)
|
||||
cls.add_arg("suspend_to_mem", "suspend_to_mem", is_onoff=True)
|
||||
cls.add_arg("suspend_to_disk", "suspend_to_disk", is_onoff=True)
|
||||
cls.add_arg("suspend_to_mem.enabled", "suspend_to_mem", is_onoff=True)
|
||||
cls.add_arg("suspend_to_disk.enabled", "suspend_to_disk", is_onoff=True)
|
||||
|
||||
|
||||
#####################
|
||||
|
Loading…
Reference in New Issue
Block a user