diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a5afacfbb502cb74d43b5dfbfa0731d53b20cfb5..b38021d0f9b25a97599a91dd3d040bcfe6a5c520 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1193,7 +1193,7 @@ virDomainDiskSourcePoolDefFree(virStorageSourcePoolDefPtr def) static void -virDomainDiskSourceDefClear(virDomainDiskSourceDefPtr def) +virDomainDiskSourceDefClear(virStorageSourcePtr def) { size_t i; @@ -1237,7 +1237,7 @@ virDomainDiskDefFree(virDomainDiskDefPtr def) void -virDomainDiskAuthClear(virDomainDiskSourceDefPtr def) +virDomainDiskAuthClear(virStorageSourcePtr def) { VIR_FREE(def->auth.username); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 52b59a1d0cc70aa075788569a9a45923cc48bd5a..b011847ed4bcaf5603fa13666a439cb127962077 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -595,38 +595,10 @@ struct _virDomainBlockIoTuneInfo { }; typedef virDomainBlockIoTuneInfo *virDomainBlockIoTuneInfoPtr; -typedef struct _virDomainDiskSourceDef virDomainDiskSourceDef; -typedef virDomainDiskSourceDef *virDomainDiskSourceDefPtr; - -/* Stores information related to a host resource. In the case of - * backing chains, multiple source disks join to form a single guest - * view. TODO Move this to util/ */ -struct _virDomainDiskSourceDef { - int type; /* enum virStorageType */ - char *path; - int protocol; /* enum virStorageNetProtocol */ - size_t nhosts; - virStorageNetHostDefPtr hosts; - virStorageSourcePoolDefPtr srcpool; - struct { - char *username; - int secretType; /* enum virStorageSecretType */ - union { - unsigned char uuid[VIR_UUID_BUFLEN]; - char *usage; - } secret; - } auth; - virStorageEncryptionPtr encryption; - char *driverName; - int format; /* enum virStorageFileFormat */ - - size_t nseclabels; - virSecurityDeviceLabelDefPtr *seclabels; -}; /* Stores the virtual disk configuration */ struct _virDomainDiskDef { - virDomainDiskSourceDef src; + virStorageSource src; int device; /* enum virDomainDiskDevice */ int bus; /* enum virDomainDiskBus */ @@ -2153,7 +2125,7 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def); void virDomainInputDefFree(virDomainInputDefPtr def); void virDomainDiskDefFree(virDomainDiskDefPtr def); void virDomainLeaseDefFree(virDomainLeaseDefPtr def); -void virDomainDiskAuthClear(virDomainDiskSourceDefPtr def); +void virDomainDiskAuthClear(virStorageSourcePtr def); int virDomainDiskGetType(virDomainDiskDefPtr def); void virDomainDiskSetType(virDomainDiskDefPtr def, int type); int virDomainDiskGetActualType(virDomainDiskDefPtr def); diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 68172c80f095281a66161c261406081ca8b12179..a6dcfa46ecc398ec4db8aa967ff655b7400b970a 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -25,6 +25,8 @@ # define __VIR_STORAGE_FILE_H__ # include "virbitmap.h" +# include "virseclabel.h" +# include "virstorageencryption.h" # include "virutil.h" /* Minimum header size required to probe all known formats with @@ -182,6 +184,36 @@ enum virStorageSecretType { }; +typedef struct _virStorageSource virStorageSource; +typedef virStorageSource *virStorageSourcePtr; + +/* Stores information related to a host resource. In the case of + * backing chains, multiple source disks join to form a single guest + * view. */ +struct _virStorageSource { + int type; /* enum virStorageType */ + char *path; + int protocol; /* enum virStorageNetProtocol */ + size_t nhosts; + virStorageNetHostDefPtr hosts; + virStorageSourcePoolDefPtr srcpool; + struct { + char *username; + int secretType; /* enum virStorageSecretType */ + union { + unsigned char uuid[VIR_UUID_BUFLEN]; + char *usage; + } secret; + } auth; + virStorageEncryptionPtr encryption; + char *driverName; + int format; /* enum virStorageFileFormat */ + + size_t nseclabels; + virSecurityDeviceLabelDefPtr *seclabels; +}; + + # ifndef DEV_BSIZE # define DEV_BSIZE 512 # endif diff --git a/tools/Makefile.am b/tools/Makefile.am index 6847f13cb82d88013a7f33902a4d84ccc1217b0f..93d642da67e368b21a465ecc09785dd2f1d2df1a 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -148,6 +148,7 @@ virt_host_validate_LDADD = \ $(NULL) virt_host_validate_CFLAGS = \ + $(LIBXML_CFLAGS) \ $(WARN_CFLAGS) \ $(PIE_CFLAGS) \ $(COVERAGE_CFLAGS) \ @@ -173,6 +174,7 @@ virt_login_shell_LDADD = \ virt_login_shell_CFLAGS = \ -DLIBVIRT_SETUID_RPC_CLIENT \ + $(LIBXML_CFLAGS) \ $(WARN_CFLAGS) \ $(PIE_CFLAGS) \ $(COVERAGE_CFLAGS)