Re: [PATCH 3/8] cputune: Add data structures presenting cputune xml

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ä 2011å03æ29æ 15:35, Daniel Veillard åé:
On Tue, Mar 29, 2011 at 02:32:21PM +0800, Osier Yang wrote:
Also related new functions' declaration.
---
  src/conf/domain_conf.h   |   26 ++++++++++++++++++++++++++
  src/libvirt_private.syms |    4 ++++
  2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 1e8223f..10e73cb 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1029,6 +1029,21 @@ void virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots,
  int virDomainSnapshotHasChildren(virDomainSnapshotObjPtr snap,
                                  virDomainSnapshotObjListPtr snapshots);

+typedef struct _virDomainVcpupinDef virDomainVcpupinDef;
+typedef virDomainVcpupinDef *virDomainVcpupinDefPtr;
+struct _virDomainVcpupinDef {
+    int vcpuid;
+    char *cpumask;
+};
+
+int virDomainVcpupinIsDuplicate(virDomainVcpupinDefPtr *def,
+                                int nvcpupin,
+                                int vcpu);
+
+virDomainVcpupinDefPtr virDomainVcpupinFindByVcpu(virDomainVcpupinDefPtr *def,
+                                                  int nvcpupin,
+                                                  int vcpu);
+
  /* Guest VM main configuration */
  typedef struct _virDomainDef virDomainDef;
  typedef virDomainDef *virDomainDefPtr;
@@ -1057,6 +1072,12 @@ struct _virDomainDef {
      int cpumasklen;
      char *cpumask;

+    struct {
+        unsigned long shares;
+        int nvcpupin;
+        virDomainVcpupinDefPtr *vcpupin;
+    } cputune;
+
      /* These 3 are based on virDomainLifeCycleAction enum flags */
      int onReboot;
      int onPoweroff;
@@ -1256,6 +1277,11 @@ int virDomainCpuSetParse(const char **str,
  char *virDomainCpuSetFormat(char *cpuset,
                              int maxcpu);

+int virDomainVcpupinAdd(virDomainDefPtr def,
+                        unsigned char *cpumap,
+                        int maplen,
+                        int vcpu);
+
  int virDomainDiskInsert(virDomainDefPtr def,
                          virDomainDiskDefPtr disk);
  void virDomainDiskInsertPreAlloced(virDomainDefPtr def,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index b1a357b..d32bd42 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -320,6 +320,9 @@ virDomainTimerTickpolicyTypeFromString;
  virDomainTimerTickpolicyTypeToString;
  virDomainTimerTrackTypeFromString;
  virDomainTimerTrackTypeToString;
+virDomainVcpupinAdd;
+virDomainVcpupinFindByVcpu;
+virDomainVcpupinIsDuplicate;
  virDomainVideoDefFree;
  virDomainVideoDefaultRAM;
  virDomainVideoDefaultType;

Okay up to there, except my problem with shares,

@@ -576,6 +579,7 @@ virVMOperationTypeToString;
  # memory.h
  virAlloc;
  virAllocN;
+virAllocVar;
  virExpandN;
  virFree;
  virReallocN;

   That looks unrelated and bogus :-)

Oh, I forget to explain this, I used "VIR_ALLOC_VAR" somewhere
in the patches. So expose it here, will update the patch
description to add explaination for it.


Daniel


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]