You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/05/05 13:02:01 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4040: [KVM] Enable PVLAN support on L2 networks

DaanHoogland commented on a change in pull request #4040:
URL: https://github.com/apache/cloudstack/pull/4040#discussion_r420087948



##########
File path: scripts/vm/network/ovs-pvlan-kvm-vm.sh
##########
@@ -0,0 +1,279 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#!/bin/bash
+
+# We're trying to do the impossible here by allowing pvlan on kvm / xen. As only God can do the impossible, and we've got too much ego to
+# admit that we can't, we're just hacking our way around it.
+# We're pretty much crafting two vlan headers, one with the primary vlan and the other with the secondary and with a few fancy rules
+# it managed to work. But take note that the'res no checking over here for secondary vlan overlap. That has to be handled while
+# creating the pvlan!!
+
+exec 2>&1
+
+usage() {
+  printf "Usage: %s: (-A|-D) (-P/I/C) -b <bridge/switch> -p <primary vlan> -s <secondary vlan> -m <VM MAC> -h \n" $(basename $0) >&2
+  exit 2
+}
+
+echo "/usr/share/cloudstack-common/scripts/vm/network/ovs-pvlan-kvm-vm.sh $@ " >> /tmp/pvlan

Review comment:
       $0 $@?

##########
File path: plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
##########
@@ -4403,68 +4381,23 @@ public void testPvlanSetupCommandVm() {
         assertFalse(answer.getResult());
     }
 
-    @SuppressWarnings("unchecked")
-    @Test
-    public void testPvlanSetupCommandDhcpException() {

Review comment:
       why is this test no longer sensible?

##########
File path: scripts/vm/network/ovs-pvlan-kvm-dhcp-host.sh
##########
@@ -0,0 +1,139 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#!/bin/bash
+
+# We're trying to do the impossible here by allowing pvlan on kvm / xen. As only God can do the impossible, and we've got too much ego to
+# admit that we can't, we're just hacking our way around it.
+# We're pretty much crafting two vlan headers, one with the primary vlan and the other with the secondary and with a few fancy rules
+# it managed to work. But take note that the'res no checking over here for secondary vlan overlap. That has to be handled while
+# creating the pvlan!!
+
+exec 2>&1
+
+usage() {
+  printf "Usage: %s: (-A|-D) (-P/I/C) -b <bridge/switch> -p <primary vlan> -s <secondary vlan> -m <VM MAC> -d <DHCP IP> -h \n" $(basename $0) >&2
+  exit 2
+}
+
+echo "/usr/share/cloudstack-common/scripts/vm/network/ovs-pvlan-kvm-dhcp-host.sh $@ " >> /tmp/pvlan

Review comment:
       or `echo "$0 $@ " >>/tmp/pvlan' ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org