summaryrefslogtreecommitdiff
path: root/virt-install
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2019-06-11 12:15:35 -0400
committerCole Robinson <crobinso@redhat.com>2019-06-11 17:55:09 -0400
commit13b3790829cc7f950237d5134ab2dc2c7982cf5d (patch)
tree9d0194237a09fc0a9a98275763a7695b57c155d9 /virt-install
parentcb0e37786ff7148f811ba5df5f9a2f19da4d5b7d (diff)
downloadvirt-manager-13b3790829cc7f950237d5134ab2dc2c7982cf5d.tar.gz
virt-install: Print when we set default memory and disk
Since we never defaulted here before, print out the values we are setting. Users can see right away if they actually want those values or not.
Diffstat (limited to 'virt-install')
-rwxr-xr-xvirt-install10
1 files changed, 9 insertions, 1 deletions
diff --git a/virt-install b/virt-install
index 346577af..0e2d5c9d 100755
--- a/virt-install
+++ b/virt-install
@@ -538,17 +538,25 @@ def set_cli_defaults(options, guest):
ncpus = res.get_recommended_ncpus(guest.os.arch)
if ram and not memory_specified(guest):
+ mbram = str(ram / (1024 * 1024)).rstrip("0").rstrip(".")
+ cli.print_stdout(
+ _("Using {os_name} default --memory {megabytes}").format(
+ os_name=guest.osinfo.name, megabytes=mbram))
guest.currentMemory = ram // 1024
if ncpus:
# We need to do this upfront, so we don't incorrectly set guest.vcpus
guest.sync_vcpus_topology()
if not guest.vcpus:
+ # I don't think we need to print anything here as this was never
+ # a required value.
guest.vcpus = ncpus
if storage and not storage_specified(options, guest):
diskstr = 'size=%d' % (storage // (1024 ** 3))
- logging.debug("Generated default libosinfo '--disk %s'", diskstr)
+ cli.print_stdout(
+ _("Using {os_name} default --disk {disk_options}".format(
+ os_name=guest.osinfo.name, disk_options=diskstr)))
options.disk = [diskstr]
cli.ParserDisk(diskstr, guest=guest).parse(None)