qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] d35ff5: block: Ignore guest dev permissions d


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] d35ff5: block: Ignore guest dev permissions during incomin...
Date: Fri, 07 Apr 2017 08:30:10 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d35ff5e6b3aa3a706b0aa3bcf11400fac945b67a
      
https://github.com/qemu/qemu/commit/d35ff5e6b3aa3a706b0aa3bcf11400fac945b67a
  Author: Kevin Wolf <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M block/block-backend.c
    M include/block/block.h
    M migration/migration.c
    M qmp.c

  Log Message:
  -----------
  block: Ignore guest dev permissions during incoming migration

Usually guest devices don't like other writers to the same image, so
they use blk_set_perm() to prevent this from happening. In the migration
phase before the VM is actually running, though, they don't have a
problem with writes to the image. On the other hand, storage migration
needs to be able to write to the image in this phase, so the restrictive
blk_set_perm() call of qdev devices breaks it.

This patch flags all BlockBackends with a qdev device as
blk->disable_perm during incoming migration, which means that the
requested permissions are stored in the BlockBackend, but not actually
applied to its root node yet.

Once migration has finished and the VM should be resumed, the
permissions are applied. If they cannot be applied (e.g. because the NBD
server used for block migration hasn't been shut down), resuming the VM
fails.

Signed-off-by: Kevin Wolf <address@hidden>
Tested-by: Kashyap Chamarthy <address@hidden>


  Commit: 02be4aeb9343d9a4993b1de6cebe6280e82d7254
      
https://github.com/qemu/qemu/commit/02be4aeb9343d9a4993b1de6cebe6280e82d7254
  Author: Kevin Wolf <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M block/commit.c

  Log Message:
  -----------
  commit: Set commit_top_bs->aio_context

The filter driver that is inserted by the commit job needs to use the
same AioContext as its parent and child nodes.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>


  Commit: 0d0676a1040d34339731a4e26a9b39b78c8a1fdf
      
https://github.com/qemu/qemu/commit/0d0676a1040d34339731a4e26a9b39b78c8a1fdf
  Author: Kevin Wolf <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M block/commit.c

  Log Message:
  -----------
  commit: Set commit_top_bs->total_sectors

Like in the mirror filter driver, we also need to set the image size for
the commit filter driver. This is less likely to be a problem in
practice than for the mirror because we're not at the active layer here,
but attaching new parents to a node in the middle of the chain is
possible, so the size needs to be correct anyway.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>


  Commit: 7a25fcd056ddd34ee7abc906c957d252e2889461
      
https://github.com/qemu/qemu/commit/7a25fcd056ddd34ee7abc906c957d252e2889461
  Author: Max Reitz <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M block/mirror.c

  Log Message:
  -----------
  block/mirror: Fix use-after-free

If @bs does not have any parents, the only reference to @mirror_top_bs
will be held by the BlockJob object after the bdrv_unref() following
block_job_create(). However, if block_job_create() fails, this reference
will not exist and @mirror_top_bs will have been deleted when we
goto fail.

The issue comes back at all later entries to the fail label: We delete
the BlockJob object before rolling back our changes to the node graph.
This means that we will delete @mirror_top_bs in the process.

All in all, whenever @bs does not have any parents and we go down the
fail path we will dereference @mirror_top_bs after it has been deleted.

Fix this by invoking bdrv_unref() only when block_job_create() was
successful and by bdrv_ref()'ing @mirror_top_bs in the fail path before
deleting the BlockJob object. Finally, bdrv_unref() it at the end of the
fail path after we actually no longer need it.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 5694923ad1c60a86383244793663c0715bd88e83
      
https://github.com/qemu/qemu/commit/5694923ad1c60a86383244793663c0715bd88e83
  Author: Max Reitz <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M tests/qemu-iotests/041
    M tests/qemu-iotests/041.out
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  iotests: Add mirror tests for orphaned source

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 89aa0465b9135d70682420918b28b6e38a0f6322
      
https://github.com/qemu/qemu/commit/89aa0465b9135d70682420918b28b6e38a0f6322
  Author: Jeff Cody <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M qemu-img-cmds.hx

  Log Message:
  -----------
  qemu-img: img_create does not support image-opts, fix docs

The documentation and help for qemu-img claims that 'qemu-img create'
will take the '--image-opts' argument.  This is not true, so this
patch removes those claims.

Signed-off-by: Jeff Cody <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 1bf03e66fd03af46ff0f98dd04b6e28f432ac1e3
      
https://github.com/qemu/qemu/commit/1bf03e66fd03af46ff0f98dd04b6e28f432ac1e3
  Author: Kevin Wolf <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Don't check permissions for copy on read

The assertion is currently failing. We can't require callers to have
write permissions when all they are doing is a read, so comment it out.
Add a FIXME comment in the code so that the check is re-enabled when
copy on read is refactored into its own filter driver.

Reported-by: Richard W.M. Jones <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Richard W.M. Jones <address@hidden>


  Commit: c26a5ab71338a53340257233bd172bbe22c06b16
      
https://github.com/qemu/qemu/commit/c26a5ab71338a53340257233bd172bbe22c06b16
  Author: Fam Zheng <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  block: Fix unpaired aio_disable_external in external snapshot

bdrv_replace_child_noperm tries to hand over the quiesce_counter state
from old bs to the new one, but if they are not on the same aio context
this causes unbalance.

Fix this by setting the correct aio context before calling
bdrv_append().

Reported-by: Ed Swierk <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: bb2614e991d88166fccf4a26c7180ee39f39a48d
      
https://github.com/qemu/qemu/commit/bb2614e991d88166fccf4a26c7180ee39f39a48d
  Author: Fam Zheng <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Assert attached child node has right aio context

Suggested-by: Kevin Wolf <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 19dd29e8a77cd820515de5289f566508e0ed4926
      
https://github.com/qemu/qemu/commit/19dd29e8a77cd820515de5289f566508e0ed4926
  Author: Fam Zheng <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M block/mirror.c

  Log Message:
  -----------
  mirror: Fix aio context of mirror_top_bs

It should be moved to the same context as source, before inserting to the
graph.

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 5daf9b3025baef10ee7b77daa003d5696b58d5dc
      
https://github.com/qemu/qemu/commit/5daf9b3025baef10ee7b77daa003d5696b58d5dc
  Author: Peter Maydell <address@hidden>
  Date:   2017-04-07 (Fri, 07 Apr 2017)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/commit.c
    M block/io.c
    M block/mirror.c
    M blockdev.c
    M include/block/block.h
    M migration/migration.c
    M qemu-img-cmds.hx
    M qmp.c
    M tests/qemu-iotests/041
    M tests/qemu-iotests/041.out
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer fixes for 2.9.0-rc4

# gpg: Signature made Fri 07 Apr 2017 13:44:17 BST
# gpg:                using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <address@hidden>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  mirror: Fix aio context of mirror_top_bs
  block: Assert attached child node has right aio context
  block: Fix unpaired aio_disable_external in external snapshot
  block: Don't check permissions for copy on read
  qemu-img: img_create does not support image-opts, fix docs
  iotests: Add mirror tests for orphaned source
  block/mirror: Fix use-after-free
  commit: Set commit_top_bs->total_sectors
  commit: Set commit_top_bs->aio_context
  block: Ignore guest dev permissions during incoming migration

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/5fe2339e6b09...5daf9b3025ba

reply via email to

[Prev in Thread] Current Thread [Next in Thread]