[libvirt] [PATCH V2 1/5] Add public API virDomainSendSysrq

Peter Krempa pkrempa at redhat.com
Fri Dec 12 09:23:58 UTC 2014


On 12/12/14 10:18, Peter Krempa wrote:
> On 12/12/14 10:04, Chunyan Liu wrote:
>> Add public API virDomainSendSysrq for sending SysRequest key.
>>
>> Signed-off-by: Chunyan Liu <cyliu at suse.com>
>> ---
>>  include/libvirt/libvirt-domain.h |  3 +++
>>  src/driver-hypervisor.h          |  4 ++++
>>  src/libvirt-domain.c             | 38 ++++++++++++++++++++++++++++++++++++++
>>  src/libvirt_public.syms          |  1 +
>>  4 files changed, 46 insertions(+)
>>
> 
> [...]
> 
>> diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
>> index cb76d8c..4658fd7 100644
>> --- a/src/libvirt-domain.c
>> +++ b/src/libvirt-domain.c
>> @@ -11192,3 +11192,41 @@ virDomainFSInfoFree(virDomainFSInfoPtr info)
>>          VIR_FREE(info->devAlias[i]);
>>      VIR_FREE(info->devAlias);
>>  }
>> +
>> +
>> +/**
>> + * virDomainSendSysrq:
>> + * @domain:    pointer to domain object, or NULL for Domain0
>> + * @key:    SysRq key, like h, c, ...
>> + *
>> + * Send SysRq key to the guest.
>> + *
>> + * Returns 0 in case of success, -1 in case of failure.
>> + */
>> +int
>> +virDomainSendSysrq(virDomainPtr domain, const char *key)
> 
> The new API should definitely have a 'flags' argument although it may be
> unused for now.
> 

As an additional thought. Isn't this possible with the existing
virDomainSendKey API? The sysrq combination is a key code, so you should
be able to use that API to do the same thing. In that case all you need
is a virsh wrapper and an implementation of the API for the XEN driver.

Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141212/ea1068a4/attachment-0001.sig>


More information about the libvir-list mailing list