# Cannot upgrade to qemu 2.0 because of old libvirt domains

## guido-pe

Hi,

When I run "emerge -uvADN --with-bdeps y @world" today, emerge wants to upgrade qemu from 1.7.0 to 2.0.0. However, the upgrade is immediately stopped again with the following message:

```

 * The kvm/qemu-kvm wrappers no longer exist, but your libvirt

 * instances are still pointing to it.  Please update your

 * configs in /etc/libvirt/qemu/ to use the -enable-kvm flag

 * and the right system binary (e.g. qemu-system-x86_64).

 * ERROR: app-emulation/qemu-2.0.0::gentoo failed (pretend phase):

 *   update your virt configs to not use qemu-kvm

```

So I looked the files in that directory, and they indeed have a line "<emulator>/usr/bin/qemu-kvm</emulator>" (in the devices section, for some reason...), but they also have this comment at the top of the file:

```

<!--

WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE

OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:

  virsh edit drqueue_xp_slave

or other application using the libvirt API.

-->

```

So I started editing my domains (none of them running at that point, btw) in virsh instead, simply removing the "<emulator>/usr/bin/qemu-kvm</emulator>" line. Except the change didn't take. libvirt will immediately add that back again after saving.

So, how do I tell libvirt it's not supposed to use the qemu-kvm wrapper?

----------

## greyhare

It's a pathetic message, which assumes you're running qemu from the command line. The wiki page says nothing. But I managed to guess my way to the answer.

Using virtsh, you have to replace this:

```
<emulator>/usr/bin/qemu-kvm</emulator>
```

with something like this:

```
<emulator>/usr/bin/qemu-system-x86_64</emulator>
```

Apparently libvirt takes care of adding the -enable-kvm flag for you.

This change allowed qemu-2.0.0 to emerge successfully, with the following helpfully useless (i.e. post-hoc) message:

```
 * Migration from qemu-kvm instances and loading qemu-kvm created

 * save states has been removed starting with the 1.6.2 release

 * 

 * It is recommended that you migrate any VMs that may be running

 * on qemu-kvm to a host with a newer qemu and regenerate

 * any saved states with a newer qemu.

 * 

 * qemu-kvm was the primary qemu provider in Gentoo through 1.2.x

 * 

 * The /usr/bin/kvm and /usr/bin/qemu-kvm wrappers are no longer

 * installed.  In order to use kvm acceleration, pass the flag

 * -enable-kvm when running your system target.

```

They say "migrate" like it's a far more involved process than changing one line in an XML file. So I'm hoping something doesn't break.

If this is all it was, I don't know why there wasn't some kind of automatic fix using sed or equivalent in the libvirt (or something) ebuild. Or at least an item in eselect news.

----------

## guido-pe

Thanks greyhare, it works like this now. I have to agree with you, this was not handled very in the ebuild...

----------

## eccerr0r

+1

I hacked my xml file to get past the build precheck phase, though I think the warning/error was too terse and difficult to know what needed to be done if you've been using libvirt.  At least it didn't kill the VMs on next start, it was a good warning for things to come.

----------

## feiticeir0

Thank you !

The ebuild message is not clear !

----------

## DaggyStyle

+1

thanks, why can't the make it more clearer?????

----------

