Bug 991228 - Invalid argument "cache" for -drive
Summary: Invalid argument "cache" for -drive
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F18TmpOnTmpfs
TreeView+ depends on / blocked
 
Reported: 2013-08-01 22:19 UTC by Lukáš Doktor
Modified: 2013-09-09 13:47 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-09 13:47:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lukáš Doktor 2013-08-01 22:19:56 UTC
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 Lukáš Doktor 2013-08-01 22:31:57 UTC
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 07:14:21 UTC
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 Lukáš Doktor 2013-08-05 14:46:05 UTC
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 14:54:45 UTC
(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 13:47:49 UTC
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.