mirror of
https://github.com/ceph/ceph
synced 2024-12-30 07:23:11 +00:00
d9017fb95c
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
45 lines
1.1 KiB
Bash
Executable File
45 lines
1.1 KiB
Bash
Executable File
#!/bin/sh -ex
|
|
|
|
if [[ -z "${IMAGE_NAME}" ]]; then
|
|
echo image name must be provided
|
|
exit 1
|
|
fi
|
|
|
|
is_qemu_running() {
|
|
rbd status ${IMAGE_NAME} | grep -v "Watchers: none"
|
|
}
|
|
|
|
wait_for_qemu() {
|
|
while ! is_qemu_running ; do
|
|
echo "*** Waiting for QEMU"
|
|
sleep 30
|
|
done
|
|
}
|
|
|
|
rbd feature disable ${IMAGE_NAME} journaling || true
|
|
rbd feature disable ${IMAGE_NAME} fast-diff || true
|
|
rbd feature disable ${IMAGE_NAME} object-map || true
|
|
rbd feature disable ${IMAGE_NAME} exclusive-lock || true
|
|
|
|
wait_for_qemu
|
|
while is_qemu_running ; do
|
|
echo "*** Enabling all features"
|
|
rbd feature enable ${IMAGE_NAME} exclusive-lock
|
|
rbd feature enable ${IMAGE_NAME} journaling
|
|
rbd feature enable ${IMAGE_NAME} object-map
|
|
rbd feature enable ${IMAGE_NAME} fast-diff
|
|
if is_qemu_running ; then
|
|
sleep 60
|
|
fi
|
|
|
|
echo "*** Disabling all features"
|
|
rbd feature disable ${IMAGE_NAME} journaling
|
|
rbd feature disable ${IMAGE_NAME} fast-diff
|
|
rbd feature disable ${IMAGE_NAME} object-map
|
|
rbd feature disable ${IMAGE_NAME} exclusive-lock
|
|
if is_qemu_running ; then
|
|
sleep 60
|
|
fi
|
|
done
|
|
|