| 731 | } |
| 732 | |
| 733 | void Datastore::writeFluxFile(const std::fs::path& path) |
| 734 | { |
| 735 | Events::OperationStart::post("fluxengine.view.status.writeFlux"_lang); |
| 736 | Datastore::runOnWorkerThread( |
| 737 | [=] |
| 738 | { |
| 739 | busy = true; |
| 740 | failed = false; |
| 741 | DEFER(wtOperationStop()); |
| 742 | |
| 743 | try |
| 744 | { |
| 745 | wtRebuildConfiguration(true); |
| 746 | wtWaitForUiThreadToCatchUp(); |
| 747 | |
| 748 | if (!disk || !disk->image) |
| 749 | error("no loaded image"); |
| 750 | if (disk->image->getGeometry().totalBytes != |
| 751 | diskLayout->totalBytes) |
| 752 | error( |
| 753 | "loaded image is not the right size for this " |
| 754 | "format"); |
| 755 | |
| 756 | globalConfig().setFluxSink(path.string()); |
| 757 | auto fluxSource = FluxSource::createMemoryFluxSource(*disk); |
| 758 | auto fluxSinkFactory = FluxSinkFactory::create(globalConfig()); |
| 759 | writeRawDiskCommand(*diskLayout, *fluxSource, *fluxSinkFactory); |
| 760 | } |
| 761 | catch (...) |
| 762 | { |
| 763 | failed = true; |
| 764 | throw; |
| 765 | } |
| 766 | }); |
| 767 | } |
| 768 | |
| 769 | void Datastore::createBlankImage() |
| 770 | { |
nothing calls this directly
no test coverage detected