You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

92 lines
2.9 KiB

  1. /*
  2. * virt-host-validate-common.h: Sanity check helper APIs
  3. *
  4. * Copyright (C) 2012 Red Hat, Inc.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library. If not, see
  18. * <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. #pragma once
  22. #include "internal.h"
  23. #include "virbitmap.h"
  24. #include "virenum.h"
  25. typedef enum {
  26. VIR_HOST_VALIDATE_FAIL,
  27. VIR_HOST_VALIDATE_WARN,
  28. VIR_HOST_VALIDATE_NOTE,
  29. VIR_HOST_VALIDATE_LAST,
  30. } virHostValidateLevel;
  31. typedef enum {
  32. VIR_HOST_VALIDATE_CPU_FLAG_VMX = 0,
  33. VIR_HOST_VALIDATE_CPU_FLAG_SVM,
  34. VIR_HOST_VALIDATE_CPU_FLAG_SIE,
  35. VIR_HOST_VALIDATE_CPU_FLAG_FACILITY_158,
  36. VIR_HOST_VALIDATE_CPU_FLAG_SEV,
  37. VIR_HOST_VALIDATE_CPU_FLAG_LAST,
  38. } virHostValidateCPUFlag;
  39. VIR_ENUM_DECL(virHostValidateCPUFlag);
  40. void virHostMsgSetQuiet(bool quietFlag);
  41. void virHostMsgCheck(const char *prefix,
  42. const char *format,
  43. ...) G_GNUC_PRINTF(2, 3);
  44. void virHostMsgPass(void);
  45. void virHostMsgFail(virHostValidateLevel level,
  46. const char *format,
  47. ...) G_GNUC_PRINTF(2, 3);
  48. int virHostValidateDeviceExists(const char *hvname,
  49. const char *dev_name,
  50. virHostValidateLevel level,
  51. const char *hint);
  52. int virHostValidateDeviceAccessible(const char *hvname,
  53. const char *dev_name,
  54. virHostValidateLevel level,
  55. const char *hint);
  56. virBitmapPtr virHostValidateGetCPUFlags(void);
  57. int virHostValidateLinuxKernel(const char *hvname,
  58. int version,
  59. virHostValidateLevel level,
  60. const char *hint);
  61. int virHostValidateNamespace(const char *hvname,
  62. const char *ns_name,
  63. virHostValidateLevel level,
  64. const char *hint);
  65. int virHostValidateCGroupControllers(const char *hvname,
  66. int controllers,
  67. virHostValidateLevel level);
  68. int virHostValidateIOMMU(const char *hvname,
  69. virHostValidateLevel level);
  70. int virHostValidateSecureGuests(const char *hvname,
  71. virHostValidateLevel level);
  72. bool virHostKernelModuleIsLoaded(const char *module);