Currently in the QEMU driver we don't support any of the customizable
shutdown operation behaviour elements in the XML. ie
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
This was principally because we don't particularly have a good way to actually
implement some of them. Well, QEMU 0.9.0 added a -no-reboot flag which could
be used to force a 'reboot' inside the guest to behaviour like a shutdown.
So we can now support at least the <on_reboot> element with 'destroy' or
'restart' behaviours.
This turns out to be critical for provisioning guests, because the initial
install uses a different VM configs, from later runtime, eg boot from ISO,
vs boot from Disk.
The attached patch adds support for accepting <on_reboot> when defining new
domain configs. When dumping XML we will also add <on_poweroff> and
<on_crash> elements to at least indicate what our behaviour is, though the
user can't customize them.
In doing this patch I had to change the way we read data from QEMU. We
were over the 4096 buffer size, and also in some cases we were getting a
short read which meant we lost the end of the help message. We now have
a buffer of 8k (max QEMU help is 5k currently), and read in a loop until
EOF or 8k is hit.
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules:
http://search.cpan.org/~danberr/ -=|
|=- Projects:
http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|