mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
Stub out --check-cpu option
It's old, uninteresting, and I don't think anyone is depending on it to work. Parse the command line option, but don't do anything differently.
This commit is contained in:
parent
6c7439d625
commit
d216c44157
@ -78,10 +78,6 @@ more info.
|
||||
Configure the CPU and CPU features exposed to the guest. Please see
|
||||
L<virt-install(1)> for more info.
|
||||
|
||||
=item --check-cpu
|
||||
|
||||
Check that vcpus do not exceed physical CPUs and warn if they do.
|
||||
|
||||
=item --os-variant=OS_VARIANT
|
||||
|
||||
Optimize the guest configuration for a specific operating system (ex.
|
||||
|
@ -1386,11 +1386,6 @@ change host device configuration, or actually teach libvirt about the guest.
|
||||
virt-install may still fetch install media, since this is required to
|
||||
properly detect the OS to install.
|
||||
|
||||
=item --check-cpu
|
||||
|
||||
Check that the number virtual cpus requested does not exceed physical CPUs and
|
||||
warn if they do.
|
||||
|
||||
=item -q, --quiet
|
||||
|
||||
Only print fatal error messages.
|
||||
|
@ -418,7 +418,6 @@ c.add_valid("--vcpus 4 --cpuset=1,3-5") # Cpuset
|
||||
c.add_valid("--vcpus 4 --cpuset=1,3-5,") # Cpuset with trailing comma
|
||||
c.add_valid("--vcpus 4 --cpuset=auto") # Cpuset with trailing comma
|
||||
c.add_valid("--ram 100000000000") # Ram overcommit
|
||||
c.add_valid("--vcpus 5,maxvcpus=10 --check-cpu") # maxvcpus, --check-cpu shouldn't error
|
||||
c.add_valid("--vcpus 4,cores=2,threads=2,sockets=2") # Topology
|
||||
c.add_valid("--vcpus 4,cores=1") # Topology auto-fill
|
||||
c.add_valid("--vcpus sockets=2,threads=2") # Topology only
|
||||
@ -429,7 +428,6 @@ c.add_valid("--numatune 1-3,4,mode=strict") # More complex, parser should do th
|
||||
c.add_compare("--connect %(DEFAULTURI)s --cpuset auto --vcpus 2", "cpuset-auto") # --cpuset=auto actually works
|
||||
c.add_invalid("--vcpus 32 --cpuset=969-1000") # Bogus cpuset
|
||||
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("--clock foo_tickpolicy=merge") # Unknown timer
|
||||
|
||||
|
@ -108,8 +108,7 @@ def main(conn=None):
|
||||
|
||||
if options.uuid:
|
||||
guest.uuid = options.uuid
|
||||
cli.get_vcpus(guest, options.vcpus or image.domain.vcpu or "",
|
||||
options.check_cpu)
|
||||
cli.parse_vcpus(guest, options.vcpu or image.domain.vcpu or "")
|
||||
cli.get_cpuset(guest, options.cpuset)
|
||||
cli.parse_cpu(guest, options.cpu)
|
||||
cli.get_networks(guest, options.network)
|
||||
|
@ -505,7 +505,7 @@ def build_guest_instance(conn, options):
|
||||
guest.os.init = options.init
|
||||
if options.uuid:
|
||||
guest.uuid = options.uuid
|
||||
cli.get_vcpus(guest, options.vcpus, options.check_cpu)
|
||||
cli.parse_vcpus(guest, options.vcpus)
|
||||
cli.parse_numatune(guest, options.numatune)
|
||||
cli.parse_cpu(guest, options.cpu)
|
||||
cli.parse_security(guest, options.security)
|
||||
|
@ -564,27 +564,6 @@ def get_memory(guest, memory):
|
||||
func=check_memory)
|
||||
|
||||
|
||||
def get_vcpus(guest, vcpus, check_cpu):
|
||||
if vcpus is None:
|
||||
vcpus = ""
|
||||
|
||||
parse_vcpu(guest, vcpus)
|
||||
if not check_cpu:
|
||||
return
|
||||
|
||||
hostinfo = guest.conn.getInfo()
|
||||
pcpus = hostinfo[4] * hostinfo[5] * hostinfo[6] * hostinfo[7]
|
||||
|
||||
if guest.vcpus > pcpus:
|
||||
msg = _("You have asked for more virtual CPUs (%d) than there "
|
||||
"are physical CPUs (%d) on the host. This will work, "
|
||||
"but performance will be poor. ") % (guest.vcpus, pcpus)
|
||||
askmsg = _("Are you sure? (yes or no)")
|
||||
|
||||
if not prompt_for_yes_no(msg, askmsg):
|
||||
nice_exit()
|
||||
|
||||
|
||||
def get_cpuset(guest, cpuset):
|
||||
memory = guest.memory
|
||||
conn = guest.conn
|
||||
@ -1236,7 +1215,7 @@ class ParserVCPU(VirtCLIParser):
|
||||
inst.vcpus = inst.cpu.vcpus_from_topology()
|
||||
return ret
|
||||
|
||||
parse_vcpu = ParserVCPU().parse
|
||||
parse_vcpus = ParserVCPU().parse
|
||||
|
||||
|
||||
#################
|
||||
|
Loading…
Reference in New Issue
Block a user