[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 17/17] ipmi: Add a force off function
From: |
Corey Minyard |
Subject: |
Re: [Qemu-devel] [PATCH v4 17/17] ipmi: Add a force off function |
Date: |
Fri, 13 Nov 2015 07:22:43 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 11/13/2015 03:15 AM, Daniel P. Berrange wrote:
> On Thu, Nov 12, 2015 at 01:02:33PM -0600, address@hidden wrote:
>> From: Corey Minyard <address@hidden>
>>
>> Allow the IPMI interface to request a forced power off.
>>
>> Signed-off-by: Corey Minyard <address@hidden>
>> ---
>> hw/ipmi/ipmi_bmc_extern.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c
>> index 05b9121..7ae6294 100644
>> --- a/hw/ipmi/ipmi_bmc_extern.c
>> +++ b/hw/ipmi/ipmi_bmc_extern.c
>> @@ -52,6 +52,7 @@
>> #define VM_CAPABILITIES_IRQ 0x04
>> #define VM_CAPABILITIES_NMI 0x08
>> #define VM_CAPABILITIES_ATTN 0x10
>> +#define VM_CMD_FORCEOFF 0x09
>>
>> #define TYPE_IPMI_BMC_EXTERN "ipmi-bmc-extern"
>> #define IPMI_BMC_EXTERN(obj) OBJECT_CHECK(IPMIBmcExtern, (obj), \
>> @@ -268,6 +269,10 @@ static void handle_hw_op(IPMIBmcExtern *ibe, unsigned
>> char hw_op)
>> case VM_CMD_SEND_NMI:
>> k->do_hw_op(s, IPMI_SEND_NMI, 0);
>> break;
>> +
>> + case VM_CMD_FORCEOFF:
>> + exit(0);
>> + break;
> You should really be calling qemu_system_shutdown_request() rather than
> exit() so that you run normal QEMU shutdown logic.
qemu_system_shutdown_request() would generally have already been called using
VM_CMD_POWEROFF. If I understand correctly, qemu_system_shutdown_request() does
a graceful shutdown and may not complete if the OS has failed.
The CMD_FORCEOFF is a "power off and don't ask me any questions" operation.
It's
used as a last resort if VM_CMD_POWEROFF fails.
-corey
- [Qemu-devel] [PATCH v4 04/17] ipmi: Add an external connection simulation interface, (continued)
- [Qemu-devel] [PATCH v4 04/17] ipmi: Add an external connection simulation interface, minyard, 2015/11/12
- [Qemu-devel] [PATCH v4 02/17] Add a base IPMI interface, minyard, 2015/11/12
- [Qemu-devel] [PATCH v4 13/17] pc: Postpone SMBIOS table installation to post machine init, minyard, 2015/11/12
- [Qemu-devel] [PATCH v4 09/17] ipmi: Add migration capability to the IPMI devices., minyard, 2015/11/12
- [Qemu-devel] [PATCH v4 12/17] smbios: Move table build tools into an include file., minyard, 2015/11/12
- [Qemu-devel] [PATCH v4 14/17] ipmi: Add SMBIOS table entry, minyard, 2015/11/12
- [Qemu-devel] [PATCH v4 06/17] ipmi: Add a BT low-level interface, minyard, 2015/11/12
- [Qemu-devel] [PATCH v4 03/17] ipmi: Add a local BMC simulation, minyard, 2015/11/12
- [Qemu-devel] [PATCH v4 17/17] ipmi: Add a force off function, minyard, 2015/11/12
[Qemu-devel] [PATCH v4 15/17] acpi: Add IPMI table entries, minyard, 2015/11/12
Re: [Qemu-devel] [PATCH v4 00/17] Add an IPMI device to QEMU, Cédric Le Goater, 2015/11/15
Re: [Qemu-devel] [PATCH v4 00/17] Add an IPMI device to QEMU, Benjamin Herrenschmidt, 2015/11/16