summary refs log tree commit diff
path: root/qcow_utils/src/qcow_utils.h
blob: 30c971565dbce5e91ffae5952b984aca7d98c229 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stdint.h>

// Exported interface to basic qcow functionality to be used from C.

#ifdef __cplusplus
extern "C" {
#endif

// Create a basic, empty qcow2 file that can grow to `virtual_size` at `path`.
int create_qcow_with_size(const char *path, uint64_t virtual_size);

// Copy the source disk image from `src_fd` into `dst_fd` as a qcow2 image file.
// Returns 0 on success or a negated errno value on failure.
int convert_to_qcow2(int src_fd, int dst_fd);

// Copy the source disk image from `src_fd` into `dst_fd` as a raw image file.
// Returns 0 on success or a negated errno value on failure.
int convert_to_raw(int src_fd, int dst_fd);

#ifdef __cplusplus
};
#endif