kvm: Do not set backing file format of DATADISK in vm start/migration#4800
Conversation
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. [S] |
|
Packaging result: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 95 |
|
@blueorangutan test |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests [S] |
|
[S] Trillian test result (tid-91)
|
|
@weizhouapache I'm confused by your description in context of the code change. If we do have a disk, but no backing format, we go ahead and rebase it as qcow2, am I right? |
@DaanHoogland I changed the title and description. we do nothing if (1) disk does not have a backing file ; (2) disk has backing file, and also backing file format. |
exactly what the code does, good text for the tin ;) |
| String backingFileFormat = info.get(new String("backing_file_format")); | ||
| if (org.apache.commons.lang.StringUtils.isEmpty(backingFileFormat)) { | ||
| if (org.apache.commons.lang.StringUtils.isNotBlank(backingFilePath) | ||
| && org.apache.commons.lang.StringUtils.isEmpty(backingFileFormat)) { |
There was a problem hiding this comment.
What if the backing file format is not empty?
There was a problem hiding this comment.
@rhtyd then it is fine, we do nothing.
There was a problem hiding this comment.
Maybe some log messages for debug/warn purposes would be interesting. Or do you think that it is something that system admins should not be bothered with?
I am thinking especially on cases such as backingFileFormat not empty and blank/empty backingFilePath, or vice versa.
Additionally, what do you think of replacing StringUtils.isEmpty(backingFileFormat) with StringUtils.isBlank(backingFileFormat)? In such case it would then check if backingFileFormat is whitespace, empty ("") or null.
There was a problem hiding this comment.
Maybe some log messages for debug/warn purposes would be interesting. Or do you think that it is something that system admins should not be bothered with?
I am thinking especially on cases such as
backingFileFormatnot empty and blank/emptybackingFilePath, or vice versa.Additionally, what do you think of replacing
StringUtils.isEmpty(backingFileFormat)withStringUtils.isBlank(backingFileFormat)? In such case it would then check ifbackingFileFormatis whitespace, empty ("") or null.
@GabrielBrascher there is a info next to these lines
s_logger.info("Setting backing file format of " + volPath);
I will add a line as comment to explain why we need this change.
https://libvirt.org/kbase/backing_chains.html#vm-refuses-to-start-due-to-misconfigured-backing-store-format
StringUtils.isBlank(backingFileFormat) and StringUtils.isEmpty(backingFileFormat) have no difference I think. there are only 2 possible values: empty and 'qcow2'. I will change to isBlank
GabrielBrascher
left a comment
There was a problem hiding this comment.
Thanks for the PR @weizhouapache.
| String backingFileFormat = info.get(new String("backing_file_format")); | ||
| if (org.apache.commons.lang.StringUtils.isEmpty(backingFileFormat)) { | ||
| if (org.apache.commons.lang.StringUtils.isNotBlank(backingFilePath) | ||
| && org.apache.commons.lang.StringUtils.isEmpty(backingFileFormat)) { |
There was a problem hiding this comment.
Maybe some log messages for debug/warn purposes would be interesting. Or do you think that it is something that system admins should not be bothered with?
I am thinking especially on cases such as backingFileFormat not empty and blank/empty backingFilePath, or vice versa.
Additionally, what do you think of replacing StringUtils.isEmpty(backingFileFormat) with StringUtils.isBlank(backingFileFormat)? In such case it would then check if backingFileFormat is whitespace, empty ("") or null.
|
@blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. [S] |
1 similar comment
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. [S] |
|
@blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. [S] |
|
Packaging result: ✔️ centos7 ✖️ centos8 ✖️ debian. SL-JID 152 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests [S] |
| @@ -4266,7 +4266,11 @@ public void setBackingFileFormat(String volPath) { | |||
| Map<String, String> info = qemu.info(file); | |||
| String backingFilePath = info.get(new String("backing_file")); | |||
There was a problem hiding this comment.
I detect that this code is problematic. According to the Performance (PERFORMANCE), Dm: Method invokes inefficient new String(String) constructor (DM_STRING_CTOR).
Using the java.lang.String(String) constructor wastes memory because the object so constructed will be functionally indistinguishable from the String passed as a parameter. Just use the argument String directly.
There was a problem hiding this comment.
@rubieHess good point. thanks ! I will create a pr for it.
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-245)
|
Thanks @rubieHess to point it out. see #4800 (comment)
Description
We do not need to set backing file format of DATADISK and ROOT disk which does not have a backing file.
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?