1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
/*
* ap-check - Validate vfio-ap mediated device configuration changes
*
* Copyright IBM Corp. 2022
*
* s390-tools is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*/
#ifndef AP_CHECK_H
#define AP_CHECK_H
#include <stdbool.h>
/*
* List of all of the supported mdevctl actions
*/
enum mdevctl_action_id {
MDEVCTL_ACTION_DEFINE = 0,
MDEVCTL_ACTION_LIST,
MDEVCTL_ACTION_MODIFY,
MDEVCTL_ACTION_START,
MDEVCTL_ACTION_STOP,
MDEVCTL_ACTION_TYPES,
MDEVCTL_ACTION_UNDEFINE,
MDEVCTL_ACTION_ATTRIBUTES,
MDEVCTL_ACTION_CAPABILITIES,
/* UNKNOWN must always be the last in the list */
MDEVCTL_ACTION_UNKNOWN,
};
#define NUM_MDEVCTL_ACTIONS MDEVCTL_ACTION_UNKNOWN
struct mdevctl_action {
enum mdevctl_action_id id;
const char action[32];
};
enum mdevctl_event_id {
MDEVCTL_EVENT_PRE = 0,
MDEVCTL_EVENT_POST,
MDEVCTL_EVENT_GET,
MDEVCTL_EVENT_LIVE,
MDEVCTL_EVENT_UNKNOWN,
};
#define NUM_MDEVCTL_EVENTS MDEVCTL_EVENT_UNKNOWN
struct mdevctl_event {
enum mdevctl_event_id id;
const char event[32];
};
/* ap-check special exit codes */
#define APC_EXIT_UNKNOWN_TYPE 2
struct ap_check_anchor {
enum mdevctl_event_id event;
enum mdevctl_action_id action;
char *uuid;
char *parent;
char *type;
struct vfio_ap_device *dev;
/* Active Masks */
char apmask[80];
char aqmask[80];
/* Persistent Masks */
char p_apmask[80];
char p_aqmask[80];
bool cleanup_lock;
};
struct other_mdev_cb_data {
const char *uuid;
struct vfio_ap_device *dev;
};
#endif /* AP_CHECK_H */
|