mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-11-07 02:23:42 +08:00
Compare commits
4 Commits
138742c953
...
v7.41
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f18663d840 | ||
|
|
fefe1af9e6 | ||
|
|
87a8cf7513 | ||
|
|
7f31cb6023 |
@@ -507,12 +507,11 @@ addDevice () {
|
|||||||
physical="${physical%% *}"
|
physical="${physical%% *}"
|
||||||
|
|
||||||
if [ -n "$physical" ]; then
|
if [ -n "$physical" ]; then
|
||||||
if [[ "$physical" == "512" || "$physical" == "4096" ]]; then
|
if [[ "$physical" != "512" ]]; then
|
||||||
if [[ "$physical" == "4096" ]]; then
|
sectors=",logical_block_size=$logical,physical_block_size=$physical"
|
||||||
sectors=",logical_block_size=$logical,physical_block_size=$physical"
|
if [[ "$physical" != "4096" && "$physical" != "32768" ]]; then
|
||||||
|
warn "Unknown physical sector size: $physical for $DISK_DEV"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
warn "Unknown physical sector size: $physical for $DISK_DEV"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
warn "Failed to determine the sector size for $DISK_DEV"
|
warn "Failed to determine the sector size for $DISK_DEV"
|
||||||
|
|||||||
@@ -393,11 +393,30 @@ getInfo() {
|
|||||||
error "$ADD_ERR -e \"VM_NET_DEV=NAME\" to specify another interface name." && exit 26
|
error "$ADD_ERR -e \"VM_NET_DEV=NAME\" to specify another interface name." && exit 26
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NIC=$(ethtool -i "$VM_NET_DEV" | grep -m 1 -i 'driver:' | awk '{print $(2)}')
|
local result nic bus
|
||||||
|
result=$(ethtool -i "$VM_NET_DEV")
|
||||||
|
nic=$(grep -m 1 -i 'driver:' <<< "$result" | awk '{print $(2)}')
|
||||||
|
bus=$(grep -m 1 -i 'bus-info:' <<< "$result" | awk '{print $(2)}')
|
||||||
|
|
||||||
|
if [[ "${bus,,}" != "" && "${bus,,}" != "n/a" ]]; then
|
||||||
|
[[ "$DEBUG" == [Yy1]* ]] && info "Detected BUS: $bus"
|
||||||
|
error "This container does not support host mode networking!"
|
||||||
|
exit 29
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$DHCP" == [Yy1]* ]]; then
|
||||||
|
|
||||||
|
if [[ "${nic,,}" == "ipvlan" ]]; then
|
||||||
|
error "This container does not support IPVLAN networking when DHCP=Y."
|
||||||
|
exit 29
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${nic,,}" != "macvlan" ]]; then
|
||||||
|
[[ "$DEBUG" == [Yy1]* ]] && info "Detected NIC: $nic"
|
||||||
|
error "The container needs to be in a MACVLAN network when DHCP=Y."
|
||||||
|
exit 29
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${NIC,,}" != "veth" ]]; then
|
|
||||||
[[ "$DEBUG" == [Yy1]* ]] && info "Detected NIC: $NIC"
|
|
||||||
error "This container does not support host mode networking!" && exit 29
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BASE_IP="${VM_NET_IP%.*}."
|
BASE_IP="${VM_NET_IP%.*}."
|
||||||
@@ -496,10 +515,6 @@ if [[ "$DHCP" == [Yy1]* ]]; then
|
|||||||
|
|
||||||
checkOS
|
checkOS
|
||||||
|
|
||||||
if [[ "$IP" == "172."* ]]; then
|
|
||||||
warn "container IP starts with 172.* which is often a sign that you are not on a macvlan network (required for DHCP)!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Configure for macvtap interface
|
# Configure for macvtap interface
|
||||||
configureDHCP || exit 20
|
configureDHCP || exit 20
|
||||||
|
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ cpu() {
|
|||||||
cpu="${cpu// [0-9] Core}"
|
cpu="${cpu// [0-9] Core}"
|
||||||
cpu="${cpu// [0-9][0-9] Core}"
|
cpu="${cpu// [0-9][0-9] Core}"
|
||||||
cpu="${cpu// [0-9][0-9][0-9] Core}"
|
cpu="${cpu// [0-9][0-9][0-9] Core}"
|
||||||
cpu="${cpu// [0-9]th Gen}"
|
cpu="${cpu//[0-9]th Gen }"
|
||||||
cpu="${cpu// [0-9][0-9]th Gen}"
|
cpu="${cpu//[0-9][0-9]th Gen }"
|
||||||
cpu="${cpu// Processor/}"
|
cpu="${cpu// Processor/}"
|
||||||
cpu="${cpu// Quad core/}"
|
cpu="${cpu// Quad core/}"
|
||||||
cpu="${cpu// Dual core/}"
|
cpu="${cpu// Dual core/}"
|
||||||
|
|||||||
Reference in New Issue
Block a user