mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
The seemingly arbitrary use of 'pci' and 'pcidev' in the code in libxl_pci.c
is confusing and also compromises use of some macros used for other device
types. Indeed it seems that DEFINE_DEVICE_TYPE_STRUCT_X exists solely because
of this duality.
This patch purges use of 'pcidev' from the libxl internal code, but
unfortunately the 'pcidevs' and 'num_pcidevs' fields in 'libxl_domain_config'
are part of the API and need to be retained to avoid breaking callers,
particularly libvirt.
DEFINE_DEVICE_TYPE_STRUCT_X is still removed to avoid the special case in
libxl_pci.c but DEFINE_DEVICE_TYPE_STRUCT is given an extra 'array' argument
which is used to identify the fields in 'libxl_domain_config' relating to
the device type.
NOTE: Some of the more gross formatting errors (such as lack of spaces after
keywords) that came into context have been fixed in libxl_pci.c.
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Wei Liu <wl@xen.org>
38 lines
1.3 KiB
C
38 lines
1.3 KiB
C
/*
|
|
* Copyright (C) 2018 Aporeto
|
|
* Author Stefano Stabellini <stefano@aporeto.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License as published
|
|
* by the Free Software Foundation; version 2.1 only. with the special
|
|
* exception on linking described in file LICENSE.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*/
|
|
|
|
#include "libxl_osdeps.h"
|
|
|
|
#include "libxl_internal.h"
|
|
|
|
static int libxl__device_pvcallsif_setdefault(libxl__gc *gc, uint32_t domid,
|
|
libxl_device_pvcallsif *pvcallsif,
|
|
bool hotplug)
|
|
{
|
|
return libxl__resolve_domid(gc, pvcallsif->backend_domname,
|
|
&pvcallsif->backend_domid);
|
|
}
|
|
|
|
static LIBXL_DEFINE_UPDATE_DEVID(pvcallsif)
|
|
static LIBXL_DEFINE_DEVICE_FROM_TYPE(pvcallsif)
|
|
|
|
#define libxl__add_pvcallsifs NULL
|
|
#define libxl_device_pvcallsif_list NULL
|
|
#define libxl_device_pvcallsif_compare NULL
|
|
|
|
LIBXL_DEFINE_DEVICE_REMOVE(pvcallsif)
|
|
|
|
DEFINE_DEVICE_TYPE_STRUCT(pvcallsif, PVCALLS, pvcallsifs);
|