image_opts = false;
if (chain) {
- if (info->has_full_backing_filename) {
+ if (info->full_backing_filename) {
filename = info->full_backing_filename;
- } else if (info->has_backing_filename) {
+ } else if (info->backing_filename) {
error_report("Could not determine absolute backing filename,"
" but backing filename '%s' present",
info->backing_filename);
goto err;
}
- if (info->has_backing_filename_format) {
+ if (info->backing_filename_format) {
fmt = info->backing_filename_format;
}
}
printf("%#-16"PRIx64"%#-16"PRIx64"%#-16"PRIx64"%s\n",
e->start, e->length,
e->has_offset ? e->offset : 0,
- e->has_filename ? e->filename : "");
+ e->filename ?: "");
}
/* This format ignores the distinction between 0, ZERO and ZERO|DATA.
* Modify the flags here to allow more coalescing.
.has_offset = has_offset,
.depth = depth,
.present = !!(ret & BDRV_BLOCK_ALLOCATED),
- .has_filename = filename,
.filename = filename,
};
curr->data != next->data ||
curr->depth != next->depth ||
curr->present != next->present ||
- curr->has_filename != next->has_filename ||
+ !curr->filename != !next->filename ||
curr->has_offset != next->has_offset) {
return false;
}
- if (curr->has_filename && strcmp(curr->filename, next->filename)) {
+ if (curr->filename && strcmp(curr->filename, next->filename)) {
return false;
}
if (curr->has_offset && curr->offset + curr->length != next->offset) {
const char *out_fmt = "raw";
const char *fmt = NULL;
int64_t size = 0;
- int64_t block_count = 0, out_pos, in_pos;
+ int64_t out_pos, in_pos;
bool force_share = false;
struct DdInfo dd = {
.flags = 0,
in.buf = g_new(uint8_t, in.bsz);
- for (out_pos = 0; in_pos < size; block_count++) {
+ for (out_pos = 0; in_pos < size; ) {
int bytes = (in_pos + in.bsz > size) ? size - in_pos : in.bsz;
ret = blk_pread(blk1, in_pos, bytes, in.buf, 0);