Skip to content

Commit fb1249f

Browse files
committed
Run qemu-img info in shared mode for GetInfo
Avoids errors about the disk being in use by the running qemu. Older versions of qemu default to read-write mode for images. Signed-off-by: Anders F Björklund <[email protected]>
1 parent 97a4146 commit fb1249f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/qemu/imgutil/imgutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func QCOWToRaw(source string, dest string) error {
2929

3030
func GetInfo(f string) (*Info, error) {
3131
var stdout, stderr bytes.Buffer
32-
cmd := exec.Command("qemu-img", "info", "--output=json", f)
32+
cmd := exec.Command("qemu-img", "info", "--output=json", "--force-share", f)
3333
cmd.Stdout = &stdout
3434
cmd.Stderr = &stderr
3535
if err := cmd.Run(); err != nil {

0 commit comments

Comments
 (0)