Skip to content

Commit 296b49c

Browse files
committed
Merge branch 'master' into test-merge-api
Conflicts: api/src/com/cloud/agent/api/BackupSnapshotCommand.java api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java api/src/com/cloud/network/NetworkService.java api/src/com/cloud/resource/ResourceService.java api/src/org/apache/cloudstack/api/ApiConstants.java api/src/org/apache/cloudstack/api/ResponseGenerator.java api/src/org/apache/cloudstack/api/response/SSHKeyPairResponse.java client/tomcatconf/commands.properties.in core/src/com/cloud/storage/SnapshotVO.java pom.xml server/src/com/cloud/api/ApiDispatcher.java server/src/com/cloud/api/ApiResponseHelper.java server/src/com/cloud/api/ApiServer.java server/src/com/cloud/configuration/ConfigurationManagerImpl.java server/src/com/cloud/network/NetworkManagerImpl.java server/src/com/cloud/network/rules/RulesManagerImpl.java server/src/com/cloud/offerings/NetworkOfferingVO.java server/src/com/cloud/resource/ResourceManagerImpl.java server/src/com/cloud/upgrade/dao/Upgrade40to41.java server/src/com/cloud/vm/UserVmManagerImpl.java server/test/com/cloud/vpc/MockNetworkManagerImpl.java setup/db/create-schema.sql setup/db/db/schema-40to410.sql Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2 parents 38225a1 + f0c3b4c commit 296b49c

404 files changed

