Skip to content

Commit

Permalink
Make flashpointvm able to run in read-only mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
LindirQuenya committed Jul 15, 2022
1 parent 82a5cf3 commit cefde2c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
release_name: ${{ steps.prepare.outputs.sha_short }}
draft: false
prerelease: false
- name: Upload release
- name: Upload alpine.qcow2
id: upload_release
uses: actions/upload-release-asset@v1
env:
Expand All @@ -43,3 +43,13 @@ jobs:
asset_path: ./alpine.qcow2
asset_name: alpine.qcow2
asset_content_type: application/octet-stream
- name: Upload dummy.qcow2
id: upload_release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dummy.qcow2
asset_name: dummy.qcow2
asset_content_type: application/octet-stream
8 changes: 6 additions & 2 deletions snapshot.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/sh
rm -f dummy.qcow2
qemu-img create -f qcow2 dummy.qcow2 1M
qemu-system-i386 $QEMU_EXTRA_ARGS -display none -m 128 \
-net 'nic,model=virtio-net-pci' -net 'user,hostfwd=tcp::22500-:80' \
-monitor 'tcp:localhost:4445,server,nowait' -drive 'file=alpine.qcow2,if=virtio' &
-monitor 'tcp:localhost:4445,server,nowait' -drive 'if=none,format=qcow2,file=dummy.qcow2' \
-drive 'file=alpine.qcow2,if=virtio' &
pid=$!

while ! curl -sI 'http://127.0.0.1:22500/' >/dev/null; do
Expand All @@ -10,4 +13,5 @@ done

echo 'apache is ready .. snapshot in 10 seconds' && sleep 10
echo 'savevm quick' | nc -q1 -w5 127.0.0.1 4445 >/dev/null
kill -TERM "$pid"
sleep 2
echo 'quit' | nc -q1 -w5 127.0.0.1 4445 >/dev/null

0 comments on commit cefde2c

Please sign in to comment.