block.c (71df14fcbe5035d0728f30463414301eb62ad865) block.c (e023b2e244ddcc25308309d20c6bfd037897b10c)
1/*
2 * QEMU System Emulator block driver
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

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

944void bdrv_make_anon(BlockDriverState *bs)
945{
946 if (bs->device_name[0] != '\0') {
947 QTAILQ_REMOVE(&bdrv_states, bs, list);
948 }
949 bs->device_name[0] = '\0';
950}
951
1/*
2 * QEMU System Emulator block driver
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

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

944void bdrv_make_anon(BlockDriverState *bs)
945{
946 if (bs->device_name[0] != '\0') {
947 QTAILQ_REMOVE(&bdrv_states, bs, list);
948 }
949 bs->device_name[0] = '\0';
950}
951
952static void bdrv_rebind(BlockDriverState *bs)
953{
954 if (bs->drv && bs->drv->bdrv_rebind) {
955 bs->drv->bdrv_rebind(bs);
956 }
957}
958
952/*
953 * Add new bs contents at the top of an image chain while the chain is
954 * live, while keeping required fields on the top layer.
955 *
956 * This will modify the BlockDriverState fields, and swap contents
957 * between bs_new and bs_top. Both bs_new and bs_top are modified.
958 *
959 * bs_new is required to be anonymous.

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

1032
1033 /* we don't use bdrv_io_limits_disable() for this, because we don't want
1034 * to affect or delete the block_timer, as it has been moved to bs_top */
1035 bs_new->io_limits_enabled = false;
1036 bs_new->block_timer = NULL;
1037 bs_new->slice_time = 0;
1038 bs_new->slice_start = 0;
1039 bs_new->slice_end = 0;
959/*
960 * Add new bs contents at the top of an image chain while the chain is
961 * live, while keeping required fields on the top layer.
962 *
963 * This will modify the BlockDriverState fields, and swap contents
964 * between bs_new and bs_top. Both bs_new and bs_top are modified.
965 *
966 * bs_new is required to be anonymous.

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

1039
1040 /* we don't use bdrv_io_limits_disable() for this, because we don't want
1041 * to affect or delete the block_timer, as it has been moved to bs_top */
1042 bs_new->io_limits_enabled = false;
1043 bs_new->block_timer = NULL;
1044 bs_new->slice_time = 0;
1045 bs_new->slice_start = 0;
1046 bs_new->slice_end = 0;
1047
1048 bdrv_rebind(bs_new);
1049 bdrv_rebind(bs_top);
1040}
1041
1042void bdrv_delete(BlockDriverState *bs)
1043{
1044 assert(!bs->dev);
1045 assert(!bs->job);
1046 assert(!bs->in_use);
1047

--- 3198 unchanged lines hidden ---
1050}
1051
1052void bdrv_delete(BlockDriverState *bs)
1053{
1054 assert(!bs->dev);
1055 assert(!bs->job);
1056 assert(!bs->in_use);
1057

--- 3198 unchanged lines hidden ---