Check whether images have write permissions
Public bug reported:
KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening.
** Affects: qemu
Importance: Undecided
Status: New
** Affects: kvm (Ubuntu)
Importance: Undecided
Status: New
** Also affects: ubuntu
Importance: Undecided
Status: New
** Package changed: ubuntu => kvm (Ubuntu)
Signature · 10 lines
Check whether images have write permissions https://bugs.launchpad.net/bugs/658610 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. Status in QEMU: New Status in “kvm” package in Ubuntu: New Bug description: KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening.
** Package changed: kvm (Ubuntu) => qemu-kvm (Ubuntu)
** Changed in: qemu-kvm (Ubuntu)
Importance: Undecided => Wishlist
** Changed in: qemu-kvm (Ubuntu)
Status: New => Confirmed
Signature · 10 lines
Check whether images have write permissions https://bugs.launchpad.net/bugs/658610 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. Status in QEMU: New Status in “qemu-kvm” package in Ubuntu: Confirmed Bug description: KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening.
Can you please add steps to reproduce this bug? It's not clear to me when this happens.
Signature · 16 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/658610 Title: Check whether images have write permissions Status in QEMU: New Status in “qemu-kvm” package in Ubuntu: Confirmed Bug description: KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening.
I think what it means that, if the file permission for the disk image in host OS is read only for the user running qemu, then it is not saying that clearly. May be qemu should just exit as soon as it sees that image is read only. I am not sure if in some kind of mode it is possible to run a VM without the need of writing anything on the image. If that is the case then probably it should give an option or default to run in that mode under such circumstances.
Signature · 16 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/658610 Title: Check whether images have write permissions Status in QEMU: New Status in “qemu-kvm” package in Ubuntu: Confirmed Bug description: KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening.
This is a legacy behavior in QEMU. There are a number of legitimate use cases where a user may only have read access to an image and as long as that image is mounted read-only, everything will work okay.
Virtio and SCSI will expose the read-only attribute to the guest so it should be very obvious what's happening. Unfortunately, IDE does not support the concept of read-only.
Signature · 16 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/658610 Title: Check whether images have write permissions Status in QEMU: New Status in “qemu-kvm” package in Ubuntu: Confirmed Bug description: KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening.
Thanks, Anthony. Does that mean that the bug should be 'Invalid', or perhaps just 'Wontfix' (for the IDE case)?
Signature · 16 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/658610 Title: Check whether images have write permissions Status in QEMU: New Status in “qemu-kvm” package in Ubuntu: Confirmed Bug description: KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening.
We can always improve the information to the user for something like so I've marked this as wishlist.
** Changed in: qemu
Importance: Undecided => Wishlist
** Changed in: qemu
Status: New => Confirmed
Signature · 16 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/658610 Title: Check whether images have write permissions Status in QEMU: Confirmed Status in “qemu-kvm” package in Ubuntu: Confirmed Bug description: KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening.
by default images are expected to be open read-write. I'm against too much "intelligence" here, -- we may be running qemu as wrong user, or with wrong permissions of the image in question, and qemu should fail to start if the image can't be open using specified access flags (which is read-write by default). There's "readonly={on|off}" attribute of a block device which can be used to control this behavour. And this is, in fact, exactly the behavour:
$ qemu -drive file=/bin/ls qemu: -drive file=/bin/ls,if=virtio: could not open disk image /bin/ls: Permission denied $ qemu -drive file=/bin/ls,readonly=on qemu: -drive file=/bin/ls,readonly=on: readonly not supported by this bus type $ qemu -drive file=/bin/ls,if=virtio,readonly=on (works)
(Running as non-root ofcourse)
So I for one don't see what's the problem.
Signature · 19 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/658610 Title: Check whether images have write permissions Status in QEMU: Confirmed Status in “qemu-kvm” package in Ubuntu: Confirmed Bug description: KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/658610/+subscriptions
When I submitted this bug (2 years ago) that was not what happened. Apparently they fixed it in a newer version.
Signature · 19 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/658610 Title: Check whether images have write permissions Status in QEMU: Confirmed Status in “qemu-kvm” package in Ubuntu: Confirmed Bug description: KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/658610/+subscriptions
So closing it with "fix released".
(which had a complication for me: I changed status for ubuntu package instead of changing it for qemu line, and now I can't restore it back for ubuntu - since I don't know how/when ubuntu bugs are closed, only upstream)
** Changed in: qemu-kvm (Ubuntu)
Status: Confirmed => Fix Released
** Changed in: qemu
Status: Confirmed => Fix Released
Signature · 19 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/658610 Title: Check whether images have write permissions Status in QEMU: Fix Released Status in “qemu-kvm” package in Ubuntu: Fix Released Bug description: KVM/Qemu should check whether the disk images have write permissions in order to prevent users from getting weird IO errors in their VMs without understanding what's happening. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/658610/+subscriptions