diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index feae3d4e2ed94d6e052d7fd7cf9b8befcb8d716e..e6f3f272e0d60974a85e90f88512b22c3a5c1300 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -1,7 +1,7 @@ /* * node_device_conf.c: config handling for node devices * - * Copyright (C) 2009-2014 Red Hat, Inc. + * Copyright (C) 2009-2015 Red Hat, Inc. * Copyright (C) 2008 Virtual Iron Software, Inc. * Copyright (C) 2008 David F. Lively * @@ -76,9 +76,9 @@ int virNodeDeviceHasCap(const virNodeDeviceObj *dev, const char *cap) { virNodeDevCapsDefPtr caps = dev->def->caps; while (caps) { - if (STREQ(cap, virNodeDevCapTypeToString(caps->type))) + if (STREQ(cap, virNodeDevCapTypeToString(caps->data.type))) return 1; - else if (caps->type == VIR_NODE_DEV_CAP_SCSI_HOST) + else if (caps->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) if ((STREQ(cap, "fc_host") && (caps->data.scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST)) || @@ -285,12 +285,12 @@ char *virNodeDeviceDefFormat(const virNodeDeviceDef *def) for (caps = def->caps; caps; caps = caps->next) { char uuidstr[VIR_UUID_STRING_BUFLEN]; - union _virNodeDevCapData *data = &caps->data; + virNodeDevCapDataPtr data = &caps->data; virBufferAsprintf(&buf, "\n", - virNodeDevCapTypeToString(caps->type)); + virNodeDevCapTypeToString(caps->data.type)); virBufferAdjustIndent(&buf, 2); - switch (caps->type) { + switch (caps->data.type) { case VIR_NODE_DEV_CAP_SYSTEM: if (data->system.product_name) virBufferEscapeString(&buf, "%s\n", @@ -661,7 +661,7 @@ static int virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, - union _virNodeDevCapData *data) + virNodeDevCapDataPtr data) { xmlNodePtr orignode, *nodes = NULL; size_t i; @@ -755,7 +755,7 @@ static int virNodeDevCapSCSIParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, - union _virNodeDevCapData *data) + virNodeDevCapDataPtr data) { xmlNodePtr orignode; int ret = -1; @@ -800,7 +800,7 @@ static int virNodeDevCapSCSITargetParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, - union _virNodeDevCapData *data) + virNodeDevCapDataPtr data) { xmlNodePtr orignode; int ret = -1; @@ -828,7 +828,7 @@ static int virNodeDevCapSCSIHostParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, - union _virNodeDevCapData *data, + virNodeDevCapDataPtr data, int create, const char *virt_type) { @@ -932,7 +932,7 @@ static int virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, - union _virNodeDevCapData *data) + virNodeDevCapDataPtr data) { xmlNodePtr orignode, lnk; size_t i = -1; @@ -1010,7 +1010,7 @@ static int virNodeDevCapUSBInterfaceParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, - union _virNodeDevCapData *data) + virNodeDevCapDataPtr data) { xmlNodePtr orignode; int ret = -1; @@ -1077,7 +1077,7 @@ static int virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, - union _virNodeDevCapData *data) + virNodeDevCapDataPtr data) { xmlNodePtr orignode; int ret = -1; @@ -1121,7 +1121,7 @@ virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContextPtr ctxt, xmlNodePtr iommuGroupNode, - union _virNodeDevCapData *data) + virNodeDevCapDataPtr data) { xmlNodePtr origNode = ctxt->node; xmlNodePtr *addrNodes = NULL; @@ -1259,7 +1259,7 @@ static int virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, - union _virNodeDevCapData *data) + virNodeDevCapDataPtr data) { xmlNodePtr orignode, iommuGroupNode, pciExpress; int ret = -1; @@ -1344,7 +1344,7 @@ static int virNodeDevCapSystemParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, xmlNodePtr node, - union _virNodeDevCapData *data) + virNodeDevCapDataPtr data) { xmlNodePtr orignode; int ret = -1; @@ -1411,10 +1411,10 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, VIR_FREE(tmp); goto error; } - caps->type = val; + caps->data.type = val; VIR_FREE(tmp); - switch (caps->type) { + switch (caps->data.type) { case VIR_NODE_DEV_CAP_SYSTEM: ret = virNodeDevCapSystemParseXML(ctxt, def, node, &caps->data); break; @@ -1451,7 +1451,7 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, case VIR_NODE_DEV_CAP_LAST: virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown capability type '%d' for '%s'"), - caps->type, def->name); + caps->data.type, def->name); ret = -1; break; } @@ -1607,7 +1607,7 @@ virNodeDeviceGetWWNs(virNodeDeviceDefPtr def, cap = def->caps; while (cap != NULL) { - if (cap->type == VIR_NODE_DEV_CAP_SCSI_HOST && + if (cap->data.type == VIR_NODE_DEV_CAP_SCSI_HOST && cap->data.scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) { if (VIR_STRDUP(*wwnn, cap->data.scsi_host.wwnn) < 0 || VIR_STRDUP(*wwpn, cap->data.scsi_host.wwpn) < 0) { @@ -1656,7 +1656,7 @@ virNodeDeviceGetParentHost(virNodeDeviceObjListPtr devs, cap = parent->def->caps; while (cap != NULL) { - if (cap->type == VIR_NODE_DEV_CAP_SCSI_HOST && + if (cap->data.type == VIR_NODE_DEV_CAP_SCSI_HOST && (cap->data.scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS)) { *parent_host = cap->data.scsi_host.host; @@ -1683,9 +1683,9 @@ virNodeDeviceGetParentHost(virNodeDeviceObjListPtr devs, void virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) { size_t i = 0; - union _virNodeDevCapData *data = &caps->data; + virNodeDevCapDataPtr data = &caps->data; - switch (caps->type) { + switch (caps->data.type) { case VIR_NODE_DEV_CAP_SYSTEM: VIR_FREE(data->system.product_name); VIR_FREE(data->system.hardware.vendor_name); @@ -1771,10 +1771,10 @@ virNodeDeviceCapMatch(virNodeDeviceObjPtr devobj, virNodeDevCapsDefPtr cap = NULL; for (cap = devobj->def->caps; cap; cap = cap->next) { - if (type == cap->type) + if (type == cap->data.type) return true; - if (cap->type == VIR_NODE_DEV_CAP_SCSI_HOST) { + if (cap->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) { if (type == VIR_NODE_DEV_CAP_FC_HOST && (cap->data.scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST)) diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index 38c6d457889f13a682e926530d9521312aa620b0..7dd39ca96338a45449bf2009dbb2a736bf62b5e9 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -1,7 +1,7 @@ /* * node_device_conf.h: config handling for node devices * - * Copyright (C) 2009-2014 Red Hat, Inc. + * Copyright (C) 2009-2015 Red Hat, Inc. * Copyright (C) 2008 Virtual Iron Software, Inc. * Copyright (C) 2008 David F. Lively * @@ -82,11 +82,9 @@ typedef enum { VIR_NODE_DEV_CAP_FLAG_PCIE = (1 << 2), } virNodeDevPCICapFlags; -typedef struct _virNodeDevCapsDef virNodeDevCapsDef; -typedef virNodeDevCapsDef *virNodeDevCapsDefPtr; -struct _virNodeDevCapsDef { +typedef struct _virNodeDevCapData { virNodeDevCapType type; - union _virNodeDevCapData { + union { struct { char *product_name; struct { @@ -181,7 +179,13 @@ struct _virNodeDevCapsDef { struct { char *path; } sg; /* SCSI generic device */ - } data; + }; +} virNodeDevCapData, *virNodeDevCapDataPtr; + +typedef struct _virNodeDevCapsDef virNodeDevCapsDef; +typedef virNodeDevCapsDef *virNodeDevCapsDefPtr; +struct _virNodeDevCapsDef { + virNodeDevCapData data; virNodeDevCapsDefPtr next; /* next capability */ }; diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index d6b20ae6466351f6cb26b2a105df53f5c7974e45..895cf262abc07a430e6b424e8b9bec4b46d853e2 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1,7 +1,7 @@ /* * libxl_driver.c: core driver methods for managing libxenlight domains * - * Copyright (C) 2006-2014 Red Hat, Inc. + * Copyright (C) 2006-2015 Red Hat, Inc. * Copyright (C) 2011-2015 SUSE LINUX Products GmbH, Nuernberg, Germany. * Copyright (C) 2011 Univention GmbH. * @@ -4620,7 +4620,7 @@ libxlNodeDeviceGetPCIInfo(virNodeDeviceDefPtr def, cap = def->caps; while (cap) { - if (cap->type == VIR_NODE_DEV_CAP_PCI_DEV) { + if (cap->data.type == VIR_NODE_DEV_CAP_PCI_DEV) { *domain = cap->data.pci_dev.domain; *bus = cap->data.pci_dev.bus; *slot = cap->data.pci_dev.slot; diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index b8d9f4f5655502a97b3f77e421a3d00bf1bc0b57..a14191c08c00bc69bd97d7f4740462f8819bd560 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -1,7 +1,7 @@ /* * node_device_driver.c: node device enumeration * - * Copyright (C) 2010-2014 Red Hat, Inc. + * Copyright (C) 2010-2015 Red Hat, Inc. * Copyright (C) 2008 Virtual Iron Software, Inc. * Copyright (C) 2008 David F. Lively * @@ -50,9 +50,9 @@ static int update_caps(virNodeDeviceObjPtr dev) virNodeDevCapsDefPtr cap = dev->def->caps; while (cap) { - if (cap->type == VIR_NODE_DEV_CAP_SCSI_HOST) + if (cap->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) detect_scsi_host_caps(&dev->def->caps->data); - if (cap->type == VIR_NODE_DEV_CAP_NET && + if (cap->data.type == VIR_NODE_DEV_CAP_NET && virNetDevGetLinkInfo(cap->data.net.ifname, &cap->data.net.lnk) < 0) return -1; @@ -262,7 +262,7 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn, cap = obj->def->caps; while (cap) { - if (cap->type == VIR_NODE_DEV_CAP_SCSI_HOST) { + if (cap->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) { detect_scsi_host_caps(&cap->data); if (cap->data.scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) { @@ -386,7 +386,7 @@ nodeDeviceNumOfCaps(virNodeDevicePtr dev) for (caps = obj->def->caps; caps; caps = caps->next) { ++ncaps; - if (caps->type == VIR_NODE_DEV_CAP_SCSI_HOST) { + if (caps->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) { if (caps->data.scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) ncaps++; @@ -429,10 +429,10 @@ nodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames) goto cleanup; for (caps = obj->def->caps; caps && ncaps < maxnames; caps = caps->next) { - if (VIR_STRDUP(names[ncaps++], virNodeDevCapTypeToString(caps->type)) < 0) + if (VIR_STRDUP(names[ncaps++], virNodeDevCapTypeToString(caps->data.type)) < 0) goto cleanup; - if (caps->type == VIR_NODE_DEV_CAP_SCSI_HOST) { + if (caps->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) { if (ncaps < maxnames && caps->data.scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) { diff --git a/src/node_device/node_device_driver.h b/src/node_device/node_device_driver.h index 79583cdabda5936f4d7a348737d9ea0eadd89d1a..81bca985900542f5b2329883e3752bdea1324f90 100644 --- a/src/node_device/node_device_driver.h +++ b/src/node_device/node_device_driver.h @@ -44,7 +44,7 @@ extern virNodeDeviceDriverStatePtr driver; int nodedevRegister(void); -int detect_scsi_host_caps(union _virNodeDevCapData *d); +int detect_scsi_host_caps(virNodeDevCapDataPtr d); int nodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags); int nodeListDevices(virConnectPtr conn, const char *cap, char **const names, diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index fa37787dd6921cae63b127c5422970d6925ccf7b..38e09c4aceff27e3e490ea79a356f1d670d5343f 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -139,7 +139,7 @@ get_uint64_prop(LibHalContext *ctxt, const char *udi, static int gather_pci_cap(LibHalContext *ctx, const char *udi, - union _virNodeDevCapData *d) + virNodeDevCapDataPtr d) { char *sysfs_path; @@ -182,7 +182,7 @@ gather_pci_cap(LibHalContext *ctx, const char *udi, static int gather_usb_cap(LibHalContext *ctx, const char *udi, - union _virNodeDevCapData *d) + virNodeDevCapDataPtr d) { (void)get_int_prop(ctx, udi, "usb.interface.number", (int *)&d->usb_if.number); @@ -200,7 +200,7 @@ gather_usb_cap(LibHalContext *ctx, const char *udi, static int gather_usb_device_cap(LibHalContext *ctx, const char *udi, - union _virNodeDevCapData *d) + virNodeDevCapDataPtr d) { (void)get_int_prop(ctx, udi, "usb_device.bus_number", (int *)&d->usb_dev.bus); @@ -222,7 +222,7 @@ gather_usb_device_cap(LibHalContext *ctx, const char *udi, static int gather_net_cap(LibHalContext *ctx, const char *udi, - union _virNodeDevCapData *d) + virNodeDevCapDataPtr d) { unsigned long long dummy; (void)get_str_prop(ctx, udi, "net.interface", &d->net.ifname); @@ -242,7 +242,7 @@ gather_net_cap(LibHalContext *ctx, const char *udi, static int gather_scsi_host_cap(LibHalContext *ctx, const char *udi, - union _virNodeDevCapData *d) + virNodeDevCapDataPtr d) { int retval = 0; @@ -260,7 +260,7 @@ gather_scsi_host_cap(LibHalContext *ctx, const char *udi, static int gather_scsi_cap(LibHalContext *ctx, const char *udi, - union _virNodeDevCapData *d) + virNodeDevCapDataPtr d) { (void)get_int_prop(ctx, udi, "scsi.host", (int *)&d->scsi.host); (void)get_int_prop(ctx, udi, "scsi.bus", (int *)&d->scsi.bus); @@ -273,7 +273,7 @@ gather_scsi_cap(LibHalContext *ctx, const char *udi, static int gather_storage_cap(LibHalContext *ctx, const char *udi, - union _virNodeDevCapData *d) + virNodeDevCapDataPtr d) { int val; (void)get_str_prop(ctx, udi, "block.device", &d->storage.block); @@ -301,7 +301,7 @@ gather_storage_cap(LibHalContext *ctx, const char *udi, static int gather_scsi_generic_cap(LibHalContext *ctx, const char *udi, - union _virNodeDevCapData *d) + virNodeDevCapDataPtr d) { (void)get_str_prop(ctx, udi, "scsi_generic.device", &d->sg.path); return 0; @@ -310,7 +310,7 @@ gather_scsi_generic_cap(LibHalContext *ctx, const char *udi, static int gather_system_cap(LibHalContext *ctx, const char *udi, - union _virNodeDevCapData *d) + virNodeDevCapDataPtr d) { char *uuidstr; @@ -340,7 +340,7 @@ struct _caps_tbl_entry { virNodeDevCapType type; int (*gather_fn)(LibHalContext *ctx, const char *udi, - union _virNodeDevCapData *data); + virNodeDevCapDataPtr data); }; typedef struct _caps_tbl_entry caps_tbl_entry; diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c index 4a95b2b3287f8aa4f8812a2378f99031cbac160d..d4c2a3ca70399cec8c6baa431d1f5e765aefc3da 100644 --- a/src/node_device/node_device_linux_sysfs.c +++ b/src/node_device/node_device_linux_sysfs.c @@ -2,7 +2,7 @@ * node_device_linux_sysfs.c: Linux specific code to gather device data * not available through HAL. * - * Copyright (C) 2009-2013 Red Hat, Inc. + * Copyright (C) 2009-2015 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -41,7 +41,7 @@ VIR_LOG_INIT("node_device.node_device_linux_sysfs"); int -detect_scsi_host_caps(union _virNodeDevCapData *d) +detect_scsi_host_caps(virNodeDevCapDataPtr d) { char *max_vports = NULL; char *vports = NULL; @@ -139,7 +139,7 @@ detect_scsi_host_caps(union _virNodeDevCapData *d) #else int -detect_scsi_host_caps(union _virNodeDevCapData *d ATTRIBUTE_UNUSED) +detect_scsi_host_caps(virNodeDevCapDataPtr d ATTRIBUTE_UNUSED) { return -1; } diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 846f57014668a1302c385d7aac034b933503066e..b6619bd4ac5d2017d73a295a700c7bd90ee3c176 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -411,7 +411,7 @@ static int udevProcessPCI(struct udev_device *device, virNodeDeviceDefPtr def) { const char *syspath = NULL; - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; virPCIDeviceAddress addr; virPCIEDeviceInfoPtr pci_express = NULL; virPCIDevicePtr pciDev = NULL; @@ -567,7 +567,7 @@ static int udevProcessPCI(struct udev_device *device, static int udevProcessUSBDevice(struct udev_device *device, virNodeDeviceDefPtr def) { - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; int ret = -1; int err; @@ -639,7 +639,7 @@ static int udevProcessUSBInterface(struct udev_device *device, virNodeDeviceDefPtr def) { int ret = -1; - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; if (udevGetUintSysfsAttr(device, "bInterfaceNumber", @@ -684,7 +684,7 @@ static int udevProcessNetworkInterface(struct udev_device *device, { int ret = -1; const char *devtype = udev_device_get_devtype(device); - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; if (devtype && STREQ(devtype, "wlan")) { data->net.subtype = VIR_NODE_DEV_CAP_NET_80211; @@ -731,7 +731,7 @@ static int udevProcessSCSIHost(struct udev_device *device ATTRIBUTE_UNUSED, virNodeDeviceDefPtr def) { int ret = -1; - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; char *filename = NULL; filename = last_component(def->sysfs_path); @@ -766,7 +766,7 @@ static int udevProcessSCSITarget(struct udev_device *device ATTRIBUTE_UNUSED, { int ret = -1; const char *sysname = NULL; - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; sysname = udev_device_get_sysname(device); @@ -846,7 +846,7 @@ static int udevProcessSCSIDevice(struct udev_device *device ATTRIBUTE_UNUSED, { int ret = -1; unsigned int tmp = 0; - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; char *filename = NULL, *p = NULL; filename = last_component(def->sysfs_path); @@ -905,7 +905,7 @@ static int udevProcessSCSIDevice(struct udev_device *device ATTRIBUTE_UNUSED, static int udevProcessDisk(struct udev_device *device, virNodeDeviceDefPtr def) { - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; int ret = 0; if (udevGetUint64SysfsAttr(device, @@ -933,7 +933,7 @@ static int udevProcessRemoveableMedia(struct udev_device *device, virNodeDeviceDefPtr def, int has_media) { - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; int tmp_int = 0, ret = 0; if ((udevGetIntSysfsAttr(device, "removable", &tmp_int, 0) == PROPERTY_FOUND) && @@ -1025,7 +1025,7 @@ static int udevProcessFloppy(struct udev_device *device, static int udevProcessSD(struct udev_device *device, virNodeDeviceDefPtr def) { - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; int ret = 0; if (udevGetUint64SysfsAttr(device, @@ -1098,7 +1098,7 @@ static void udevStripSpaces(char *s) static int udevProcessStorage(struct udev_device *device, virNodeDeviceDefPtr def) { - union _virNodeDevCapData *data = &def->caps->data; + virNodeDevCapDataPtr data = &def->caps->data; int ret = -1; const char* devnode; @@ -1281,7 +1281,7 @@ static int udevGetDeviceDetails(struct udev_device *device, { int ret = 0; - switch (def->caps->type) { + switch (def->caps->data.type) { case VIR_NODE_DEV_CAP_SYSTEM: /* There's no libudev equivalent of system, so ignore it. */ break; @@ -1313,7 +1313,7 @@ static int udevGetDeviceDetails(struct udev_device *device, ret = udevProcessSCSIGeneric(device, def); break; default: - VIR_ERROR(_("Unknown device type %d"), def->caps->type); + VIR_ERROR(_("Unknown device type %d"), def->caps->data.type); ret = -1; break; } @@ -1414,7 +1414,7 @@ static int udevAddOneDevice(struct udev_device *device) if (VIR_ALLOC(def->caps) != 0) goto out; - if (udevGetDeviceType(device, &def->caps->type) != 0) + if (udevGetDeviceType(device, &def->caps->data.type) != 0) goto out; if (udevGetDeviceDetails(device, def) != 0) @@ -1588,7 +1588,7 @@ static void udevEventHandleCallback(int watch ATTRIBUTE_UNUSED, /* DMI is intel-compatible specific */ #if defined(__x86_64__) || defined(__i386__) || defined(__amd64__) static void -udevGetDMIData(union _virNodeDevCapData *data) +udevGetDMIData(virNodeDevCapDataPtr data) { struct udev *udev = NULL; struct udev_device *device = NULL; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2668011be32902311e4c21fe2b8f4d48d3585f35..8c00cdcb55fe16294c52d3aa7ef3f2d31db0dca4 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13091,7 +13091,7 @@ qemuNodeDeviceGetPCIInfo(virNodeDeviceDefPtr def, cap = def->caps; while (cap) { - if (cap->type == VIR_NODE_DEV_CAP_PCI_DEV) { + if (cap->data.type == VIR_NODE_DEV_CAP_PCI_DEV) { *domain = cap->data.pci_dev.domain; *bus = cap->data.pci_dev.bus; *slot = cap->data.pci_dev.slot; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 51ab2e059ac706c0a0a9c9d0b12d8ff033b3ab83..038b2b89bdf9dc1e303e987c16f0757368a009bb 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1,7 +1,7 @@ /* * test_driver.c: A "mock" hypervisor for use by application unit tests * - * Copyright (C) 2006-2014 Red Hat, Inc. + * Copyright (C) 2006-2015 Red Hat, Inc. * Copyright (C) 2006 Daniel P. Berrange * * This library is free software; you can redistribute it and/or @@ -5798,7 +5798,7 @@ testNodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames) } for (caps = obj->def->caps; caps && ncaps < maxnames; caps = caps->next) { - if (VIR_STRDUP(names[ncaps++], virNodeDevCapTypeToString(caps->type)) < 0) + if (VIR_STRDUP(names[ncaps++], virNodeDevCapTypeToString(caps->data.type)) < 0) goto cleanup; } ret = ncaps; @@ -5856,7 +5856,7 @@ testNodeDeviceCreateXML(virConnectPtr conn, * since this would also come from the backend */ caps = def->caps; while (caps) { - if (caps->type != VIR_NODE_DEV_CAP_SCSI_HOST) + if (caps->data.type != VIR_NODE_DEV_CAP_SCSI_HOST) continue; caps->data.scsi_host.host = virRandomBits(10); diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 7711f333b67e7ea0712acea89e860d12d0a40dfd..da9e6f4e8a5fe630a9b851a5d5c346999c33b561 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -1,7 +1,7 @@ /* * xen_driver.c: Unified Xen driver. * - * Copyright (C) 2007-2014 Red Hat, Inc. + * Copyright (C) 2007-2015 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -2488,7 +2488,7 @@ xenUnifiedNodeDeviceGetPCIInfo(virNodeDevicePtr dev, cap = def->caps; while (cap) { - if (cap->type == VIR_NODE_DEV_CAP_PCI_DEV) { + if (cap->data.type == VIR_NODE_DEV_CAP_PCI_DEV) { *domain = cap->data.pci_dev.domain; *bus = cap->data.pci_dev.bus; *slot = cap->data.pci_dev.slot;