Skip to content

Commit 3b1ab6f

Browse files
committed
Add source VM name on virt-v2v migration log entries
1 parent 3d6ec29 commit 3b1ab6f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtConvertInstanceCommandWrapper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public Answer execute(ConvertInstanceCommand cmd, LibvirtComputingResource serve
116116

117117
boolean cleanupSecondaryStorage = false;
118118
try {
119-
boolean result = performInstanceConversion(sourceOVFDirPath, temporaryConvertPath, temporaryConvertUuid,
119+
boolean result = performInstanceConversion(sourceInstanceName, sourceOVFDirPath, temporaryConvertPath, temporaryConvertUuid,
120120
timeout, verboseModeEnabled);
121121
if (!result) {
122122
String err = String.format(
@@ -217,7 +217,7 @@ private boolean exportOVAFromVMOnVcenter(String vmExportUrl,
217217
return exitValue == 0;
218218
}
219219

220-
protected boolean performInstanceConversion(String sourceOVFDirPath,
220+
protected boolean performInstanceConversion(String sourceInstanceName, String sourceOVFDirPath,
221221
String temporaryConvertFolder,
222222
String temporaryConvertUuid,
223223
long timeout, boolean verboseModeEnabled) {
@@ -233,7 +233,7 @@ protected boolean performInstanceConversion(String sourceOVFDirPath,
233233
script.add("-v");
234234
}
235235

236-
String logPrefix = String.format("virt-v2v ovf source: %s progress", sourceOVFDirPath);
236+
String logPrefix = String.format("(%s) virt-v2v ovf source: %s progress", sourceInstanceName, sourceOVFDirPath);
237237
OutputInterpreter.LineByLineOutputLogger outputLogger = new OutputInterpreter.LineByLineOutputLogger(logger, logPrefix);
238238
script.execute(outputLogger);
239239
int exitValue = script.getExitValue();

plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtConvertInstanceCommandWrapperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public void testExecuteConvertFailure() {
166166

167167
Answer answer = convertInstanceCommandWrapper.execute(cmd, libvirtComputingResourceMock);
168168
Assert.assertFalse(answer.getResult());
169-
Mockito.verify(convertInstanceCommandWrapper).performInstanceConversion(Mockito.anyString(),
169+
Mockito.verify(convertInstanceCommandWrapper).performInstanceConversion(Mockito.anyString(), Mockito.anyString(),
170170
Mockito.anyString(), Mockito.anyString(), Mockito.anyLong(), Mockito.anyBoolean());
171171
}
172172
}

0 commit comments

Comments
 (0)