@@ -1971,7 +1971,7 @@ protected static boolean isInterface(final String fname) {
19711971 for (final String ifNamePattern : ifNamePatterns ) {
19721972 commonPattern .append ("|(" ).append (ifNamePattern ).append (".*)" );
19731973 }
1974- if (fname .matches (commonPattern .toString ())) {
1974+ if (fname .matches (commonPattern .toString ())) {
19751975 return true ;
19761976 }
19771977 return false ;
@@ -2498,11 +2498,10 @@ private String getBroadcastUriFromBridge(final String brName) {
24982498 final Pattern pattern = Pattern .compile ("(\\ D+)(\\ d+)(\\ D*)(\\ d*)(\\ D*)(\\ d*)" );
24992499 final Matcher matcher = pattern .matcher (pif );
25002500 LOGGER .debug ("getting broadcast uri for pif " + pif + " and bridge " + brName );
2501- if (matcher .find ()) {
2501+ if (matcher .find ()) {
25022502 if (brName .startsWith ("brvx" )){
25032503 return BroadcastDomainType .Vxlan .toUri (matcher .group (2 )).toString ();
2504- }
2505- else {
2504+ } else {
25062505 if (!matcher .group (6 ).isEmpty ()) {
25072506 return BroadcastDomainType .Vlan .toUri (matcher .group (6 )).toString ();
25082507 } else if (!matcher .group (4 ).isEmpty ()) {
@@ -3742,7 +3741,7 @@ public int compare(final DiskTO arg0, final DiskTO arg1) {
37423741 } else if (volume .getType () == Volume .Type .DATADISK ) {
37433742 final KVMPhysicalDisk physicalDisk = storagePoolManager .getPhysicalDisk (store .getPoolType (), store .getUuid (), data .getPath ());
37443743 final KVMStoragePool pool = physicalDisk .getPool ();
3745- if (StoragePoolType .RBD .equals (pool .getType ())) {
3744+ if (StoragePoolType .RBD .equals (pool .getType ())) {
37463745 final int devId = volume .getDiskSeq ().intValue ();
37473746 final String device = mapRbdDevice (physicalDisk );
37483747 if (device != null ) {
@@ -5200,7 +5199,7 @@ protected long getMemoryFreeInKBs(Domain dm) throws LibvirtException {
52005199 }
52015200
52025201 for (int i = 0 ; i < memoryStats .length ; i ++) {
5203- if (memoryStats [i ].getTag () == UNUSEDMEMORY ) {
5202+ if (memoryStats [i ].getTag () == UNUSEDMEMORY ) {
52045203 freeMemory = memoryStats [i ].getValue ();
52055204 break ;
52065205 }
@@ -5772,12 +5771,12 @@ public HypervisorType getHypervisorType(){
57725771 return hypervisorType ;
57735772 }
57745773
5775- public String mapRbdDevice (final KVMPhysicalDisk disk ){
5774+ public String mapRbdDevice (final KVMPhysicalDisk disk ) {
57765775 final KVMStoragePool pool = disk .getPool ();
57775776 //Check if rbd image is already mapped
57785777 final String [] splitPoolImage = disk .getPath ().split ("/" );
57795778 String device = Script .runSimpleBashScript ("rbd showmapped | grep \" " +splitPoolImage [0 ]+"[ ]*" +splitPoolImage [1 ]+"\" | grep -o \" [^ ]*[ ]*$\" " );
5780- if (device == null ) {
5779+ if (device == null ) {
57815780 //If not mapped, map and return mapped device
57825781 Script .runSimpleBashScript ("rbd map " + disk .getPath () + " --id " + pool .getAuthUserName ());
57835782 device = Script .runSimpleBashScript ("rbd showmapped | grep \" " +splitPoolImage [0 ]+"[ ]*" +splitPoolImage [1 ]+"\" | grep -o \" [^ ]*[ ]*$\" " );
0 commit comments