mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-05 11:31:14 +00:00
7bc3452139
Partially revert 111225a2a5
and add the new dbus and pvpanic arguments.
As we are switching back to clap observe the following changes.
A few examples:
1. `-v -v -v` needs to be written as`-vvv`
2. `--disk D1 --disk D2` and others need to be written as `--disk D1 D2`.
3. `--option value` needs to be written as `--option=value.`
Change integration tests to adapt to the breaking changes.
Signed-off-by: Wei Liu <liuwe@microsoft.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@intel.com>
77 lines
2.6 KiB
Plaintext
77 lines
2.6 KiB
Plaintext
#cloud-config
|
|
users:
|
|
- name: cloud
|
|
passwd: $6$7125787751a8d18a$sHwGySomUA1PawiNFWVCKYQN.Ec.Wzz0JtPPL1MvzFrkwmop2dq7.4CYf03A5oemPQ4pOFCCrtCelvFBEle/K.
|
|
sudo: ALL=(ALL) NOPASSWD:ALL
|
|
lock_passwd: False
|
|
inactive: False
|
|
shell: /bin/bash
|
|
|
|
ssh_pwauth: True
|
|
|
|
runcmd:
|
|
- [ systemctl, daemon-reload]
|
|
- [ systemctl, enable, notify-booted.service]
|
|
- [ systemctl, start, --no-block, notify-booted.service ]
|
|
|
|
write_files:
|
|
-
|
|
path: /etc/systemd/system/vfio.service
|
|
permissions: 0644
|
|
content: |
|
|
[Unit]
|
|
Description=VFIO test systemd service
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=/bin/bash /usr/bin/cloud-hypervisor-vfio.sh
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
|
|
-
|
|
path: /usr/bin/cloud-hypervisor-vfio.sh
|
|
permissions: 0755
|
|
content: |
|
|
#!/bin/bash
|
|
|
|
mount /dev/vdc /mnt
|
|
bash -c "echo 1af4 1042 > /sys/bus/pci/drivers/vfio-pci/new_id"
|
|
bash -c "echo 0000:00:05.0 > /sys/bus/pci/devices/0000\:00\:05.0/driver/unbind"
|
|
bash -c "echo 0000:00:05.0 > /sys/bus/pci/drivers/vfio-pci/bind"
|
|
bash -c "echo 1af4 1041 > /sys/bus/pci/drivers/vfio-pci/new_id"
|
|
bash -c "echo 0000:00:07.0 > /sys/bus/pci/devices/0000\:00\:07.0/driver/unbind"
|
|
bash -c "echo 0000:00:07.0 > /sys/bus/pci/drivers/vfio-pci/bind"
|
|
bash -c "echo 0000:00:08.0 > /sys/bus/pci/devices/0000\:00\:08.0/driver/unbind"
|
|
bash -c "echo 0000:00:08.0 > /sys/bus/pci/drivers/vfio-pci/bind"
|
|
# 1G ram requires 512 pages
|
|
echo 512 | sudo tee /proc/sys/vm/nr_hugepages
|
|
sudo chmod a+rwX /dev/hugepages
|
|
/mnt/cloud-hypervisor --kernel /mnt/vmlinux --cmdline "console=hvc0 reboot=k panic=1 nomodules root=/dev/vda1 VFIOTAG" --disk path=/mnt/focal-server-cloudimg-amd64-custom-20210609-0.raw path=/mnt/cloudinit.img --cpus boot=1 --memory size=512M,hotplug_size=1G,hugepages=on --device path=/sys/bus/pci/devices/0000:00:05.0/ path=/sys/bus/pci/devices/0000:00:07.0/ path=/sys/bus/pci/devices/0000:00:08.0/ --api-socket=/tmp/ch_api.sock
|
|
|
|
-
|
|
path: /etc/systemd/system/notify-booted.service
|
|
permissions: 0644
|
|
content: |
|
|
[Unit]
|
|
Description=Notify the tcp listener on the host that the guest is booted
|
|
After=sshd.service
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=/usr/bin/cloud-hypervisor-notify-booted.sh
|
|
Restart=on-failure
|
|
RestartSec=2
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
|
|
-
|
|
path: /usr/bin/cloud-hypervisor-notify-booted.sh
|
|
permissions: 0755
|
|
content: |
|
|
#!/bin/bash
|
|
set -e
|
|
|
|
echo -n "@DEFAULT_TCP_LISTENER_MESSAGE" > /dev/tcp/@HOST_IP/@TCP_LISTENER_PORT
|