I just checked with QEMU + libvirt on Ubuntu 14.04 (same QEMU versions, libvirt 1.2.1 instead), and it works as intended. libvirt detects the guest as stopped and successfully tears it down. I also did a very rudimentary test of stealing libvirt 1.2.6 from Utopic and it also seemed to work.

As such I've filed a bug with the debian maintainers.


On 11 July 2014 16:35, Claudio Bley <cbley@av-test.de> wrote:
At Fri, 11 Jul 2014 05:27:46 +0000,
Michael D wrote:
>
> I am currently running LibVirt with Qemu on Debian Wheezy:
>
> Versions:
>
>    - libvirtd (libvirt) 1.2.4
>    - qemu-x86_64 version 2.0.0 (Debian 2.0.0+dfsg-4~bpo70+1), Copyright (c)
>    2003-2008 Fabrice Bellard
>
> It's all working perfectly, including ACPI: virsh shutdown guest. However
> when I issue "halt" from the guest, the guest stops but libvirt thinks it
> is still running: (virsh list outputs state: running). virsh dominfo does
> the same thing: State: running

This is how "halt" works, the machine is still powered on, but
processing is halted.

> I believe this is due to the -no-shutdown flag passed to qemu, making it
> stop the CPUs rather than halt entirely.

AFAIU, this flag comes into play when you do a *shutdown* of the
guest. The guest will be shutdown, the virtual machine stops but Qemu
will not exit.

> Is this however a bug that the status is not updated correctly? I've
> taken a glance at the source and it should SIGTERM qemu when it sees
> the stop, but evidently it isn't.

I think this is normal behavior. As long as Qemu is emulating some
hardware, it is in the "running" state.

If you do a shutdown inside the guest, the domain should be regarded
as shut down in libvirt too.

--
Claudio