Skip to content
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

Backport NPE fixes #852

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
996c08f
Fix limiting GWT resources during RPM build
mwperina Sep 30, 2022
fb07222
Skip validation of build environment
mwperina Oct 4, 2022
116ed20
Increase GWT localWorkers to 2
mwperina Oct 5, 2022
2adc535
core: add callback to RemoveDiskCommand
mkemel Oct 24, 2022
f70688f
build: ovirt-engine-4.5.3.2
mwperina Oct 26, 2022
0b54a45
build: post ovirt-engine-4.5.3.2
mwperina Oct 26, 2022
c8d5ddc
Remove apache-commons-jxpath dependency
mwperina Oct 21, 2022
584160b
add sudo for non-root automation builds
michalskrivanek Nov 2, 2022
09bb735
core: Add missing items in VmManagementParametersBase copy constructor
mz-pdm Oct 6, 2022
a7633b7
frontend: Add TPM parameter when cloning a VM from a snapshot
mz-pdm Oct 6, 2022
0089bdf
core: Update TPM device in parameters
mz-pdm Oct 25, 2022
0140945
Create rhv-build (#725)
michalskrivanek Nov 2, 2022
087b27f
Rename rhv-build to rhv-build.yaml
michalskrivanek Nov 2, 2022
88f5e1a
Update rhv-build.yaml
michalskrivanek Nov 2, 2022
bd8ae93
Update rhv-build.yaml
michalskrivanek Nov 2, 2022
99e6295
Update rhv-build.yaml
michalskrivanek Nov 2, 2022
5824965
Update rhv-build.yaml
michalskrivanek Nov 2, 2022
230c5e9
Update rhv-build.yaml
michalskrivanek Nov 2, 2022
b5a3d5a
Update rhv-build.yaml
michalskrivanek Nov 2, 2022
52fff1c
Update rhv-build.yaml
michalskrivanek Nov 2, 2022
6536fa9
core: fail storage domain attach if getImagesList fails
bennyz Nov 2, 2022
2b9f47d
core: fix monitoring of RemoveVm
ahadas Nov 2, 2022
7479235
build: fix rpm release names for snapshot builds
michalskrivanek Nov 8, 2022
894ae2e
build: fix return code when SUFFIX is empty
michalskrivanek Nov 9, 2022
3af61ab
build: ovirt-engine-4.5.3.3
mwperina Nov 9, 2022
53bf827
build: post ovirt-engine-4.5.3.3
mwperina Nov 9, 2022
55911c0
core: prevent duplicate audit logs for ReduceImage
ahadas Nov 9, 2022
22a6f93
core: Imported VM missing in OVFSTORE
ArtiomDivak Nov 9, 2022
b965428
build: ovirt-engine-4.5.3.4
mwperina Nov 16, 2022
34f8d07
build: post ovirt-engine-4.5.3.4
mwperina Nov 16, 2022
2fc4d05
Bump apache-sshd to 2.9.2
mwperina Nov 16, 2022
60d6764
Use correct ovirt-engine-build-dependencies version
mwperina Nov 24, 2022
f7edcd3
Revert "packaging: move selinux from ovirt-engine-common to ovirt-eng…
didib Nov 30, 2022
c883510
Search correctly entities with user role (#766)
emesika Dec 5, 2022
2404865
build: ovirt-engine-4.5.3.5
mwperina Dec 5, 2022
b949613
build: post ovirt-engine-4.5.3.5
mwperina Dec 5, 2022
e98a41a
core: fix execution of RemoveImage
ahadas Dec 4, 2022
decf569
core: fix async task-less execution of remove-image
ahadas Dec 4, 2022
97c5d2d
Fix EL9 build complaining about git unsafe directory
mwperina Jan 5, 2023
cacd843
fix setting value to engine config properties
dangel101 Jan 4, 2023
53b62cf
executing ansible runner artifacts clean up with fixed delay
dangel101 Jan 1, 2023
9e5bfdb
build: ovirt-engine-4.5.3.6
mwperina Jan 25, 2023
f21a4b1
build: post ovirt-engine-4.5.3.6
mwperina Jan 25, 2023
fbdcebf
add debug logging to AnsibleRunnerCleanUpService
dangel101 Dec 19, 2022
d9e3e93
add debug info
dangel101 Feb 7, 2023
982b9cd
Don't stop clean up when a file cannot be removed
mwperina Feb 8, 2023
1898c9e
build: ovirt-engine-4.5.3.7
michalskrivanek Feb 9, 2023
9d0405b
build: post ovirt-engine-4.5.3.7
michalskrivanek Feb 9, 2023
f4a8f22
webadmin: avoid NPE on null rx, tx drops
erav Apr 16, 2023
07e2608
core: fix NPE when picking host for transfer-image
ahadas May 20, 2023
39f3a78
Avoid NPE on refreshlun call without plugged VMs
lszomor May 19, 2023
0870417
core: simplify SyncDirectLunsCommand#getPluggedVms
ahadas May 21, 2023
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
4 changes: 2 additions & 2 deletions .automation/build-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source $(dirname "$(readlink -f "$0")")/build-srpm.sh

# Install build dependencies
dnf builddep -y rpmbuild/SRPMS/*src.rpm
$([ "$EUID" -eq 0 ] || echo /usr/bin/sudo) dnf builddep -y rpmbuild/SRPMS/*src.rpm

# Perform reasonable quick build with unit tests execution
BUILD_UT=1
Expand All @@ -14,7 +14,7 @@ BUILD_LOCALES=0
rpmbuild \
-D "_topmdir rpmbuild" \
-D "_rpmdir rpmbuild" \
${RELEASE:+-D "release_suffix ${RELEASE}"} \
${SUFFIX:+-D "release_suffix ${SUFFIX}"} \
-D "ovirt_build_ut ${BUILD_UT}" \
-D "ovirt_build_all_user_agents ${BUILD_ALL_USER_AGENTS}" \
-D "ovirt_build_locales ${BUILD_LOCALES}" \
Expand Down
20 changes: 7 additions & 13 deletions .automation/build-srpm.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
#!/bin/bash -xe

# git hash of current commit should be passed as the 1st paraameter
if [ "${GITHUB_SHA}" == "" ]; then
GIT_HASH=$(git rev-list HEAD | wc -l)
else
GIT_HASH=$(git rev-parse --short $GITHUB_SHA)
fi
# Mark current directory as safe for git to be able to parse git hash
git config --global --add safe.directory $(pwd)

# git hash of current commit passed from GitHub or HEAD
GIT_HASH=$(git rev-parse --short ${GITHUB_SHA:-HEAD})
SUFFIX=$(grep -E "<version" pom.xml | head -n1 | awk -F '[<>]' '/version/{print $3}' | grep -q -- -SNAPSHOT && echo .git${GIT_HASH} || :)

# Directory, where build artifacts will be stored, should be passed as the 1st parameter
ARTIFACTS_DIR=${1:-exported-artifacts}

# Prepare the version string (with support for SNAPSHOT versioning)
VERSION=$(mvn help:evaluate -q -DforceStdout -Dexpression=project.version)
VERSION=${VERSION/-SNAPSHOT/-0.${GIT_HASH}.$(date +%04Y%02m%02d%02H%02M)}
IFS='-' read -ra VERSION <<< "$VERSION"
RELEASE=${VERSION[1]-1}
MILESTONE=master

# GH RPM builds will be used only for OST so Firefox and Chrome are enough
# GWT build memory needs to be limited
EXTRA_BUILD_FLAGS=""
Expand All @@ -42,4 +35,5 @@ mv *.tar.gz rpmbuild/SOURCES
# create the src.rpm
rpmbuild \
-D "_topdir rpmbuild" \
${SUFFIX:+-D "release_suffix ${SUFFIX}"} \
-ts rpmbuild/SOURCES/*.gz
21 changes: 21 additions & 0 deletions .github/workflows/rhv-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: RHV build
on:
push:
branches: [ovirt-engine-4.5.3.z]

jobs:
get-pr:
runs-on: ubuntu-latest
outputs:
pr_url: ${{ steps.pr_url.outputs.pr_url }}
steps:
- id: pr_url
run: |
echo "pr_url=$(curl -sS https://api.github.com/repos/oVirt/ovirt-engine/commits/${{github.event.after}}/pulls | jq -r .[0].url)" >> $GITHUB_OUTPUT

rhv-build-and-ost:
needs: get-pr
uses: oVirt/ovirt-system-tests/.github/workflows/ost.yaml@master
with:
comment: "/ost rhv-build rhel8"
pr_url: "${{ needs.get-pr.outputs.pr_url }}"
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ OFFLINE_BUILD_MAVEN_SETTINGS=$(shell pwd)/build/offline-build-maven-settings.xml

include version.mak
# major, minor, seq
ENGINE_VERSION:=$(shell cat pom.xml | head -n 20 | grep '<version>' | head -n 1 | sed -e 's/.*>\(.*\)<.*/\1/' -e 's/-SNAPSHOT//')
PACKAGE_VERSION=$(ENGINE_VERSION)$(if $(MILESTONE),_$(MILESTONE))
PACKAGE_VERSION=$(RPM_VERSION)$(if $(MILESTONE),_$(MILESTONE))
DISPLAY_VERSION=$(PACKAGE_VERSION)

DEV_BUILD_FLAGS:=-P brand-source-maps
Expand Down Expand Up @@ -172,7 +171,7 @@ BUILD_TARGET=install
-e "s|@SETUP_VAR@|$(PKG_STATE_DIR)|g" \
-e "s|@DEV_PYTHON_DIR@|$(DEV_PYTHON_DIR)|g" \
-e "s|@DEV_SETUP_ENV_DIR@|$(DEV_SETUP_ENV_DIR)|g" \
-e "s|@RPM_VERSION@|$(ENGINE_VERSION)|g" \
-e "s|@RPM_VERSION@|$(RPM_VERSION)|g" \
-e "s|@RPM_RELEASE@|$(RPM_RELEASE)|g" \
-e "s|@MILESTONE@|$(MILESTONE)|g" \
-e "s|@PACKAGE_NAME@|$(PACKAGE_NAME)|g" \
Expand Down
13 changes: 1 addition & 12 deletions backend/manager/dependencies/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.ovirt.engine.core.manager</groupId>
<artifactId>dependencies</artifactId>
<version>4.5.3.2-SNAPSHOT</version>
<version>4.5.3.8-SNAPSHOT</version>
</parent>

<artifactId>common-dependencies</artifactId>
Expand All @@ -30,11 +30,6 @@
<artifactId>java-client-kubevirt</artifactId>
</dependency>

<dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
Expand Down Expand Up @@ -234,12 +229,6 @@
<moduleName>org.ovirt.java-client-kubevirt</moduleName>
</module>

<module>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
<moduleName>org.apache.commons.jxpath</moduleName>
</module>

<module>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion backend/manager/dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.ovirt.engine.core</groupId>
<artifactId>manager</artifactId>
<version>4.5.3.2-SNAPSHOT</version>
<version>4.5.3.8-SNAPSHOT</version>
</parent>

<artifactId>dependencies</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion backend/manager/dependencies/tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.ovirt.engine.core.manager</groupId>
<artifactId>dependencies</artifactId>
<version>4.5.3.2-SNAPSHOT</version>
<version>4.5.3.8-SNAPSHOT</version>
</parent>

<artifactId>tools-dependencies</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion backend/manager/extensions-tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.ovirt.engine.core</groupId>
<artifactId>manager</artifactId>
<version>4.5.3.2-SNAPSHOT</version>
<version>4.5.3.8-SNAPSHOT</version>
</parent>

<artifactId>extensions-tool</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion backend/manager/logutils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.ovirt.engine.core</groupId>
<artifactId>manager</artifactId>
<version>4.5.3.2-SNAPSHOT</version>
<version>4.5.3.8-SNAPSHOT</version>
</parent>

<artifactId>logutils</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion backend/manager/modules/aaa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.ovirt.engine.core</groupId>
<artifactId>manager-modules</artifactId>
<version>4.5.3.2-SNAPSHOT</version>
<version>4.5.3.8-SNAPSHOT</version>
</parent>

<artifactId>aaa</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion backend/manager/modules/auth-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.ovirt.engine.core</groupId>
<artifactId>manager-modules</artifactId>
<version>4.5.3.2-SNAPSHOT</version>
<version>4.5.3.8-SNAPSHOT</version>
</parent>

<artifactId>auth-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion backend/manager/modules/bll/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.ovirt.engine.core</groupId>
<artifactId>manager-modules</artifactId>
<version>4.5.3.2-SNAPSHOT</version>
<version>4.5.3.8-SNAPSHOT</version>
</parent>

<artifactId>bll</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ protected VM parseOvf(String ovf) {
vm = getVmInfoFromOvaFile();
}

if (originOvirt && vm != null) {
vm.setOrigin(OriginType.OVIRT);
if (vm != null) {
vm.setOrigin(originOvirt ? OriginType.OVIRT : OriginType.VMWARE);
}

return vm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,16 @@ protected Map<String, Pair<String, String>> getSharedLocks() {
@Override
public AuditLogType getAuditLogTypeValue() {
addAuditLogCustomValues();
return getSucceeded() ?
AuditLogType.USER_REDUCE_DISK_FINISHED_SUCCESS : AuditLogType.USER_REDUCE_DISK_FINISHED_FAILURE;
switch (getActionState()) {
case EXECUTE:
return getSucceeded() ?
AuditLogType.UNASSIGNED
: AuditLogType.USER_REDUCE_DISK_FINISHED_FAILURE;
default:
return getSucceeded() ?
AuditLogType.USER_REDUCE_DISK_FINISHED_SUCCESS
: AuditLogType.USER_REDUCE_DISK_FINISHED_FAILURE;
}
}

private void addAuditLogCustomValues() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,6 @@ public Guid createTask(Guid taskId,

@Override
public CommandCallback getCallback() {
return getParameters().isUseCinderCommandCallback() ? callbackProvider.get() : null;
return callbackProvider.get();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import org.ovirt.engine.core.common.errors.EngineException;
import org.ovirt.engine.core.common.errors.EngineMessage;
import org.ovirt.engine.core.common.queries.GetUnregisteredDisksQueryParameters;
import org.ovirt.engine.core.common.queries.QueryReturnValue;
import org.ovirt.engine.core.common.queries.QueryType;
import org.ovirt.engine.core.common.utils.Pair;
import org.ovirt.engine.core.common.vdscommands.IrsBaseVDSCommandParameters;
Expand Down Expand Up @@ -431,16 +432,23 @@ protected List<DiskImage> getAllOVFDisks(Guid storageDomainId, Guid storagePoolI
ovfDisks = new ArrayList<>();

// Get all unregistered disks.
List<DiskImage> disksFromStorage = backend.runInternalQuery(QueryType.GetUnregisteredDisks,
QueryReturnValue queryReturnValue = backend.runInternalQuery(QueryType.GetUnregisteredDisks,
new GetUnregisteredDisksQueryParameters(storageDomainId,
storagePoolId)).getReturnValue();
if (disksFromStorage == null) {
storagePoolId));
StorageDomain sd = storageDomainDao.get(storageDomainId);
if (sd.getStorageDomainType() == StorageDomainType.Data && !queryReturnValue.getSucceeded()) {
log.error("An error occurred while fetching unregistered disks from Storage Domain id '{}'",
storageDomainId);
throw new RuntimeException("Failed to retrieve unregistered disks");
}

List<DiskImage> disksFromStorage = queryReturnValue.getReturnValue();
if (disksFromStorage == null) {
return ovfDisks;
} else {
castDiskImagesToUnregisteredDisks(disksFromStorage, storageDomainId);
}

for (Disk disk : disksFromStorage) {
DiskImage ovfStoreDisk = (DiskImage) disk;
String diskDescription = ovfStoreDisk.getDescription();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
import java.util.concurrent.Future;
import java.util.stream.Collectors;

import javax.enterprise.inject.Instance;
import javax.inject.Inject;

import org.apache.commons.lang.StringUtils;
import org.ovirt.engine.core.bll.CommandBase;
import org.ovirt.engine.core.bll.ConcurrentChildCommandsExecutionCallback;
import org.ovirt.engine.core.bll.DisableInPrepareMode;
import org.ovirt.engine.core.bll.LockMessage;
import org.ovirt.engine.core.bll.LockMessagesMatchUtil;
Expand All @@ -28,6 +30,7 @@
import org.ovirt.engine.core.bll.storage.disk.image.DisksFilter;
import org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler;
import org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil;
import org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback;
import org.ovirt.engine.core.bll.utils.PermissionSubject;
import org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator;
import org.ovirt.engine.core.bll.validator.storage.DiskOperationsValidator;
Expand Down Expand Up @@ -117,6 +120,8 @@ public class RemoveDiskCommand<T extends RemoveDiskParameters> extends CommandBa
private UnregisteredDisksDao unregisteredDisksDao;
@Inject
private CommandCoordinatorUtil commandCoordinatorUtil;
@Inject
private Instance<ConcurrentChildCommandsExecutionCallback> callbackProvider;

public RemoveDiskCommand(T parameters, CommandContext commandContext) {
super(parameters, commandContext);
Expand Down Expand Up @@ -398,7 +403,7 @@ private boolean canRemoveVmImageDisk() {

@Override
protected void executeCommand() {
switch (getDisk().getDiskStorageType()) {
switch (getDiskStorageType()) {
case IMAGE:
if (getDisk().getContentType() == DiskContentType.MEMORY_DUMP_VOLUME ||
getDisk().getContentType() == DiskContentType.MEMORY_METADATA_VOLUME) {
Expand Down Expand Up @@ -448,6 +453,7 @@ protected void executeCommand() {
if (getParameters().isUnregisteredDisk()) {
unregisteredDisksDao.removeUnregisteredDisk(getParameters().getDiskId(), getParameters().getStorageDomainId());
}
persistCommandIfNeeded();
}

private void removeManagedBlockStorageDisk() {
Expand Down Expand Up @@ -510,7 +516,7 @@ private RemoveImageParameters buildRemoveImageParameters(DiskImage diskImage) {
RemoveImageParameters result = new RemoveImageParameters(diskImage.getImageId());
result.setTransactionScopeOption(TransactionScopeOption.Suppress);
result.setDiskImage(diskImage);
result.setParentCommand(ActionType.RemoveDisk);
result.setParentCommand(getActionType());
result.setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getDiskId()));
result.setParentParameters(getParameters());
result.setRemoveFromSnapshots(true);
Expand Down Expand Up @@ -728,4 +734,16 @@ private Guid getQuotaId() {
@Override
public void addQuotaPermissionSubject(List<PermissionSubject> quotaPermissionList) {
}

private DiskStorageType getDiskStorageType() {
if (getParameters().getDiskStorageType() == null) {
getParameters().setDiskStorageType(getDisk().getDiskStorageType());
}
return getParameters().getDiskStorageType();
}

@Override
public CommandCallback getCallback() {
return getDiskStorageType() == DiskStorageType.IMAGE ? callbackProvider.get() : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
import java.util.List;
import java.util.Set;

import javax.enterprise.inject.Instance;
import javax.inject.Inject;

import org.ovirt.engine.core.bll.ConcurrentChildCommandsExecutionCallback;
import org.ovirt.engine.core.bll.InternalCommandAttribute;
import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
import org.ovirt.engine.core.bll.VmCommand;
import org.ovirt.engine.core.bll.context.CommandContext;
import org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback;
import org.ovirt.engine.core.common.action.ActionReturnValue;
import org.ovirt.engine.core.common.action.ActionType;
import org.ovirt.engine.core.common.action.RemoveAllVmImagesParameters;
Expand Down Expand Up @@ -47,6 +50,8 @@ public class RemoveAllVmImagesCommand<T extends RemoveAllVmImagesParameters> ext
private DiskImageDao diskImageDao;
@Inject
private ImageDao imageDao;
@Inject
private Instance<ConcurrentChildCommandsExecutionCallback> callbackProvider;

public RemoveAllVmImagesCommand(T parameters, CommandContext cmdContext) {
super(parameters, cmdContext);
Expand Down Expand Up @@ -142,4 +147,8 @@ protected void endVmCommand() {
super.endVmCommand();
}
}

public CommandCallback getCallback() {
return callbackProvider.get();
}
}
Loading