Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oz-install holding lock the ISO File causes qemu-img create to fail #256

Open
prestonr83 opened this issue Mar 30, 2018 · 1 comment
Open

Comments

@prestonr83
Copy link
Contributor

prestonr83 commented Mar 30, 2018

Not sure where in the call stack but some where its holding a lock on the ISO File that is downloaded. I see no mention of this anywhere so maybe this is a bug related to Ubuntu 17.10.

Anyway I could not get it build. Every time I tried to call it would get following error.

libguestfs: trace: disk_create "/tmp/libguestfsX4o2P9/overlay1" "qcow2" -1 "backingfile:/tmp/iso/isos/Windows2016x86_64-iso.iso" "backingformat:raw"
libguestfs: command: run: qemu-img
libguestfs: command: run: \ create
libguestfs: command: run: \ -f qcow2
libguestfs: command: run: \ -o backing_file=/tmp/iso/isos/Windows2016x86_64-iso.iso,backing_fmt=raw
libguestfs: command: run: \ /tmp/libguestfsX4o2P9/overlay1
qemu-img: /tmp/libguestfsX4o2P9/overlay1: Failed to lock byte 100
Could not open backing image to determine size.
libguestfs: trace: disk_create = -1 (error)
libguestfs: trace: add_drive = -1 (error)
RuntimeError: 'qemu-img: /tmp/libguestfsX4o2P9/overlay1: qemu-img exited with error status 1, see debug messages above'

However I could manually run and it would complete without issue.

import guestfs
img = "/tmp/iso/isos/Windows2016x86_64-iso.iso"
gfs = guestfs.GuestFS()
gfs.add_drive_opts(img, readonly=1, format='raw')

Running lsof just prior to gfs.add_drive_opts being executed in Guest.py shows the iso open by oz-install.

As a workaround I simply added the following to Guest.py

self.log.info("Setting up guestfs handle for %s", self.tdl.name)
 fd = os.open(self.orig_iso, os.O_RDWR)
os.close ( fd )
gfs = guestfs.GuestFS()
@apconole
Copy link

Ran into the same issue on Fedora 27, and I applied the workaround described to get passed the issue. I don't think it's the correct solution, but I'm interested in seeing this resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants