Android-cuttlefish cvd tool
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
cuttlefish::Qcow2Image Class Reference

#include <qcow2.h>

Inheritance diagram for cuttlefish::Qcow2Image:
Inheritance graph
[legend]
Collaboration diagram for cuttlefish::Qcow2Image:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

 Qcow2Image (Qcow2Image &&)
 
 ~Qcow2Image () override
 
Qcow2Imageoperator= (Qcow2Image &&)
 
Result< uint64_t > VirtualSizeBytes () const override
 
- Public Member Functions inherited from cuttlefish::DiskImage
virtual ~DiskImage ()=default
 
DiskImageoperator= (DiskImage &&)=delete
 
virtual Result< uint64_t > VirtualSizeBytes () const =0
 

Static Public Member Functions

static Result< Qcow2ImageCreate (const std::string &crosvm_path, const std::string &backing_file, std::string output_overlay_path)
 
static Result< Qcow2ImageOpenExisting (std::string path)
 
static std::string MagicString ()
 

Private Member Functions

 Qcow2Image (std::unique_ptr< Impl >)
 

Private Attributes

std::unique_ptr< Implimpl_
 

Detailed Description

qcow, or "QEMU Copy-On-Write" is a file format containing a list of disk offsets and file contents. This can be combined with a backing file, to represent an original disk file plus disk updates over that file. The qcow files can be swapped out and replaced without affecting the original. qcow is supported by QEMU and crosvm.

Constructor & Destructor Documentation

◆ Qcow2Image() [1/2]

cuttlefish::Qcow2Image::Qcow2Image ( Qcow2Image &&  other)

◆ ~Qcow2Image()

cuttlefish::Qcow2Image::~Qcow2Image ( )
overridedefault

◆ Qcow2Image() [2/2]

cuttlefish::Qcow2Image::Qcow2Image ( std::unique_ptr< Impl impl)
private

Member Function Documentation

◆ Create()

Result< Qcow2Image > cuttlefish::Qcow2Image::Create ( const std::string &  crosvm_path,
const std::string &  backing_file,
std::string  output_overlay_path 
)
static

Generate a qcow overlay backed by a given implementation file.

The crosvm binary at crosvm_path is used to generate an overlay file at output_overlay_path that functions as an overlay on the file at backing_file.

◆ MagicString()

std::string cuttlefish::Qcow2Image::MagicString ( )
static

"QCOW magic string", used to identify the file type.

Valid qcow2 files start with this prefix.

https://gitlab.com/qemu-project/qemu/-/blob/master/docs/interop/qcow2.rst

◆ OpenExisting()

Result< Qcow2Image > cuttlefish::Qcow2Image::OpenExisting ( std::string  path)
static

◆ operator=()

Qcow2Image & cuttlefish::Qcow2Image::operator= ( Qcow2Image &&  other)

◆ VirtualSizeBytes()

Result< uint64_t > cuttlefish::Qcow2Image::VirtualSizeBytes ( ) const
overridevirtual

Implements cuttlefish::DiskImage.

Member Data Documentation

◆ impl_

std::unique_ptr<Impl> cuttlefish::Qcow2Image::impl_
private

The documentation for this class was generated from the following files: