Esempio n. 1
0
void
Backup::get_source_snapshots_file()
{
    LOG_INFO(__FUNCTION__);
    VERIFY(file_pool);

    LOG_INFO("Setting up connection Manager");
    source_connection_manager =
        backend::BackendConnectionManager::create(source_ptree, RegisterComponent::F);

    const std::string source_namespace = source_ptree.get<std::string>("namespace");

    LOG_INFO("Reading the snapshots file from the source " << source_namespace);

    BackendInterfacePtr source_bi = source_connection_manager->newBackendInterface(backend::Namespace(source_namespace));

    const fs::path snapshots_file_path = file_pool->newFile("snapshots.xml");

    source_bi->read(snapshots_file_path,
                    snapshotFilename(),
                    InsistOnLatestVersion::T);

    source_snapshot_persistor.reset(new SnapshotPersistor(snapshots_file_path));

    if(not source_snapshot_persistor->hasUUIDSpecified())
    {
        LOG_FATAL("Could not find GUIDS in source " << source_namespace << " snapshots file " << snapshots_file_path);
        throw BackupException("No GUID's in the snapshots file, update volumedriver first");
    }
    nsid.set(0,
             std::move(source_bi));
}
const boost::regex&
BackendNamesFilter::regex_()
{
    // we don't use uppercase hex digits in sco / tlog names, so no [[:xdigit:]] but rather
    // [0-9a-f] below.
    static const std::string rexstr(std::string(SCOAccessDataPersistor::backend_name)
                                   + std::string("|")
                                   + FailOverCacheConfigWrapper::config_backend_name
                                   + std::string("|")
                                   + VolumeConfig::config_backend_name
                                   + std::string("|")
                                   + snapshotFilename()
                                   + std::string("|")
                                   + std::string("tlog_[0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12}")
                                   + std::string("|")
                                   + std::string("[0-9a-f]{2}_[0-9a-f]{8}_[0-9a-f]{2}")
                                   );

    static const boost::regex rex(rexstr, boost::regex::extended);
    return rex;
}