[libvirt] [RFC PATCH 2/4] Extend the domain internal structure to manage dependency devices

Valentin BOUSSON v.bousson at virtualopensystems.com
Wed Mar 23 08:55:20 UTC 2016


A new field has been added in the internal domain definition
(virDomainDeviceDef), in order to store the list of dependencies a domain
refers to.

The informations stored about one dependency are:
    - the absolute path of the XML description
    - the name of the domain

These informations are needed to propagate different signals across the
dependency relation.

---
 src/conf/domain_conf.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 85c4f55..d0b3333 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -136,6 +136,9 @@ typedef virDomainPanicDef *virDomainPanicDefPtr;
 typedef struct _virDomainMemoryDef virDomainMemoryDef;
 typedef virDomainMemoryDef *virDomainMemoryDefPtr;
 
+typedef struct _virDomainDependencyDef virDomainDependencyDef;
+typedef virDomainDependencyDef *virDomainDependencyDefPtr;
+
 /* forward declarations virDomainChrSourceDef, required by
  * virDomainNetDef
  */
@@ -204,6 +207,7 @@ struct _virDomainDeviceDef {
         virDomainTPMDefPtr tpm;
         virDomainPanicDefPtr panic;
         virDomainMemoryDefPtr memory;
+        virDomainDependencyDefPtr dependency;
     } data;
 };
 
@@ -2042,6 +2046,15 @@ struct _virDomainMemoryDef {
 
 void virDomainMemoryDefFree(virDomainMemoryDefPtr def);
 
+struct _virDomainDependencyDef {
+    char *filePath;
+
+    unsigned char domainUuid[VIR_UUID_BUFLEN];
+    char *domainName;
+
+    virDomainDeviceInfo info;
+};
+
 struct _virDomainIdMapEntry {
     unsigned int start;
     unsigned int target;
@@ -2300,6 +2313,9 @@ struct _virDomainDef {
     size_t nseclabels;
     virSecurityLabelDefPtr *seclabels;
 
+    size_t ndomaindependencies;
+    virDomainDependencyDefPtr *domaindependencies;
+
     size_t nrngs;
     virDomainRNGDefPtr *rngs;
 
-- 
1.9.1




More information about the libvir-list mailing list