#
# qvm.yaml
#
# Copyright (C) 2021-2023 Franco Masotti (franco \D\o\T masotti {-A-T-} tutanota \D\o\T com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#
# Original license header:
#
# qvm - Trivial management of 64 bit virtual machines with qemu.
#
# Written in 2016 by Franco Masotti (franco \D\o\T masotti {-A-T-} tutanota \D\o\T com)
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the public
# domain worldwide. This software is distributed without any warranty.
#
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.

local:
    test:
        enabled: true

        executables:
            qemu: '/usr/bin/qemu-system-x86_64'

        options:
            start: ''
            end: ''

        system:
            memory: '12G'
            cpu:
                cores: '6'

                # See
                # $ qemu -cpu help
                type: 'host'

            # Mass memory. Use device name with options.
            drives:
                # IMPORTANT: enable the following during the setup.
                # - '/home/user/qvm/development.qcow2'

                # Enable the following after the setup.
                - '/home/user/qvm/development.qcow2.mod'

               # Mass memory. Use device name with options.
               # - '/dev/sdx,format=raw'
               # - '/dev/sdy,format=raw'

            # Enable this for maintenance or installation.
            cdrom:
                # IMPORTANT: set the following to true during the setup.
                # enabled: true

                # Set the following to true after the setup.
                enabled: false

                # Device or file name.
                device: debian.iso

            # Shared data using virtfs or virtiofs.
            mount:
                # Enable this if you need to mount a directory using 9p.
                - name:         'shared'
                  enabled:      false
                  type:         'virtfs'
                  path:         '/home/qvm/shares/test'
                  mount_tag:    'shared'
                # This type of mounting requires more configuration
                - name:         'shared_performance'
                  enabled:      false
                  type:         'virtiofs'
                  path:         '/var/run/qemu-vm-001.sock'
                  mount_tag:    'shared'

            # If enabled is false never show a display.
            display:
                enabled: true
                vnc:
                    enabled: true
                    port: 5900

            audio:
                enabled: true
                device: 'AC97'

            network:
                # TCP ports only.
                ports:
                    - name:      'ssh'
                      type:      'user'
                      enabled:    true
                      host:      '2222'
                      guest:     '22'
                    - name:      'other_0'
                      type:      'user'
                      enabled:    true
                      host:      '5555'
                      guest:     '3050'
                    - name:      'other_1'
                      type:      'user'
                      enabled:    true
                      host:      '5556'
                      guest:     '3051'
