Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into s…
Browse files Browse the repository at this point in the history
…taging

Block layer fixes for 2.9.0-rc1

# gpg: Signature made Mon 13 Mar 2017 11:53:16 GMT
# gpg:                using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <[email protected]>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  commit: Implement .bdrv_refresh_filename
  mirror: Implement .bdrv_refresh_filename
  block: Refresh filename after changing backing file
  commit: Implement bdrv_commit_top.bdrv_co_get_block_status
  block: Request block status from *file for BDRV_BLOCK_RAW
  block: Remove check_new_perm from bdrv_replace_child()
  migration: Document handling of bdrv_is_allocated() errors
  vvfat: React to bdrv_is_allocated() errors
  backup: React to bdrv_is_allocated() errors
  block: Drop unmaintained 'archipelago' driver
  file-posix: Consider max_segments for BlockLimits.max_transfer
  backup: allow target without .bdrv_get_info

Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
pm215 committed Mar 13, 2017
2 parents f962709 + dcbf37c commit 5bac3c3
Show file tree
Hide file tree
Showing 17 changed files with 143 additions and 1,201 deletions.
8 changes: 0 additions & 8 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1674,14 +1674,6 @@ S: Supported
F: block/ssh.c
T: git git://github.com/codyprime/qemu-kvm-jtc.git block

ARCHIPELAGO
M: Chrysostomos Nanakos <[email protected]>
M: Jeff Cody <[email protected]>
L: [email protected]
S: Maintained
F: block/archipelago.c
T: git git://github.com/codyprime/qemu-kvm-jtc.git block

CURL
M: Jeff Cody <[email protected]>
L: [email protected]
Expand Down
23 changes: 16 additions & 7 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1756,8 +1756,18 @@ static void bdrv_replace_child_noperm(BdrvChild *child,
}
}

static void bdrv_replace_child(BdrvChild *child, BlockDriverState *new_bs,
bool check_new_perm)
/*
* Updates @child to change its reference to point to @new_bs, including
* checking and applying the necessary permisson updates both to the old node
* and to @new_bs.
*
* NULL is passed as @new_bs for removing the reference before freeing @child.
*
* If @new_bs is not NULL, bdrv_check_perm() must be called beforehand, as this
* function uses bdrv_set_perm() to update the permissions according to the new
* reference that @new_bs gets.
*/
static void bdrv_replace_child(BdrvChild *child, BlockDriverState *new_bs)
{
BlockDriverState *old_bs = child->bs;
uint64_t perm, shared_perm;
Expand All @@ -1775,9 +1785,6 @@ static void bdrv_replace_child(BdrvChild *child, BlockDriverState *new_bs,

if (new_bs) {
bdrv_get_cumulative_perm(new_bs, &perm, &shared_perm);
if (check_new_perm) {
bdrv_check_perm(new_bs, perm, shared_perm, NULL, &error_abort);
}
bdrv_set_perm(new_bs, perm, shared_perm);
}
}
Expand Down Expand Up @@ -1808,7 +1815,7 @@ BdrvChild *bdrv_root_attach_child(BlockDriverState *child_bs,
};

/* This performs the matching bdrv_set_perm() for the above check. */
bdrv_replace_child(child, child_bs, false);
bdrv_replace_child(child, child_bs);

return child;
}
Expand Down Expand Up @@ -1845,7 +1852,7 @@ static void bdrv_detach_child(BdrvChild *child)
child->next.le_prev = NULL;
}

bdrv_replace_child(child, NULL, false);
bdrv_replace_child(child, NULL);

g_free(child->name);
g_free(child);
Expand Down Expand Up @@ -1931,6 +1938,8 @@ void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd,
bdrv_unref(backing_hd);
}

bdrv_refresh_filename(bs);

out:
bdrv_refresh_limits(bs, NULL);
}
Expand Down
2 changes: 0 additions & 2 deletions block/Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ block-obj-$(CONFIG_LIBNFS) += nfs.o
block-obj-$(CONFIG_CURL) += curl.o
block-obj-$(CONFIG_RBD) += rbd.o
block-obj-$(CONFIG_GLUSTERFS) += gluster.o
block-obj-$(CONFIG_ARCHIPELAGO) += archipelago.o
block-obj-$(CONFIG_LIBSSH2) += ssh.o
block-obj-y += accounting.o dirty-bitmap.o
block-obj-y += write-threshold.o
Expand All @@ -41,7 +40,6 @@ gluster.o-cflags := $(GLUSTERFS_CFLAGS)
gluster.o-libs := $(GLUSTERFS_LIBS)
ssh.o-cflags := $(LIBSSH2_CFLAGS)
ssh.o-libs := $(LIBSSH2_LIBS)
archipelago.o-libs := $(ARCHIPELAGO_LIBS)
block-obj-$(if $(CONFIG_BZIP2),m,n) += dmg-bz2.o
dmg-bz2.o-libs := $(BZIP2_LIBS)
qcow.o-libs := -lz
Expand Down
Loading

0 comments on commit 5bac3c3

Please sign in to comment.