mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
libxl: create: setdefault: Make libxl_physinfo info[1]
No functional change. This will let us make it into a pointer without
textual change other than to the definition.
While we are here, fix some style errors (missing { }).
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Wei Liu <wl@xen.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
1 parent
5dedc18d64
commit
af5c475dee
1 file changed
+8
-8
@@ -30,10 +30,10 @@
|
||||
int libxl__domain_create_info_setdefault(libxl__gc *gc,
|
||||
libxl_domain_create_info *c_info)
|
||||
{
|
||||
libxl_physinfo info;
|
||||
libxl_physinfo info[1];
|
||||
int rc;
|
||||
|
||||
rc = libxl_get_physinfo(CTX, &info);
|
||||
rc = libxl_get_physinfo(CTX, info);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
@@ -45,11 +45,11 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc,
|
||||
libxl__arch_domain_create_info_setdefault(gc, c_info);
|
||||
|
||||
if (c_info->type != LIBXL_DOMAIN_TYPE_PV) {
|
||||
if (info.cap_hap)
|
||||
if (info->cap_hap) {
|
||||
libxl_defbool_setdefault(&c_info->hap, true);
|
||||
else if (info.cap_shadow)
|
||||
} else if (info->cap_shadow) {
|
||||
libxl_defbool_setdefault(&c_info->hap, false);
|
||||
else {
|
||||
} else {
|
||||
LOG(ERROR, "neither hap nor shadow paging available");
|
||||
return ERROR_INVAL;
|
||||
}
|
||||
@@ -63,12 +63,12 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc,
|
||||
if (!c_info->ssidref)
|
||||
c_info->ssidref = SECINITSID_DOMU;
|
||||
|
||||
if (info.cap_hvm_directio &&
|
||||
if (info->cap_hvm_directio &&
|
||||
(c_info->passthrough == LIBXL_PASSTHROUGH_UNKNOWN)) {
|
||||
c_info->passthrough = ((c_info->type == LIBXL_DOMAIN_TYPE_PV) ||
|
||||
!info.cap_iommu_hap_pt_share) ?
|
||||
!info->cap_iommu_hap_pt_share) ?
|
||||
LIBXL_PASSTHROUGH_SYNC_PT : LIBXL_PASSTHROUGH_SHARE_PT;
|
||||
} else if (!info.cap_hvm_directio) {
|
||||
} else if (!info->cap_hvm_directio) {
|
||||
c_info->passthrough = LIBXL_PASSTHROUGH_DISABLED;
|
||||
}
|
||||
|
||||
|
||||