Skip to contentSkip to conversation

diffuse handling of image creation from another path

Qemu-devel Florian Miksch 3 participants 3 messages Dec 3, 2013 – Sep 28, 2016

lore
Share & tools
lore
#0 lore raw

Public bug reported:

see attachement!

** Affects: qemu
Importance: Undecided
Status: New

** Attachment added: "bash script to demonstrate the bug"
https://bugs.launchpad.net/bugs/1257334/+attachment/3922070/+files/qemuBug.sh

Signature · 15 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1257334

Title:
  diffuse handling of image creation from another path

Status in QEMU:
  New

Bug description:
  see attachement!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1257334/+subscriptions
#1 lore raw

On Tue, Dec 03, 2013 at 03:22:28PM -0000, Florian Miksch wrote:
Hi,
This does not look like a bug. Please see the explanation below...

Inlining Florian's reproducer script so we can discuss it via email:

Quoted 34 lines

#!/bin/bash
# This script does create a backing image and overlay to

# reproduce the reported bug.
#...

mkdir a
# Create an image from another path e.g. in the directory 'a' qemu-img create -f qcow2 a/blob.img 10G

# Create an overlay image from another path in the same directory qemu-img create -f qcow2 -b a/blob.img a/ovl.img

# Get Info in the new directory
cd a
qemu-img info ovl.img
# Output:

#       image: ovl.img
#       file format: qcow2
#       virtual size: 10G (10737418240 bytes)
#       disk size: 196K
#       cluster_size: 65536
#       backing file: a/blob.img

# Get the Info from another directory
cd ..
qemu-img info a/ovl.img
# Output:

#       image: a/ovl.img
#       file format: qcow2
#       virtual size: 10G (10737418240 bytes)
#       disk size: 196K
#       cluster_size: 65536
#       backing file: a/blob.img (actual path: a/a/blob.img)
Quoted 4 lines

# Bug:

#       Compare 'image'
#       Compare 'backing file'
#       Look at 'actual path'

The behavior you are showing here is explained as follows:

Backing file paths can be relative or absolute and are stored inside the image file. In this case you are providing a relative backing file path.

Relative backing file paths are interpreted against the image filename. In other words:

join_path(dirname('a/ovl.img'), 'a/blob.img') -> 'a/a/blob.img'

Quoted 7 lines

# 'qemu-img info' takes the recommended path as name of the image

# and the actual path is then: a/a/blob.img    

qemu-img commit a/ovl.img
# Now commit fails
# --> ERROR "No such file or directory

The problem was:

Quoted 1 line

qemu-img create -f qcow2 -b a/blob.img a/ovl.img

If you want to use a relative backing file path, remember that it is relative to the image file:

cd a && qemu-img create -f qcow2 -b blob.img ovl.img

Then 'qemu-img commit a/ovl.img' will work as expected.

Stefan

#2 lore raw
In reply to Florian Miksch

** Changed in: qemu
Status: New => Invalid

Signature · 15 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1257334

Title:
  diffuse handling of image creation from another path

Status in QEMU:
  Invalid

Bug description:
  see attachement!

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1257334/+subscriptions