@@ -48,8 +48,18 @@ public String getHost() {
4848 long memory ;
4949 long dom0MinMemory ;
5050 boolean poolSync ;
51+
52+ // VM power state report is added in a side-by-side way as old VM state report
53+ // this is to allow a graceful migration from the old VM state sync model to the new model
54+ //
55+ // side-by-side addition of power state sync
56+ Map <String , HostVmStateReportEntry > _hostVmStateReport ;
57+
58+ // TODO vmsync
59+ // deprecated, will delete after full replacement
5160 Map <String , VmState > vms ;
5261 HashMap <String , Ternary <String , State , String >> _clusterVMStates ;
62+
5363 String caps ;
5464 String pool ;
5565 HypervisorType hypervisorType ;
@@ -70,8 +80,10 @@ public StartupRoutingCommand(int cpus,
7080 String caps ,
7181 HypervisorType hypervisorType ,
7282 RouterPrivateIpStrategy privIpStrategy ,
73- Map <String , VmState > vms ) {
74- this (cpus , speed , memory , dom0MinMemory , caps , hypervisorType , vms );
83+ Map <String , VmState > vms ,
84+ Map <String , HostVmStateReportEntry > hostVmStateReport
85+ ) {
86+ this (cpus , speed , memory , dom0MinMemory , caps , hypervisorType , vms , hostVmStateReport );
7587 getHostDetails ().put (RouterPrivateIpStrategy .class .getCanonicalName (), privIpStrategy .toString ());
7688 }
7789
@@ -82,9 +94,11 @@ public StartupRoutingCommand(int cpus,
8294 String caps ,
8395 HypervisorType hypervisorType ,
8496 RouterPrivateIpStrategy privIpStrategy ) {
85- this (cpus , speed , memory , dom0MinMemory , caps , hypervisorType , new HashMap <String ,String >(), new HashMap <String , VmState >());
86- getHostDetails ().put (RouterPrivateIpStrategy .class .getCanonicalName (), privIpStrategy .toString ());
87- }
97+ this (cpus , speed , memory , dom0MinMemory , caps , hypervisorType , new HashMap <String ,String >(),
98+ new HashMap <String , VmState >(), new HashMap <String , HostVmStateReportEntry >());
99+
100+ getHostDetails ().put (RouterPrivateIpStrategy .class .getCanonicalName (), privIpStrategy .toString ());
101+ }
88102
89103 public StartupRoutingCommand (int cpus ,
90104 long speed ,
@@ -93,13 +107,15 @@ public StartupRoutingCommand(int cpus,
93107 final String caps ,
94108 final HypervisorType hypervisorType ,
95109 final Map <String , String > hostDetails ,
96- Map <String , VmState > vms ) {
110+ Map <String , VmState > vms ,
111+ Map <String , HostVmStateReportEntry > hostVmStateReport ) {
97112 super (Host .Type .Routing );
98113 this .cpus = cpus ;
99114 this .speed = speed ;
100115 this .memory = memory ;
101116 this .dom0MinMemory = dom0MinMemory ;
102117 this .vms = vms ;
118+ this ._hostVmStateReport = hostVmStateReport ;
103119 this .hypervisorType = hypervisorType ;
104120 this .hostDetails = hostDetails ;
105121 this .caps = caps ;
@@ -108,12 +124,14 @@ public StartupRoutingCommand(int cpus,
108124
109125 public StartupRoutingCommand (int cpus2 , long speed2 , long memory2 ,
110126 long dom0MinMemory2 , String caps2 , HypervisorType hypervisorType2 ,
111- Map <String , VmState > vms2 ) {
112- this (cpus2 , speed2 , memory2 , dom0MinMemory2 , caps2 , hypervisorType2 , new HashMap <String ,String >(), vms2 );
127+ Map <String , VmState > vms2 , Map <String , HostVmStateReportEntry > hostVmStateReport
128+ ) {
129+ this (cpus2 , speed2 , memory2 , dom0MinMemory2 , caps2 , hypervisorType2 , new HashMap <String ,String >(), vms2 , hostVmStateReport );
113130 }
114131
115- public StartupRoutingCommand (int cpus , long speed , long memory , long dom0MinMemory , final String caps , final HypervisorType hypervisorType , final Map <String , String > hostDetails , Map <String , VmState > vms , String hypervisorVersion ) {
116- this (cpus , speed , memory , dom0MinMemory , caps , hypervisorType , hostDetails , vms );
132+ public StartupRoutingCommand (int cpus , long speed , long memory , long dom0MinMemory , final String caps , final HypervisorType hypervisorType , final Map <String , String > hostDetails ,
133+ Map <String , VmState > vms , Map <String , HostVmStateReportEntry > vmPowerStates , String hypervisorVersion ) {
134+ this (cpus , speed , memory , dom0MinMemory , caps , hypervisorType , hostDetails , vms , vmPowerStates );
117135 this .hypervisorVersion = hypervisorVersion ;
118136 }
119137
@@ -229,5 +247,13 @@ public String getHypervisorVersion() {
229247 public void setHypervisorVersion (String hypervisorVersion ) {
230248 this .hypervisorVersion = hypervisorVersion ;
231249 }
250+
251+ public Map <String , HostVmStateReportEntry > getHostVmStateReport () {
252+ return this ._hostVmStateReport ;
253+ }
254+
255+ public void setHostVmStateReport (Map <String , HostVmStateReportEntry > hostVmStateReport ) {
256+ this ._hostVmStateReport = hostVmStateReport ;
257+ }
232258}
233259
0 commit comments