Bug 991228 - Invalid argument "cache" for -drive
Invalid argument "cache" for -drive
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Virtualization Maintainers
Fedora Extras Quality Assurance
:
Depends On:
Blocks: F18TmpOnTmpfs
  Show dependency treegraph
 
Reported: 2013-08-01 18:19 EDT by Lukas Doktor
Modified: 2013-09-09 09:47 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-09 09:47:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lukas Doktor 2013-08-01 18:19:56 EDT
Description of problem:
I'm unable to set -drive cache=none. The command fails with could not open disk image /tmp/stg1.qcow2: Invalid argument

Version-Release number of selected component (if applicable):
qemu-kvm-1.4.2-4.fc19.x86_64

How reproducible:
Always, I tested it with -drive if=none and if=ide

Steps to Reproduce:
1. qemu-kvm -drive if=ide,cache=none,file=/tmp/asdf

Actual results:
qemu-system-x86_64: -drive if=ide,cache=none,file=/tmp/asdf: could not open disk image /tmp/asdf: Invalid argument


Expected results:
Boot VM with this disk '/tmp/asdf' using cache=none.

Additional info:
Interesting is that I can set cache="writeback", "unsafe", or "directsync". But when I try "none" it doesn't work.

I tested it on upstream qemu 1.5.50 and it works fine.
Comment 1 Lukas Doktor 2013-08-01 18:31:57 EDT
Oh, sorry, it doesn't work on qemu-1.5.50. Anyway IMO it should work and I'd swear it worked before.
Comment 2 Richard W.M. Jones 2013-08-02 03:14:21 EDT
At a guess I would say this has something to do with tmp-on-tmpfs.

cache=none causes the O_DIRECT flag to be used, and this flag
isn't supported by tmpfs.
Comment 3 Lukas Doktor 2013-08-05 10:46:05 EDT
Hi, yes, that is the cause. It would be nice if qemu could report this with some sane error message instead of "could not open disk image /tmp/asdf: Invalid argument".
Comment 4 Richard W.M. Jones 2013-08-05 10:54:45 EDT
(In reply to Lukas Doktor from comment #3)
> Hi, yes, that is the cause. It would be nice if qemu could report this with
> some sane error message instead of "could not open disk image /tmp/asdf:
> Invalid argument".

Unfortunately qemu just calls open(2) and gets errno = EINVAL
back, and no more information than that.  It would be nice
if tmpfs could be persuaded to just ignore the O_DIRECT flag,
since this flag has, at best, hazy semantics and they likely
don't matter on an in-memory filesystem.
Comment 5 Cole Robinson 2013-09-09 09:47:49 EDT
Stefan posted patches upstream to give an explicit error in this case:

https://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg03019.html

So just closing this as UPSTREAM

Note You need to log in before you can comment on or make changes to this bug.