Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions createdisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ function create_crc_libvirt_sh {
function create_qemu_image {
local destDir=$1

sudo cp /var/lib/libvirt/images/${VM_PREFIX}-master-0 $destDir
sudo cp /var/lib/libvirt/images/${VM_PREFIX}-base $destDir
if [ -f /var/lib/libvirt/images/${VM_PREFIX}-master-0 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be cleaner to check for libvirt storage pool existence, get the path from there, and use it. But given our use of sh to do all of this, the way you did is much easier/efficient.

sudo cp /var/lib/libvirt/images/${VM_PREFIX}-master-0 $destDir
sudo cp /var/lib/libvirt/images/${VM_PREFIX}-base $destDir
else
sudo cp /var/lib/libvirt/openshift-images/${VM_PREFIX}/${VM_PREFIX}-master-0 $destDir
sudo cp /var/lib/libvirt/openshift-images/${VM_PREFIX}/${VM_PREFIX}-base $destDir
fi

sudo chown $USER:$USER -R $destDir
${QEMU_IMG} rebase -b ${VM_PREFIX}-base $destDir/${VM_PREFIX}-master-0
Expand Down