Comment 31 for bug 1710019

Revision history for this message
dann frazier (dannf) wrote :

I've verified this for zesty, using my patched zesty kernel. Demonstration of that follows. However, the kernel patches have not yet been approved for zesty, and may never be. I'll hold-off on updating the tags here until a) we have a final answer on the kernel patches or b) we decide there is value in updating QEMU w/o the kernel side.

= Verification log =

ubuntu@dawes:~$ uname -a
Linux dawes 4.10.0-40-generic #44+gicv3sr.1-Ubuntu SMP Thu Nov 9 22:53:54 UTC 2017 aarch64 aarch64 aarch64 GNU/Linux
ubuntu@dawes:~$ cd vm-save-restore/
ubuntu@dawes:~/vm-save-restore$ ./setup.sh
+ set -e
+ cloudrel=zesty
+ cloudimg=zesty-server-cloudimg-arm64.img
+ sudo apt-get install -y cloud-image-utils qemu-kvm qemu-utils qemu-efi libvirt-bin screen uuid-runtime
Reading package lists... Done
Building dependency tree
Reading state information... Done
cloud-image-utils is already the newest version (0.30-0ubuntu2).
screen is already the newest version (4.5.0-5ubuntu1).
qemu-efi is already the newest version (0~20161202.7bbe0b3e-1).
uuid-runtime is already the newest version (2.29-1ubuntu2.1).
libvirt-bin is already the newest version (2.5.0-3ubuntu5.6).
qemu-kvm is already the newest version (1:2.8+dfsg-3ubuntu2.8).
qemu-utils is already the newest version (1:2.8+dfsg-3ubuntu2.8).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ test -f zesty-server-cloudimg-arm64.img
+ echo #!/bin/sh
+ sudo tee /etc/qemu-ifup
+ echo
+ sudo tee -a /etc/qemu-ifup
+ echo set -e
+ sudo tee -a /etc/qemu-ifup
+ echo
+ sudo tee -a /etc/qemu-ifup
+ echo ip link set "$1" up
+ sudo tee -a /etc/qemu-ifup
+ echo ip link set "$1" master virbr0
+ sudo tee -a /etc/qemu-ifup
ubuntu@dawes:~/vm-save-restore$ ./test.sh
+ i=0
+ [ -f /var/log/libvirt/qemu/4273-0.log ]
+ name=4273-0
+ ./randmac.py
+ mac=00:16:3e:1c:57:55
+ uuidgen
+ uuid=1578301c-e2fe-4981-87b5-bee2c56fa14c
+ mktemp
+ xml=/tmp/tmp.D9DXzEvOHn
+ cp template.xml /tmp/tmp.D9DXzEvOHn
+ trap cleanup EXIT
+ mkdir -p vms
+ dd if=/dev/zero of=./vms/4273-0_CODE.fd bs=1M count=64
64+0 records in
64+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 0.166913 s, 402 MB/s
+ dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=./vms/4273-0_CODE.fd conv=notrunc
4096+0 records in
4096+0 records out
2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.0602123 s, 34.8 MB/s
+ dd if=/dev/zero of=./vms/4273-0_VARS.fd bs=1M count=64
64+0 records in
64+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 0.16786 s, 400 MB/s
+ cat
+ cloud-localds vms/4273-0_seed.img vms/4273-0_user-data
+ pwd
+ qemu-img create -f qcow2 -o backing_file=/home/ubuntu/vm-save-restore/zesty-server-cloudimg-arm64.img ./vms/4273-0.img
Formatting './vms/4273-0.img', fmt=qcow2 size=2361393152 backing_file=/home/ubuntu/vm-save-restore/zesty-server-cloudimg-arm64.img encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
+ sed -i s/\#VM\#/4273-0/ /tmp/tmp.D9DXzEvOHn
+ pwd
+ sed -i s,\#DIR\#,/home/ubuntu/vm-save-restore, /tmp/tmp.D9DXzEvOHn
+ sed -i s/\#UUID\#/1578301c-e2fe-4981-87b5-bee2c56fa14c/ /tmp/tmp.D9DXzEvOHn
+ sed -i s/\#MAC\#/00:16:3e:1c:57:55/ /tmp/tmp.D9DXzEvOHn
+ sudo virsh define /tmp/tmp.D9DXzEvOHn
Domain 4273-0 defined from /tmp/tmp.D9DXzEvOHn

+ sudo virsh start 4273-0
Domain 4273-0 started

+ sleep 60
+ sudo virsh save 4273-0 ./vms/4273-0.sav

Domain 4273-0 saved to ./vms/4273-0.sav

+ sudo virsh restore ./vms/4273-0.sav
Domain restored from ./vms/4273-0.sav

+ sleep 5
+ sudo virsh save 4273-0 ./vms/4273-0.sav

Domain 4273-0 saved to ./vms/4273-0.sav

+ sudo virsh restore ./vms/4273-0.sav
Domain restored from ./vms/4273-0.sav

+ sudo virsh save 4273-0 ./vms/4273-0.sav

Domain 4273-0 saved to ./vms/4273-0.sav

+ sudo virsh restore ./vms/4273-0.sav
Domain restored from ./vms/4273-0.sav

+ cleanup
+ sudo virsh destroy 4273-0
Domain 4273-0 destroyed

+ sudo virsh undefine 4273-0 --nvram
Domain 4273-0 has been undefined

+ rm -f ./vms/4273-0.img ./vms/4273-0_CODE.fd ./vms/4273-0_VARS.fd /tmp/tmp.D9DXzEvOHn ./vms/4273-0.sav vms/4273-0_user-data vms/4273-0_seed.img