block.c (5efde22aa781d37df58f0060430f459491dcfd62) | block.c (892b7de832681cdfff22a6e96cb0280b59684024) |
---|---|
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 --- 554 unchanged lines hidden (view full) --- 563 } 564 565 /* Then let the driver override it */ 566 if (drv->bdrv_refresh_limits) { 567 drv->bdrv_refresh_limits(bs, errp); 568 } 569} 570 | 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 --- 554 unchanged lines hidden (view full) --- 563 } 564 565 /* Then let the driver override it */ 566 if (drv->bdrv_refresh_limits) { 567 drv->bdrv_refresh_limits(bs, errp); 568 } 569} 570 |
571/** 572 * Try to get @bs's logical and physical block size. 573 * On success, store them in @bsz struct and return 0. 574 * On failure return -errno. 575 * @bs must not be empty. 576 */ 577int bdrv_probe_blocksizes(BlockDriverState *bs, BlockSizes *bsz) 578{ 579 BlockDriver *drv = bs->drv; 580 581 if (drv && drv->bdrv_probe_blocksizes) { 582 return drv->bdrv_probe_blocksizes(bs, bsz); 583 } 584 585 return -ENOTSUP; 586} 587 588/** 589 * Try to get @bs's geometry (cyls, heads, sectors). 590 * On success, store them in @geo struct and return 0. 591 * On failure return -errno. 592 * @bs must not be empty. 593 */ 594int bdrv_probe_geometry(BlockDriverState *bs, HDGeometry *geo) 595{ 596 BlockDriver *drv = bs->drv; 597 598 if (drv && drv->bdrv_probe_geometry) { 599 return drv->bdrv_probe_geometry(bs, geo); 600 } 601 602 return -ENOTSUP; 603} 604 |
|
571/* 572 * Create a uniquely-named empty temporary file. 573 * Return 0 upon success, otherwise a negative errno value. 574 */ 575int get_tmp_filename(char *filename, int size) 576{ 577#ifdef _WIN32 578 char temp_dir[MAX_PATH]; --- 5588 unchanged lines hidden --- | 605/* 606 * Create a uniquely-named empty temporary file. 607 * Return 0 upon success, otherwise a negative errno value. 608 */ 609int get_tmp_filename(char *filename, int size) 610{ 611#ifdef _WIN32 612 char temp_dir[MAX_PATH]; --- 5588 unchanged lines hidden --- |