Lines changed: 21921 additions & 7919 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ awsapi/modules/*
6767
.settings/
6868
db.properties.override
6969
awsapi/overlays/
70+
tools/marvin/marvin/cloudstackAPI/*
7071
*.egg-info/
7172
docs/tmp
7273
docs/publish
7374
docs/runbook/tmp
7475
docs/runbook/publish
76+
Gemfile.lock

LICENSE

Lines changed: 1725 additions & 1749 deletions
Large diffs are not rendered by default.

NOTICE

Lines changed: 76 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,84 @@
66

77

88

9-
This distribution contains third party resources requiring the following notices:
9+
Source code distribution if this software contains third party resources requiring
10+
the following notices:
1011

1112

13+
For
14+
jquery.md5.js
15+
16+
17+
jQuery MD5 Plugin 1.2.1
18+
https://github.com/blueimp/jQuery-MD5
19+
20+
Copyright 2010, Sebastian Tschan
21+
https://blueimp.net
22+
23+
Licensed under the MIT license:
24+
http://creativecommons.org/licenses/MIT/
25+
26+
Based on
27+
A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
28+
Digest Algorithm, as defined in RFC 1321.
29+
Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
30+
Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
31+
Distributed under the BSD License
32+
See http://pajhome.org.uk/crypt/md5 for more info.
33+
34+
35+
For
36+
jquery.js
37+
38+
39+
jQuery JavaScript Library v1.3.2
40+
http://jquery.com/
41+
42+
Copyright (c) 2009 John Resig
43+
Dual licensed under the MIT and GPL licenses.
44+
http://docs.jquery.com/License
45+
46+
Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
47+
Revision: 6246
48+
49+
50+
For
51+
jquery.js
52+
53+
54+
jQuery JavaScript Library v1.6.1
55+
http://jquery.com/
56+
57+
Copyright 2011, John Resig
58+
Dual licensed under the MIT or GPL Version 2 licenses.
59+
http://jquery.org/license
60+
61+
Includes Sizzle.js
62+
http://sizzlejs.com/
63+
Copyright 2011, The Dojo Foundation
64+
Released under the MIT, BSD, and GPL Licenses.
65+
66+
Date: Thu May 12 15:04:36 2011 -0400
67+
68+
69+
For
70+
jquery.colorhelpers.js
71+
72+
73+
Plugin for jQuery for working with colors.
74+
75+
Version 1.1.
76+
77+
Inspiration from jQuery color animation plugin by John Resig.
78+
79+
Released under the MIT license by Ole Laursen, October 2009.
80+
81+
82+
********************************************************************************
83+
84+
Binary or packaged versions of this software (including versions built from source)
85+
contains third party resources requiring the following notices:
86+
1287
For
1388
cloud-ejb-api-3.0.jar
1489
cloud-email.jar
@@ -337,28 +412,6 @@
337412
without prior written authorization of the copyright holder.
338413

339414

340-
For
341-
jquery.md5.js
342-
343-
344-
jQuery MD5 Plugin 1.2.1
345-
https://github.com/blueimp/jQuery-MD5
346-
347-
Copyright 2010, Sebastian Tschan
348-
https://blueimp.net
349-
350-
Licensed under the MIT license:
351-
http://creativecommons.org/licenses/MIT/
352-
353-
Based on
354-
A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
355-
Digest Algorithm, as defined in RFC 1321.
356-
Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
357-
Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
358-
Distributed under the BSD License
359-
See http://pajhome.org.uk/crypt/md5 for more info.
360-
361-
362415
For
363416
XmlSchema-1.4.3.jar
364417

@@ -430,21 +483,6 @@
430483
THE SOFTWARE.
431484

432485

433-
For
434-
jquery.js
435-
436-
437-
jQuery JavaScript Library v1.3.2
438-
http://jquery.com/
439-
440-
Copyright (c) 2009 John Resig
441-
Dual licensed under the MIT and GPL licenses.
442-
http://docs.jquery.com/License
443-
444-
Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
445-
Revision: 6246
446-
447-
448486
For
449487
axis2-1.5.1.jar
450488
axis2-adb-1.5.1.jar
@@ -532,25 +570,6 @@
532570
--------------------------------------------------------------------------------
533571

534572

535-
For
536-
jquery.js
537-
538-
539-
jQuery JavaScript Library v1.6.1
540-
http://jquery.com/
541-
542-
Copyright 2011, John Resig
543-
Dual licensed under the MIT or GPL Version 2 licenses.
544-
http://jquery.org/license
545-
546-
Includes Sizzle.js
547-
http://sizzlejs.com/
548-
Copyright 2011, The Dojo Foundation
549-
Released under the MIT, BSD, and GPL Licenses.
550-
551-
Date: Thu May 12 15:04:36 2011 -0400
552-
553-
554573
For
555574
rampart-lib
556575

@@ -588,19 +607,6 @@
588607
software copyright (c) 1999.
589608

590609

591-
For
592-
jquery.colorhelpers.js
593-
594-
595-
Plugin for jQuery for working with colors.
596-
597-
Version 1.1.
598-
599-
Inspiration from jQuery color animation plugin by John Resig.
600-
601-
Released under the MIT license by Ole Laursen, October 2009.
602-
603-
604610
For
605611
woden-api-1.0M8.jar
606612
woden-impl-dom-1.0M8.jar

agent/src/com/cloud/agent/AgentShell.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ public static void wget(String url, File file) throws IOException {
231231
int response;
232232
response = client.executeMethod(method);
233233
if (response != HttpURLConnection.HTTP_OK) {
234+
method.releaseConnection();
234235
s_logger.warn("Retrieving from " + url + " gives response code: "
235236
+ response);
236237
throw new CloudRuntimeException("Unable to download from " + url
@@ -253,6 +254,7 @@ public static void wget(String url, File file) throws IOException {
253254
s_logger.warn("Exception while closing download stream from "
254255
+ url + ", ", e);
255256
}
257+
method.releaseConnection();
256258
}
257259

258260
private void loadProperties() throws ConfigurationException {

api/src/com/cloud/agent/api/BackupSnapshotCommand.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.cloud.agent.api;
1818

1919
import com.cloud.agent.api.LogLevel.Log4jLevel;
20+
import com.cloud.agent.api.to.S3TO;
2021
import com.cloud.agent.api.to.StorageFilerTO;
2122
import com.cloud.agent.api.to.SwiftTO;
2223
import com.cloud.storage.StoragePool;
@@ -32,6 +33,7 @@ public class BackupSnapshotCommand extends SnapshotCommand {
3233
private Long snapshotId;
3334
@LogLevel(Log4jLevel.Off)
3435
private SwiftTO swift;
36+
private S3TO s3;
3537
StorageFilerTO pool;
3638

3739
protected BackupSnapshotCommand() {
@@ -48,8 +50,7 @@ protected BackupSnapshotCommand() {
4850
* @param isFirstSnapshotOfRootVolume true if this is the first snapshot of a root volume. Set the parent of the backup to null.
4951
* @param isVolumeInactive True if the volume belongs to a VM that is not running or is detached.
5052
*/
51-
public BackupSnapshotCommand(String primaryStoragePoolNameLabel,
52-
String secondaryStoragePoolURL,
53+
public BackupSnapshotCommand(String secondaryStoragePoolURL,
5354
Long dcId,
5455
Long accountId,
5556
Long volumeId,
@@ -64,13 +65,12 @@ public BackupSnapshotCommand(String primaryStoragePoolNameLabel,
6465
String vmName,
6566
int wait)
6667
{
67-
super(primaryStoragePoolNameLabel, secondaryStoragePoolURL, snapshotUuid, snapshotName, dcId, accountId, volumeId);
68+
super(pool, secondaryStoragePoolURL, snapshotUuid, snapshotName, dcId, accountId, volumeId);
6869
this.snapshotId = snapshotId;
6970
this.prevSnapshotUuid = prevSnapshotUuid;
7071
this.prevBackupUuid = prevBackupUuid;
7172
this.isVolumeInactive = isVolumeInactive;
7273
this.vmName = vmName;
73-
this.pool = new StorageFilerTO(pool);
7474
setVolumePath(volumePath);
7575
setWait(wait);
7676
}
@@ -88,7 +88,7 @@ public boolean isVolumeInactive() {
8888
}
8989

9090
public String getVmName() {
91-
return vmName;
91+
return vmName;
9292
}
9393

9494
public SwiftTO getSwift() {
@@ -99,6 +99,14 @@ public void setSwift(SwiftTO swift) {
9999
this.swift = swift;
100100
}
101101

102+
public S3TO getS3() {
103+
return s3;
104+
}
105+
106+
public void setS3(S3TO s3) {
107+
this.s3 = s3;
108+
}
109+
102110
public Long getSnapshotId() {
103111
return snapshotId;
104112
}

api/src/com/cloud/agent/api/CreatePrivateTemplateFromSnapshotCommand.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// under the License.
1717
package com.cloud.agent.api;
1818

19+
import com.cloud.storage.StoragePool;
20+
1921
/**
2022
* This currently assumes that both primary and secondary storage are mounted on the XenServer.
2123
*/
@@ -40,7 +42,8 @@ protected CreatePrivateTemplateFromSnapshotCommand() {
4042
* It may not be the UUID of the base copy of the snapshot, if no data was written since last snapshot.
4143
* @param origTemplateInstallPath The install path of the original template VHD on the secondary
4244
*/
43-
public CreatePrivateTemplateFromSnapshotCommand(String primaryStoragePoolNameLabel,
45+
46+
public CreatePrivateTemplateFromSnapshotCommand(StoragePool pool,
4447
String secondaryStoragePoolURL,
4548
Long dcId,
4649
Long accountId,
@@ -52,7 +55,7 @@ public CreatePrivateTemplateFromSnapshotCommand(String primaryStoragePoolNameLab
5255
String templateName,
5356
int wait)
5457
{
55-
super(primaryStoragePoolNameLabel, secondaryStoragePoolURL, backedUpSnapshotUuid, backedUpSnapshotName, dcId, accountId, volumeId);
58+
super(pool, secondaryStoragePoolURL, backedUpSnapshotUuid, backedUpSnapshotName, dcId, accountId, volumeId);
5659
this.origTemplateInstallPath = origTemplateInstallPath;
5760
this.newTemplateId = newTemplateId;
5861
this.templateName = templateName;

api/src/com/cloud/agent/api/CreatePrivateTemplateFromVolumeCommand.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,33 @@
1616
// under the License.
1717
package com.cloud.agent.api;
1818

19+
import com.cloud.agent.api.to.StorageFilerTO;
20+
import com.cloud.storage.StoragePool;
21+
1922
public class CreatePrivateTemplateFromVolumeCommand extends SnapshotCommand {
2023
private String _vmName;
2124
private String _volumePath;
2225
private String _userSpecifiedName;
2326
private String _uniqueName;
2427
private long _templateId;
2528
private long _accountId;
29+
StorageFilerTO _primaryPool;
2630
// For XenServer
2731
private String _secondaryStorageUrl;
2832

2933
public CreatePrivateTemplateFromVolumeCommand() {
3034
}
3135

32-
public CreatePrivateTemplateFromVolumeCommand(String StoragePoolUUID, String secondaryStorageUrl, long templateId, long accountId, String userSpecifiedName, String uniqueName, String volumePath, String vmName, int wait) {
36+
public CreatePrivateTemplateFromVolumeCommand(StoragePool pool, String secondaryStorageUrl, long templateId, long accountId, String userSpecifiedName, String uniqueName, String volumePath, String vmName, int wait) {
3337
_secondaryStorageUrl = secondaryStorageUrl;
3438
_templateId = templateId;
3539
_accountId = accountId;
3640
_userSpecifiedName = userSpecifiedName;
3741
_uniqueName = uniqueName;
3842
_volumePath = volumePath;
3943
_vmName = vmName;
40-
primaryStoragePoolNameLabel = StoragePoolUUID;
44+
primaryStoragePoolNameLabel = pool.getUuid();
45+
_primaryPool = new StorageFilerTO(pool);
4146
setWait(wait);
4247
}
4348

@@ -46,6 +51,10 @@ public boolean executeInSequence() {
4651
return false;
4752
}
4853

54+
public StorageFilerTO getPool() {
55+
return _primaryPool;
56+
}
57+
4958
public String getSecondaryStorageUrl() {
5059
return _secondaryStorageUrl;
5160
}

api/src/com/cloud/agent/api/CreateVolumeFromSnapshotCommand.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// under the License.
1717
package com.cloud.agent.api;
1818

19+
import com.cloud.storage.StoragePool;
20+
1921
/**
2022
* This currently assumes that both primary and secondary storage are mounted on the XenServer.
2123
*/
@@ -39,7 +41,8 @@ protected CreateVolumeFromSnapshotCommand() {
3941
* It may not be the UUID of the base copy of the snapshot, if no data was written since last snapshot.
4042
* @param templatePath The install path of the template VHD on the secondary, if this a root volume
4143
*/
42-
public CreateVolumeFromSnapshotCommand(String primaryStoragePoolNameLabel,
44+
45+
public CreateVolumeFromSnapshotCommand(StoragePool pool,
4346
String secondaryStoragePoolURL,
4447
Long dcId,
4548
Long accountId,
@@ -48,7 +51,7 @@ public CreateVolumeFromSnapshotCommand(String primaryStoragePoolNameLabel,
4851
String backedUpSnapshotName,
4952
int wait)
5053
{
51-
super(primaryStoragePoolNameLabel, secondaryStoragePoolURL, backedUpSnapshotUuid, backedUpSnapshotName, dcId, accountId, volumeId);
54+
super(pool, secondaryStoragePoolURL, backedUpSnapshotUuid, backedUpSnapshotName, dcId, accountId, volumeId);
5255
setWait(wait);
5356
}
5457
}

0 commit comments

Comments
 (0)