block.c (2c0a3acb9570a9e1ffae3c73ef94bc826dc9dd1d) block.c (da261b69aee9acb46ac1b0ebfe0ccb7b74450a88)
1/*
2 * QEMU System Emulator block driver
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 * Copyright (c) 2020 Virtuozzo International GmbH.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 2012 unchanged lines hidden (view full) ---

2021 */
2022bool bdrv_is_writable(BlockDriverState *bs)
2023{
2024 return bdrv_is_writable_after_reopen(bs, NULL);
2025}
2026
2027static char *bdrv_child_user_desc(BdrvChild *c)
2028{
1/*
2 * QEMU System Emulator block driver
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 * Copyright (c) 2020 Virtuozzo International GmbH.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 2012 unchanged lines hidden (view full) ---

2021 */
2022bool bdrv_is_writable(BlockDriverState *bs)
2023{
2024 return bdrv_is_writable_after_reopen(bs, NULL);
2025}
2026
2027static char *bdrv_child_user_desc(BdrvChild *c)
2028{
2029 if (c->klass->get_parent_desc) {
2030 return c->klass->get_parent_desc(c);
2031 }
2032
2033 return g_strdup("another user");
2029 return c->klass->get_parent_desc(c);
2034}
2035
2036static bool bdrv_a_allow_b(BdrvChild *a, BdrvChild *b, Error **errp)
2037{
2038 g_autofree char *user = NULL;
2039 g_autofree char *perm_names = NULL;
2040
2041 if ((b->perm & a->shared_perm) == b->perm) {

--- 725 unchanged lines hidden (view full) ---

2767 Transaction *tran, Error **errp)
2768{
2769 BdrvChild *new_child;
2770 AioContext *parent_ctx;
2771 AioContext *child_ctx = bdrv_get_aio_context(child_bs);
2772
2773 assert(child);
2774 assert(*child == NULL);
2030}
2031
2032static bool bdrv_a_allow_b(BdrvChild *a, BdrvChild *b, Error **errp)
2033{
2034 g_autofree char *user = NULL;
2035 g_autofree char *perm_names = NULL;
2036
2037 if ((b->perm & a->shared_perm) == b->perm) {

--- 725 unchanged lines hidden (view full) ---

2763 Transaction *tran, Error **errp)
2764{
2765 BdrvChild *new_child;
2766 AioContext *parent_ctx;
2767 AioContext *child_ctx = bdrv_get_aio_context(child_bs);
2768
2769 assert(child);
2770 assert(*child == NULL);
2771 assert(child_class->get_parent_desc);
2775
2776 new_child = g_new(BdrvChild, 1);
2777 *new_child = (BdrvChild) {
2778 .bs = NULL,
2779 .name = g_strdup(child_name),
2780 .klass = child_class,
2781 .role = child_role,
2782 .perm = perm,

--- 4798 unchanged lines hidden ---
2772
2773 new_child = g_new(BdrvChild, 1);
2774 *new_child = (BdrvChild) {
2775 .bs = NULL,
2776 .name = g_strdup(child_name),
2777 .klass = child_class,
2778 .role = child_role,
2779 .perm = perm,

--- 4798 unchanged lines hidden ---