block.c (c629b6d22349c83ca262d1887c0920e87ec0bfdb) block.c (356f4ef611df18f6f8323a9fe6e6b4963272bf74)
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

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

3366 return;
3367 }
3368
3369 bdrv_unset_inherits_from(parent, child, NULL);
3370 bdrv_root_unref_child(child);
3371}
3372
3373
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

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

3366 return;
3367 }
3368
3369 bdrv_unset_inherits_from(parent, child, NULL);
3370 bdrv_root_unref_child(child);
3371}
3372
3373
3374static void bdrv_parent_cb_change_media(BlockDriverState *bs, bool load)
3374static void GRAPH_RDLOCK
3375bdrv_parent_cb_change_media(BlockDriverState *bs, bool load)
3375{
3376 BdrvChild *c;
3377 GLOBAL_STATE_CODE();
3378 QLIST_FOREACH(c, &bs->parents, next_parent) {
3379 if (c->klass->change_media) {
3380 c->klass->change_media(c, load);
3381 }
3382 }

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

3964 int snapshot_flags = 0;
3965 AioContext *ctx = qemu_get_aio_context();
3966
3967 assert(!child_class || !flags);
3968 assert(!child_class == !parent);
3969 GLOBAL_STATE_CODE();
3970 assert(!qemu_in_coroutine());
3971
3376{
3377 BdrvChild *c;
3378 GLOBAL_STATE_CODE();
3379 QLIST_FOREACH(c, &bs->parents, next_parent) {
3380 if (c->klass->change_media) {
3381 c->klass->change_media(c, load);
3382 }
3383 }

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

3965 int snapshot_flags = 0;
3966 AioContext *ctx = qemu_get_aio_context();
3967
3968 assert(!child_class || !flags);
3969 assert(!child_class == !parent);
3970 GLOBAL_STATE_CODE();
3971 assert(!qemu_in_coroutine());
3972
3973 /* TODO We'll eventually have to take a writer lock in this function */
3974 GRAPH_RDLOCK_GUARD_MAINLOOP();
3975
3972 if (reference) {
3973 bool options_non_empty = options ? qdict_size(options) : false;
3974 qobject_unref(options);
3975
3976 if (filename || options_non_empty) {
3977 error_setg(errp, "Cannot reference an existing block device with "
3978 "additional options or a new filename");
3979 return NULL;

--- 4574 unchanged lines hidden ---
3976 if (reference) {
3977 bool options_non_empty = options ? qdict_size(options) : false;
3978 qobject_unref(options);
3979
3980 if (filename || options_non_empty) {
3981 error_setg(errp, "Cannot reference an existing block device with "
3982 "additional options or a new filename");
3983 return NULL;

--- 4574 unchanged lines hidden ---