virt-install: Set default memory to appease lxc:///
AFAICT the driver doesn't really do anything with it, but libvirt XML requires it. So just default to --memory 64 Fixes: #73 Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
9b7c819c64
commit
e4f68764b0
|
@ -1,8 +1,8 @@
|
|||
<domain type="lxc">
|
||||
<name>foolxc</name>
|
||||
<uuid>00000000-1111-2222-3333-444444444444</uuid>
|
||||
<memory>65536</memory>
|
||||
<currentMemory>65536</currentMemory>
|
||||
<memory>131072</memory>
|
||||
<currentMemory>131072</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch="x86_64">exe</type>
|
||||
|
|
|
@ -1029,11 +1029,11 @@ c.add_compare("--connect %(URI-KVM)s --arch x86_64", "x86_64-graphics")
|
|||
# LXC specific tests #
|
||||
######################
|
||||
|
||||
c = vinst.add_category("lxc", "--name foolxc --memory 64 --noautoconsole --connect " + utils.URIs.lxc)
|
||||
c = vinst.add_category("lxc", "--name foolxc --noautoconsole --connect " + utils.URIs.lxc)
|
||||
c.add_invalid("--filesystem /,not/abs") # filesystem target is not absolute
|
||||
c.add_compare("", "default")
|
||||
c.add_compare("--os-variant fedora27", "default-f27")
|
||||
c.add_compare("--filesystem /source,/", "fs-default")
|
||||
c.add_compare("--filesystem /source,/ --memory 128", "fs-default")
|
||||
c.add_compare("--init /usr/bin/httpd", "manual-init")
|
||||
|
||||
|
||||
|
|
|
@ -454,6 +454,11 @@ def set_cli_defaults(options, guest):
|
|||
guest.name = default_name
|
||||
|
||||
if guest.os.is_container():
|
||||
if not memory_specified(guest):
|
||||
# LXC doesn't even do anything with memory settings, but libvirt
|
||||
# XML requires it anyways. Fill in 64 MiB
|
||||
log.debug("Setting container default --memory 64")
|
||||
guest.currentMemory = 64 // 1024
|
||||
return
|
||||
|
||||
if (options.unattended and
|
||||
|
|
Loading…
Reference in New Issue