sciurus/vagrant-mutate

VagrantMutate::Qemu::verify_qemu_version fails to parse qemu-img version 1.0

Closed this issue · 2 comments

The command vagrant mutate trusty64 libvirt fails:

ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<VagrantMutate::Errors::ParseQemuVersionFailed: Determining the version of qemu-img installed failed>
ERROR vagrant: Determining the version of qemu-img installed failed
ERROR vagrant: /home/tjmartti/.vagrant.d/gems/gems/vagrant-mutate-0.2.6/lib/vagrant-mutate/qemu.rb:36:in `verify_qemu_version '
/home/tjmartti/.vagrant.d/gems/gems/vagrant-mutate-0.2.6/lib/vagrant-mutate/mutate.rb:25:in `execute'
/opt/vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/cli.rb:42:in `execute'
/opt/vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/environment.rb:252:in `cli'
/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.6.2/bin/vagrant:166:in `<main>'

Given this output from qemu-img:

qemu-img version 1.0, Copyright (c) 2004-2008 Fabrice Bellard

Presumeably due to the regex expecting a 1.0.0 minor version:

  def self.verify_qemu_version(env)
    usage = `qemu-img`
    if usage =~ /(\d+\.\d+\.\d+)/
      ...
    else
      raise Errors::ParseQemuVersionFailed
    end
  end

Good catch! Qemu must have changed how they report the version since 1.0 was releases. Version 2 reports itself as 2.0.0 I think.

We could try looking for /(\d+\.\d+)/ if /(\d+\.\d+\.\d+)/ fails unless you have a better idea.

FWIW I think vagrant-mutate is unlikely to work with qemu < 1.2.0.

FWIW I think vagrant-mutate is unlikely to work with qemu < 1.2.0.

Indeed, it failed to convert the virtualbox image, so the warning holds true - but a warning + the real qemu-img error would be better than an error about the qemu-img version format :)