[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] block-commit & dropping privs
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] block-commit & dropping privs |
Date: |
Wed, 1 Apr 2015 14:34:17 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 01.04.2015 um 11:54 hat Michael Tokarev geschrieben:
> 01.04.2015 12:26, Michael Tokarev пишет:
> > 30.03.2015 18:36, Kevin Wolf wrote:
> >> Am 27.03.2015 um 18:12 hat Eric Blake geschrieben:
> >>> On 03/27/2015 09:36 AM, Michael Tokarev wrote:
> >>>> Wonder how to specify cache mode, or should I open these with proper
> >>>> O_DIRECT/O_SYNC/whatever? It looks like it's possible to change O_DIRECT
> >>>> at runtime but not O_SYNC.
> >>>>
> >>>> And the more interesting question is how to do that from shell.
> >>>
> >>> Redirections only get you so far in shell; you may need a wrapper C
> >>> program go get O_DIRECT and/or O_SYNC pre-set. Then again, if you use
> >>> QMP and pass over the Unix socket, you need a C program anyways.
> >>
> >> O_DIRECT can be set with fcntl(), so qemu takes care of that. O_SYNC
> >> is completely unused on Linux these days, so that shouldn't be a problem
>
> Do you mean it is unused in qemu or in kernel? :)
In qemu. We used to use O_DSYNC for cache=writethrough long ago, but
nowadays we just issue fdatasync() manually.
> >> either. (Other platforms use it as a misguided attempt of approximating
> >> O_DIRECT. We should really error out instead.)
> >>
> >> So if I'm not mistaken, just having one read-only and one read-write fd
> >> should be enough for any configuration in practice.
>
> Yes, O_DIRECT appears to work with fdsets.
>
> > Probably yes. Except the thing doesn't actually work. ;)
> >
> > When flushing changes to the base image, that base image needs to be
> > reopened. So I should convince qemu that the base image of this qcow
> > file is /dev/fdset/foo, not the one recorded in the header.
>
> qemu-system-x86_64: -drive
> file=w7x64.qcow2,backing_file=/dev/fdset/2,if=none,id=dr,cache=none: \
> could not open disk image w7x64.qcow2: Block format 'qcow2' used by device
> 'dr' \
> doesn't support the option 'backing_file'
Overriding the backing file should work like this:
-drive file=...,backing.file.filename=/dev/fdset/2
Kevin
- Re: [Qemu-devel] block-commit & dropping privs, Michael Tokarev, 2015/04/01
- Re: [Qemu-devel] block-commit & dropping privs, Michael Tokarev, 2015/04/01
- Re: [Qemu-devel] block-commit & dropping privs,
Kevin Wolf <=
- Re: [Qemu-devel] block-commit & dropping privs, Michael Tokarev, 2015/04/02
- Re: [Qemu-devel] block-commit & dropping privs, Kevin Wolf, 2015/04/02
- Re: [Qemu-devel] block-commit & dropping privs, Michael Tokarev, 2015/04/02
- Re: [Qemu-devel] block-commit & dropping privs, Eric Blake, 2015/04/02
- Re: [Qemu-devel] block-commit & dropping privs, Jeff Cody, 2015/04/03
- Re: [Qemu-devel] block-commit & dropping privs, Eric Blake, 2015/04/03
- Re: [Qemu-devel] block-commit & dropping privs, Jeff Cody, 2015/04/03
- Re: [Qemu-devel] block-commit & dropping privs, Kevin Wolf, 2015/04/02
- Re: [Qemu-devel] block-commit & dropping privs, Michael Tokarev, 2015/04/06
- Re: [Qemu-devel] block-commit & dropping privs, Kevin Wolf, 2015/04/07