mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
virt-install: Add --clock option
This commit is contained in:
parent
a163f44a27
commit
d0b067f2fc
@ -202,11 +202,31 @@ Enable hypver VAPIC, but disable spinlocks
|
||||
|
||||
=back
|
||||
|
||||
=item --clock offset=OFFSET,TIMER_OPT=VAL,...
|
||||
|
||||
Configure the guest's <clock> XML. Some supported options:
|
||||
|
||||
=over 2
|
||||
|
||||
=item B<--clock offset=OFFSET>
|
||||
|
||||
Set the clock offset, ex. 'utc' or 'localtime'
|
||||
|
||||
=item B<--clock TIMER_present=no>
|
||||
|
||||
Disable a boolean timer. TIMER here might be hpet, kvmclock, etc.
|
||||
|
||||
=item B<--clock TIMER_tickpolicy=VAL>
|
||||
|
||||
Set a timer's tickpolicy value. TIMER here might be rtc, pit, etc. VAL
|
||||
might be catchup, delay, etc. Refer to the libvirt docs for all values.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
|
||||
|
||||
=back
|
||||
|
||||
=head2 Installation Method options
|
||||
|
||||
|
@ -21,7 +21,10 @@
|
||||
<spinlocks state="on" retries="1234"/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
<clock offset="localtime">
|
||||
<timer name="rtc" tickpolicy="merge"/>
|
||||
<timer name="hpet" present="no"/>
|
||||
</clock>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>destroy</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
@ -117,7 +120,10 @@
|
||||
<spinlocks state="on" retries="1234"/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
<clock offset="localtime">
|
||||
<timer name="rtc" tickpolicy="merge"/>
|
||||
<timer name="hpet" present="no"/>
|
||||
</clock>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
|
@ -429,6 +429,7 @@ c.add_invalid("--vcpus 32 --cpuset=autofoo") # Bogus cpuset
|
||||
c.add_invalid("--vcpus 20 --check-cpu") # Over host vcpus w/ --check-cpu
|
||||
c.add_invalid("--cpu host") # --cpu host, but no host CPU in caps
|
||||
c.add_invalid("--numatune 1-3,4,mode=strict") # Non-escaped numatune
|
||||
c.add_invalid("--clock foo_tickpolicy=merge") # Unknown timer
|
||||
|
||||
|
||||
c = vinst.add_category("smartcard", "--noautoconsole --nodisks --pxe")
|
||||
@ -452,7 +453,6 @@ c.add_valid("--rng egd,backend_host=127.0.0.1,backend_service=8000,backend_type=
|
||||
c.add_valid("--rng egd,backend_host=127.0.0.1,backend_service=8000,backend_type=tcp,backend_mode=bind") # egd backend, bind mode
|
||||
c.add_invalid("--rng foo,backend_host=127.0.0.1,backend_service=8000,backend_mode=connect") # invalid type
|
||||
|
||||
|
||||
c = vinst.add_category("xen", "--connect %(XENURI)s --noautoconsole")
|
||||
c.add_compare("--disk %(EXISTIMG1)s --import", "xen-default") # Xen default
|
||||
c.add_compare("--disk %(EXISTIMG1)s --location %(TREEDIR)s --paravirt", "xen-pv") # Xen PV
|
||||
@ -507,6 +507,7 @@ c.add_compare("""--hvm --pxe \
|
||||
--boot loader=/foo/bar \
|
||||
--host-device net_00_1c_25_10_b1_e4 \
|
||||
--features acpi=off,eoi=on,privnet=on,hyperv_spinlocks=on,hyperv_spinlocks_retries=1234 \
|
||||
--clock offset=localtime,hpet_present=no,rtc_tickpolicy=merge \
|
||||
""", "many-devices") # Lots of devices
|
||||
c.add_valid("--hvm --disk path=virt-install,device=cdrom") # Specifying cdrom media via --disk
|
||||
c.add_valid("--hvm --import --disk path=virt-install") # FV Import install
|
||||
|
@ -505,6 +505,7 @@ def build_guest_instance(conn, options):
|
||||
cli.parse_security(guest, options.security)
|
||||
cli.parse_boot(guest, options.bootopts)
|
||||
cli.parse_features(guest, options.features)
|
||||
cli.parse_clock(guest, options.clock)
|
||||
|
||||
guest.autostart = options.autostart
|
||||
guest.description = options.description
|
||||
@ -913,6 +914,9 @@ def parse_args():
|
||||
help=_("Set domain <features> XML. Ex:\n"
|
||||
"--features acpi=off\n"
|
||||
"--features apic=on,eoi=on"))
|
||||
geng.add_option("--clock", dest="clock",
|
||||
help=_("Set domain <clock> XML. Ex:\n"
|
||||
"--clock offset=localtime,rtc_tickpolicy=catchup"))
|
||||
parser.add_option_group(geng)
|
||||
|
||||
insg = optparse.OptionGroup(parser, _("Installation Method Options"))
|
||||
|
@ -1313,11 +1313,44 @@ def parse_features(guest, optstr):
|
||||
_check_leftover_opts(opts)
|
||||
|
||||
|
||||
###################
|
||||
# --clock parsing #
|
||||
###################
|
||||
|
||||
def parse_clock(guest, optstr):
|
||||
opts = parse_optstr(optstr)
|
||||
|
||||
set_param = _build_set_param(guest.clock, opts)
|
||||
set_param("offset", "offset")
|
||||
|
||||
timer_opt_names = ["tickpolicy", "present"]
|
||||
timer_opts = {}
|
||||
for key in opts.keys():
|
||||
for name in timer_opt_names:
|
||||
if not key.endswith("_" + name):
|
||||
continue
|
||||
timer_name = key[:-(len(name) + 1)]
|
||||
if timer_name not in timer_opts:
|
||||
timer_opts[timer_name] = {}
|
||||
timer_opts[timer_name][key] = opts.pop(key)
|
||||
|
||||
_check_leftover_opts(opts)
|
||||
|
||||
for timer_name, subopts in timer_opts.items():
|
||||
timer = guest.clock.add_timer()
|
||||
timer.name = timer_name
|
||||
|
||||
set_param = _build_set_param(timer, subopts)
|
||||
set_param("tickpolicy", "%s_tickpolicy" % timer_name)
|
||||
set_param("present", "%s_present" % timer_name,
|
||||
convert_cb=_on_off_convert)
|
||||
_check_leftover_opts(subopts)
|
||||
|
||||
|
||||
##########################
|
||||
# Guest <device> parsing #
|
||||
##########################
|
||||
|
||||
|
||||
##################
|
||||
# --disk parsing #
|
||||
##################
|
||||
|
Loading…
Reference in New Issue
Block a user