From 1b0cce7d3a458839367f4a12c1300ebe1cdf5972 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 30 Nov 2009 18:35:58 +0000 Subject: [PATCH] Introduce a standardized data structure for device addresses All guest devices now use a common device address structure summarized by: enum virDomainDeviceAddressType { VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI, }; struct _virDomainDevicePCIAddress { unsigned int domain; unsigned int bus; unsigned int slot; unsigned int function; }; struct _virDomainDeviceInfo { int type; union { virDomainDevicePCIAddress pci; } addr; }; This replaces the anonymous structs in Disk/Net/Hostdev data structures. Where available, the address is *always* printed in the XML file, instead of being hidden in the internal state file.
The structure definition is based on Wolfgang Mauerer's disk controller patch series. * docs/schemas/domain.rng: Define the
syntax and associate it with disk/net/hostdev devices * src/conf/domain_conf.h, src/conf/domain_conf.c, src/libvirt_private.syms: APIs for parsing/formatting address information. Also remove the QEMU specific 'pci_addr' attributes * src/qemu/qemu_driver.c: Replace use of 'pci_addr' attrs with new standardized format. --- docs/schemas/domain.rng | 55 +++-- src/conf/domain_conf.c | 420 ++++++++++++++++++++++++++++----------- src/conf/domain_conf.h | 84 ++++---- src/libvirt_private.syms | 6 + src/qemu/qemu_driver.c | 64 +++--- 5 files changed, 428 insertions(+), 201 deletions(-) diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index 566b11753c..7e00e7fe9c 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -385,6 +385,9 @@ + + +