#66 Parse CMD_LINE_ARGS and add CMD_LINE_ENVS
Merged 3 years ago by frantisekz. Opened 3 years ago by frantisekz.

file modified
+6 -5
@@ -1,8 +1,8 @@ 

- <domain type='kvm'>

-     <name>{{ domain_name }}</name>

-     <uuid>{{ uuid }}</uuid>

-     <memory unit='KiB'>{{ memory }}</memory>

-     <currentMemory unit='KiB'>{{ memory }}</currentMemory>

+ <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>

+   <name>{{ domain_name }}</name>

+   <uuid>{{ uuid }}</uuid>

+   <memory unit='KiB'>{{ memory }}</memory>

+   <currentMemory unit='KiB'>{{ memory }}</currentMemory>

    <vcpu placement='static'>1</vcpu>

    <os>

      <type arch='x86_64' machine='pc'>hvm</type>
@@ -61,4 +61,5 @@ 

        <backend model='random'>/dev/urandom</backend>

      </rng>

    </devices>

+   {{ qemu_args }}

  </domain>

file modified
+2 -1
@@ -44,6 +44,7 @@ 

  ## Customize as needed :)

  

  #CMD_LINE_ARGS = []

+ #CMD_LINE_ENVS = {}

  

  # The timeout, in seconds, to wait for an instance to boot before

  # failing the boot process. Setting this to 0 disables waiting and
@@ -64,4 +65,4 @@ 

  #STOP_RETRY_WAIT = 1

  

  # Desired VM type: False = BIOS, True = UEFI

- #UEFI = False 

\ No newline at end of file

+ #UEFI = False

file modified
+1
@@ -126,6 +126,7 @@ 

      # Customize as needed :)

  

      CMD_LINE_ARGS = []

+     CMD_LINE_ENVS = {}

  

      # timeout, in seconds for instance boot process

      BOOT_TIMEOUT = 30

file modified
+11
@@ -374,6 +374,17 @@ 

                             'uefi_loader': "",

                             'emulator_path': "/usr/bin/qemu-kvm"}

  

+         if config_data.CMD_LINE_ARGS or config_data.CMD_LINE_ENVS:

+             args_envs = "  <qemu:commandline>\n"

+             for qemu_arg in config_data.CMD_LINE_ARGS:

+                 args_envs += "    <qemu:arg value='%s'/>\n" % qemu_arg

+ 

+             for qemu_env in config_data.CMD_LINE_ENVS:

+                 args_envs += "    <qemu:env name='%s' value='%s'/>\n" % (qemu_env, config_data.CMD_LINE_ENVS[qemu_env])

+ 

+             args_envs += "  </qemu:commandline>"

+             instance_values["qemu_args"] = args_envs

+ 

          if config_data.UEFI:

              instance_values['uefi_loader'] = "<loader readonly='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>"

  

rebased onto 9d8ea15aa1b7deb015af6ef84fc5da486cb4fdc6

3 years ago

rebased onto 1d0c1fdb5364dc5f5638c008dbc17dc90a520967

3 years ago

rebased onto cacc2342e45a56a110ade80e2d6a4177e843bd2c

3 years ago

rebased onto 88c1a89

3 years ago

Pull-Request has been merged by frantisekz

3 years ago