Skip to content

xen-api: use https://mvnrepository.com/artifact/com.citrix.hypervisor/xen-api #10644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: 4.20
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/hypervisors/ovm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</parent>
<dependencies>
<dependency>
<groupId>net.java.dev.vcc.thirdparty</groupId>
<groupId>com.citrix.hypervisor</groupId>
<artifactId>xen-api</artifactId>
<version>${cs.xapi.version}</version>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion plugins/hypervisors/xenserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.java.dev.vcc.thirdparty</groupId>
<groupId>com.citrix.hypervisor</groupId>
<artifactId>xen-api</artifactId>
<version>${cs.xapi.version}</version>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ protected boolean poolHasHotFix(Connection conn, String hostIp, String hotFixUui
} catch (Exception e) {
logger.debug("Caught exception during logout", e);
}
conn.dispose();
conn = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,7 @@
nwr.nameLabel = newName;
nwr.tags = new HashSet<String>();
nwr.tags.add(generateTimeStamp());
nwr.managed = true;
vlanNetwork = Network.create(conn, nwr);
vlanNic = getNetworkByName(conn, newName);
if (vlanNic == null) { // Still vlanNic is null means we could not
Expand Down Expand Up @@ -2018,6 +2019,7 @@
// started
otherConfig.put("assume_network_is_shared", "true");
rec.otherConfig = otherConfig;
rec.managed = true;

Check warning on line 2022 in plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java#L2022

Added line #L2022 was not covered by tests
nw = Network.create(conn, rec);
logger.debug("### XenServer network for tunnels created:" + nwName);
} else {
Expand Down Expand Up @@ -4882,6 +4884,7 @@
configs.put("netmask", NetUtils.getLinkLocalNetMask());
configs.put("vswitch-disable-in-band", "true");
rec.otherConfig = configs;
rec.managed = true;

Check warning on line 4887 in plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java#L4887

Added line #L4887 was not covered by tests
linkLocal = Network.create(conn, rec);
} else {
linkLocal = networks.iterator().next();
Expand Down Expand Up @@ -5073,6 +5076,7 @@
if (networks.size() == 0) {
rec.nameDescription = "vswitch network for " + nwName;
rec.nameLabel = nwName;
rec.managed = true;

Check warning on line 5079 in plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java#L5079

Added line #L5079 was not covered by tests
vswitchNw = Network.create(conn, rec);
} else {
vswitchNw = networks.iterator().next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.cloud.utils.exception.CloudRuntimeException;
import com.xensource.xenapi.APIVersion;
import com.xensource.xenapi.Connection;
import com.xensource.xenapi.ConnectionNew;
import com.xensource.xenapi.Host;
import com.xensource.xenapi.Pool;
import com.xensource.xenapi.Session;
Expand Down Expand Up @@ -150,12 +151,12 @@
}

public Connection getConnect(String ip, String username, Queue<String> password) {
Connection conn = new Connection(getURL(ip), 10, _connWait);
Connection conn = new ConnectionNew(getURL(ip), 10, _connWait);

Check warning on line 154 in plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/XenServerConnectionPool.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/XenServerConnectionPool.java#L154

Added line #L154 was not covered by tests
try {
loginWithPassword(conn, username, password, APIVersion.latest().toString());
} catch (Types.HostIsSlave e) {
String maddress = e.masterIPAddress;
conn = new Connection(getURL(maddress), 10, _connWait);
conn = new ConnectionNew(getURL(maddress), 10, _connWait);

Check warning on line 159 in plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/XenServerConnectionPool.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/XenServerConnectionPool.java#L159

Added line #L159 was not covered by tests
try {
loginWithPassword(conn, username, password, APIVersion.latest().toString());
} catch (Exception e1) {
Expand Down Expand Up @@ -221,7 +222,7 @@

if ( mConn == null ) {
try {
Connection conn = new Connection(getURL(ipAddress), 5, _connWait);
Connection conn = new ConnectionNew(getURL(ipAddress), 5, _connWait);

Check warning on line 225 in plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/XenServerConnectionPool.java

View check run for this annotation

Codecov / codecov/patch

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/XenServerConnectionPool.java#L225

Added line #L225 was not covered by tests
Session sess = loginWithPassword(conn, username, password, APIVersion.latest().toString());
Host host = sess.getThisHost(conn);
Boolean hostenabled = host.getEnabled(conn);
Expand All @@ -231,7 +232,6 @@
} catch (Exception e) {
LOGGER.debug("Caught exception during logout", e);
}
conn.dispose();
}
if (!hostenabled) {
String msg = "Unable to create master connection, due to master Host " + ipAddress + " is not enabled";
Expand Down
Loading
Loading