All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] block-commit & dropping privs
Date: Fri, 27 Mar 2015 08:49:04 -0600	[thread overview]
Message-ID: <55156DE0.4050209@redhat.com> (raw)
In-Reply-To: <55151DB7.3090200@msgid.tls.msk.ru>

[-- Attachment #1: Type: text/plain, Size: 1880 bytes --]

On 03/27/2015 03:07 AM, Michael Tokarev wrote:
> Hello.
> 
> I tried to experiment with block-commit command, which propagates
> changes accumulated in an overlay (qcow2) block image file back to
> the base image file.
> 
> And immediately faced a problem.  All my VMs are run chrooted into
> an empty dir and with low-priv user (using -runsa and -chroot options,
> initially started as root).  Ofcourse this low-priv qemu process
> can't open the base image anymore, because it doesn't have the
> necessary permissions and because the base file is inaccessible
> within the chroot.
> 
> So I wonder if we can avoid reopening the base img by always opening
> it read-write (using a command-line option), does it make sense?

It is already possible to open a file read-write on the command line, by
using -add-fd twice to put both a read-only and a read-write fd handle
to the same file in a single set N, then using -drive options to specify
/dev/fdset/N rather than the file name.  By that argument, I'm not sure
if adding any other command line options is necessary.

> 
> Or maybe there's some other possible solution to this, for example,
> passing in a filedescriptor for the new base img over a unix socket?

Hmm, we do allow QMP to pass in fds over Unix sockets already, but what
we don't have yet is the ability to associate one of those just-passed
fds to an existing open BDS (right now, you can only create a new fdset
as tied to a new BDS, but block-commit can only target an open BDS;
there is no way to pivot which BDS base is associated with another BDS).
 So maybe there is still room for improvement, especially since having a
QMP solution is nicer than requiring foresight to pass in an fdset from
the command line.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-03-27 14:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27  9:07 [Qemu-devel] block-commit & dropping privs Michael Tokarev
2015-03-27 14:49 ` Eric Blake [this message]
2015-03-27 15:36   ` Michael Tokarev
2015-03-27 17:12     ` Eric Blake
2015-03-30 15:36       ` Kevin Wolf
2015-04-01  9:26         ` Michael Tokarev
2015-04-01  9:54           ` Michael Tokarev
2015-04-01 12:34             ` Kevin Wolf
2015-04-02 10:58               ` Michael Tokarev
2015-04-02 11:24                 ` Kevin Wolf
2015-04-02 12:04                   ` Michael Tokarev
2015-04-02 13:07                     ` Eric Blake
2015-04-03  4:28                       ` Jeff Cody
2015-04-03 19:49                         ` Eric Blake
2015-04-03 19:57                           ` Jeff Cody
2015-04-02 13:19                     ` Kevin Wolf
2015-04-06 15:37                       ` Michael Tokarev
2015-04-07  9:24                         ` Kevin Wolf
2015-04-03  3:59                   ` Jeff Cody
2015-04-07  9:18                     ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55156DE0.4050209@redhat.com \
    --to=eblake@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.