Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cab8646a authored by Daniel Zheng's avatar Daniel Zheng
Browse files

Add v3 to CreateCowWriter

Adding v3 writer as a return type to CreateCowWriter

Test: write_cow
Change-Id: Ia68ddf17b9f5f9fae27da4d6ab5fb150078d0c38
parent c519d1dd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <android-base/stringprintf.h>
#include <libsnapshot/cow_format.h>
#include "writer_v2.h"
#include "writer_v3.h"

namespace android {
namespace snapshot {
@@ -149,6 +150,9 @@ std::unique_ptr<ICowWriter> CreateCowWriter(uint32_t version, const CowOptions&
        case 2:
            base = std::make_unique<CowWriterV2>(options, std::move(fd));
            break;
        case 3:
            base = std::make_unique<CowWriterV3>(options, std::move(fd));
            break;
        default:
            LOG(ERROR) << "Cannot create unknown cow version: " << version;
            return nullptr;