block.c (b783e409bf17b92f4af8dc5d6bd040d0092f33e0) block.c (756e6736a12a46330d9532d5f861ba15b38886d8)
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

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

592 }
593
594 if (drv->bdrv_make_empty)
595 return drv->bdrv_make_empty(bs);
596
597 return 0;
598}
599
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

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

592 }
593
594 if (drv->bdrv_make_empty)
595 return drv->bdrv_make_empty(bs);
596
597 return 0;
598}
599
600/*
601 * Return values:
602 * 0 - success
603 * -EINVAL - backing format specified, but no file
604 * -ENOSPC - can't update the backing file because no space is left in the
605 * image file header
606 * -ENOTSUP - format driver doesn't support changing the backing file
607 */
608int bdrv_change_backing_file(BlockDriverState *bs,
609 const char *backing_file, const char *backing_fmt)
610{
611 BlockDriver *drv = bs->drv;
612
613 if (drv->bdrv_change_backing_file != NULL) {
614 return drv->bdrv_change_backing_file(bs, backing_file, backing_fmt);
615 } else {
616 return -ENOTSUP;
617 }
618}
619
600static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset,
601 size_t size)
602{
603 int64_t len;
604
605 if (!bdrv_is_inserted(bs))
606 return -ENOMEDIUM;
607

--- 1545 unchanged lines hidden ---
620static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset,
621 size_t size)
622{
623 int64_t len;
624
625 if (!bdrv_is_inserted(bs))
626 return -ENOMEDIUM;
627

--- 1545 unchanged lines hidden ---