cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Weingärtner <rafaelweingart...@gmail.com>
Subject Re: [GitHub] cloudstack pull request: [4.7] vmware: improve support for disks
Date Mon, 18 Apr 2016 17:19:51 GMT
As I said I understand the check of "vm!= null". I was only referring to
the "vm.getType". I did not know that it could not be null.

I think what you were trying to say is that, once "vm" object is not null,
there is no way "getType" can return null, right? If that is a sure thing,
I am ok with the way it is right now.

On Mon, Apr 18, 2016 at 2:12 PM, bhaisaab <git@git.apache.org> wrote:

> Github user bhaisaab commented on a diff in the pull request:
>
>     https://github.com/apache/cloudstack/pull/1365#discussion_r60096454
>
>     --- Diff: server/src/com/cloud/storage/VolumeApiServiceImpl.java ---
>     @@ -1835,6 +1847,26 @@ private Volume
> orchestrateDetachVolumeFromVM(long vmId, long volumeId) {
>              }
>          }
>
>     +    public void updateMissingRootDiskController(final VMInstanceVO
> vm, final String rootVolChainInfo) {
>     +        if (vm == null ||
> !vm.getType().equals(VirtualMachine.Type.User) ||
> Strings.isNullOrEmpty(rootVolChainInfo)) {
>     --- End diff --
>
>     the order of evalution will be left to right -- the first case is vm
> == null; if this qualifies the if statement will branch into executing
> code; otherwise vm.getType() code will be executed (i.e. vm is not null);
> now here I think you're suggesting that perhaps vm.getType() may return
> null in which case we may have a NPE (unlikely based on db contraints (the
> type column should not be null), but I'll modify as suggested.
>
>
> ---
> If your project is set up for it, you can reply to this email and have your
> reply appear on GitHub as well. If your project does not have this feature
> enabled and wishes so, or if the feature is enabled but not working, please
> contact infrastructure at infrastructure@apache.org or file a JIRA ticket
> with INFRA.
> ---
>



-- 
Rafael Weingärtner

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message