File tree Expand file tree Collapse file tree
engine/storage/src/org/apache/cloudstack/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424import com .cloud .configuration .Config ;
2525import com .cloud .configuration .dao .ConfigurationDao ;
2626import com .cloud .configuration .dao .ConfigurationDaoImpl ;
27+ import com .cloud .utils .component .ComponentContext ;
2728import org .apache .cloudstack .engine .subsystem .api .storage .EndPoint ;
2829import org .apache .cloudstack .framework .async .AsyncCompletionCallback ;
2930import org .apache .cloudstack .storage .command .CopyCommand ;
@@ -56,6 +57,11 @@ public LocalHostEndpoint() {
5657 executor = Executors .newScheduledThreadPool (10 );
5758 }
5859
60+ public static EndPoint getEndpoint () {
61+ LocalHostEndpoint endpoint = ComponentContext .inject (LocalHostEndpoint .class );
62+ return endpoint ;
63+ }
64+
5965 @ Override
6066 public long getId () {
6167 // TODO Auto-generated method stub
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ protected EndPoint findEndpointForImageStorage(DataStore store) {
191191 // we can arbitrarily pick one ssvm to do that task
192192 List <HostVO > ssAHosts = listUpAndConnectingSecondaryStorageVmHost (dcId );
193193 if (ssAHosts == null || ssAHosts .isEmpty ()) {
194- return new LocalHostEndpoint (); // use local host as endpoint in
194+ return LocalHostEndpoint . getEndpoint (); // use local host as endpoint in
195195 // case of no ssvm existing
196196 }
197197 Collections .shuffle (ssAHosts );
You can’t perform that action at this time.
0 commit comments