Check that the image exists in qemu_driver create instead of always succeeding #185
Open
koolkhel
wants to merge 1 commits from
koolkhel/vitastor:qemu-create-check into master
pull from: koolkhel/vitastor:qemu-create-check
merge into: vitalif:master
vitalif:master
vitalif:primary-stickiness
vitalif:libvfn
vitalif:canceling
vitalif:immediate-repeering
vitalif:rdma-close-tcp
vitalif:use-degraded-writes
vitalif:fix-write-delete-flow
vitalif:openssl-3.0.12
vitalif:openssl-capture-secrets
vitalif:ignore-small-rdma-end
vitalif:encrypt-batch
vitalif:faster-peering-calc
vitalif:http-hello
vitalif:xxh3-bench
vitalif:create-user-etcd-based
vitalif:aesxts_streaming_nosupport
vitalif:refactor-heap-continue-write
vitalif:ston3lu-patch-0127
vitalif:rdma-credits
vitalif:heap-meta
vitalif:sendmsg-zc-no-more-error
vitalif:fix-clear-refs
vitalif:veeam-trick
vitalif:test-etcd-schizo
vitalif:test
vitalif:test1
vitalif:test2
vitalif:cow-meta
vitalif:kv-readahead
vitalif:qemu-fix-crash-idea
vitalif:eventloop-auto-init-trigger
vitalif:hugo-docs
vitalif:node-mutex-and-postpone
vitalif:check-writeback
vitalif:msgr-iothreads-v2
vitalif:antietcd
vitalif:rel-1.4
vitalif:test-fix-ec-unknown-state-51
vitalif:kv-update
vitalif:kv-debug
vitalif:hotfix-1.2.0
vitalif:rdma-simple-nodp
vitalif:zerocopy-tcp-send
vitalif:csi-staging
vitalif:hotfix-1.1.0
vitalif:hotfix-1.0.0
vitalif:fsync-feedback
vitalif:cached-reads
vitalif:qemu-send-loop
vitalif:test-double-alloc
vitalif:hier-failure-domains
vitalif:mon-self-restart
vitalif:epoch-deletions
vitalif:rdma-flow-control
vitalif:csi-use-vitastor-cli
vitalif:rdma-v2
vitalif:etcd-hide-base64
vitalif:lrc-matrix
vitalif:rm-left-on-dead
vitalif:nfs-proxy-old
vitalif:non-odp-rdma
vitalif:test-zctr
vitalif:separate-data-connections
vitalif:sec_osd_msgr
vitalif:test-assert
vitalif:nbd-vmsplice
vitalif:allow-etcd-address-option
vitalif:rdma-zerocopy
vitalif:rel-0.5
vitalif:openonload
vitalif:sync-io-test
vitalif:trace-sync
vitalif:trace-sqes
vitalif:test-submit-and-wait
vitalif:test-sq-poll
vitalif:blocking-uring-test
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "koolkhel/vitastor:qemu-create-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
qemu-img create -f raw vitastor:image=<name> <size>printedFormatting…and exited with 0, butvitastor_co_create_opts()didn't create anything: the next open failed withimage does not exist,and for an existing smaller image the size silently stayed the same.
QEMU can't create Vitastor images, so create now opens the named image read-only (the same way
block/crypto.copens the protocol layer in its create:bdrv_open()before 8.0,bdrv_co_open()from 8.0,
bdrv_co_unref()from 8.1) and:Can't open the image (QEMU doesn't create Vitastor images, use vitastor-cli create): image does not exist;Image is smaller than requested: 33554432 < 67108864 bytes (QEMU doesn't resize Vitastor images, use vitastor-cli modify --resize);strip it before creating the protocol layer). So
qemu-img convertwithout-ninto an existing image,as in the docs, keeps working;
pool=…:inode=…:size=…) is unchanged: inodes need no creation.The docs (
docs/usage/qemu.{en,ru}.md) now say that the target image must exist and be at least aslarge as the source.
Tested: new
tests/test_qemu_img_create.sh(missing image, smaller image, same size,qemu-img convertwithout
-ninto a larger image with a data check, inode addressing). The same five cases were runagainst QEMU 8.2.2 with this driver: all pass, and the missing/smaller cases exit with 0 without the
change. The pre-8.0 path (
bdrv_open()+bdrv_unref()in the create coroutine) was not run:bdrv_open()has this signature in the QEMU 2.12–7.2 headers, and
block/crypto.ccalls both from its create coroutine there.The test sets
IMMEDIATE_COMMIT=1becauseqemu-img convertusescache=unsafeby default and neverflushes: with
immediate_commit=nonethe data read back after the convert didn't match (from byte 1).Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.