diff options
| author | Stefan Hajnoczi <stefanha@redhat.com> | 2025-05-21 10:25:55 -0400 |
|---|---|---|
| committer | Stefan Hajnoczi <stefanha@redhat.com> | 2025-05-21 10:25:55 -0400 |
| commit | c6e1f60cc73c787317316bb2956f9a95a5daee15 (patch) | |
| tree | abcbdffb708bb2c96def5138a64f1dde0bd460ce /scripts | |
| parent | f0737158b483e7ec2b2512145aeab888b85cc1f7 (diff) | |
| parent | e09c6d837593aa1e12d92d7031c65a881eb2eb27 (diff) | |
| download | focaccia-qemu-c6e1f60cc73c787317316bb2956f9a95a5daee15.tar.gz focaccia-qemu-c6e1f60cc73c787317316bb2956f9a95a5daee15.zip | |
Merge tag 'migration-20250520-pull-request' of https://gitlab.com/peterx/qemu into staging
Migration pull - Peter's vmstate static checker entry for recent hpet change - Zhijian's rdma test patch to properly skip tests when locked_vm too low, and ipv6 test - Fabiano's few CI changes - Prasad's last patches to enable postcopy on precopy-multifd - Maciej's fix to disable multifd zerocopy for device states - Peter's HMP change to "info migrate", plus a small fix on cap set # -----BEGIN PGP SIGNATURE----- # # iIgEABYKADAWIQS5GE3CDMRX2s990ak7X8zN86vXBgUCaCy2xxIccGV0ZXJ4QHJl # ZGhhdC5jb20ACgkQO1/MzfOr1waNZgD9HRflpY6sqcXt9wPKYgJFAyPN9Jg05kGO # jeRIhD9cvyIBAN5AjbE0gaN8f+BLR5vcNk0Q5uOaHHIFZxL7tJl8ob4L # =WTpL # -----END PGP SIGNATURE----- # gpg: Signature made Tue 20 May 2025 13:07:19 EDT # gpg: using EDDSA key B9184DC20CC457DACF7DD1A93B5FCCCDF3ABD706 # gpg: issuer "peterx@redhat.com" # gpg: Good signature from "Peter Xu <xzpeter@gmail.com>" [full] # gpg: aka "Peter Xu <peterx@redhat.com>" [full] # Primary key fingerprint: B918 4DC2 0CC4 57DA CF7D D1A9 3B5F CCCD F3AB D706 * tag 'migration-20250520-pull-request' of https://gitlab.com/peterx/qemu: migration/hmp: Add "info migrate -a", reorg the dump migration: Allow caps to be set when preempt or multifd cap enabled migration/multifd: Don't send device state packets with zerocopy flag tests/qtest/migration: add postcopy tests with multifd migration: enable multifd and postcopy together migration: write zero pages when postcopy enabled ci: Reduce the size of artifacts for build-previous-qemu ci: Fix build-previous-qemu when the version tag is absent ci: Re-enable python subtests in qtest migration suite qtest/migration/rdma: Add test for rdma migration with ipv6 qtest/migration/rdma: Enforce RLIMIT_MEMLOCK >= 128MB requirement scripts/vmstate-static-checker.py: Add new hpet entry for num_timers Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/rdma-migration-helper.sh | 57 | ||||
| -rwxr-xr-x | scripts/vmstate-static-checker.py | 1 |
2 files changed, 49 insertions, 9 deletions
diff --git a/scripts/rdma-migration-helper.sh b/scripts/rdma-migration-helper.sh index a39f2fb0e5..d784d1566a 100755 --- a/scripts/rdma-migration-helper.sh +++ b/scripts/rdma-migration-helper.sh @@ -8,23 +8,44 @@ get_ipv4_addr() head -1 | tr -d '\n' } +get_ipv6_addr() { + ipv6=$(ip -6 -o addr show dev "$1" | + sed -n 's/.*[[:blank:]]inet6[[:blank:]]*\([^[:blank:]/]*\).*/\1/p' | + head -1 | tr -d '\n') + + [ $? -eq 0 ] || return + + if [[ "$ipv6" =~ ^fe80: ]]; then + echo -n "[$ipv6%$1]" + else + echo -n "[$ipv6]" + fi +} + # existing rdma interfaces rdma_interfaces() { - rdma link show | sed -nE 's/^link .* netdev ([^ ]+).*$/\1 /p' + rdma link show | sed -nE 's/^link .* netdev ([^ ]+).*$/\1 /p' | + grep -Ev '^(lo|tun|tap)' } # existing valid ipv4 interfaces ipv4_interfaces() { - ip -o addr show | awk '/inet / {print $2}' | grep -v -w lo + ip -o addr show | awk '/inet / {print $2}' | grep -Ev '^(lo|tun|tap)' +} + +ipv6_interfaces() +{ + ip -o addr show | awk '/inet6 / {print $2}' | grep -Ev '^(lo|tun|tap)' } rdma_rxe_detect() { + family=$1 for r in $(rdma_interfaces) do - ipv4_interfaces | grep -qw $r && get_ipv4_addr $r && return + "$family"_interfaces | grep -qw $r && get_"$family"_addr $r && return done return 1 @@ -32,16 +53,23 @@ rdma_rxe_detect() rdma_rxe_setup() { - for i in $(ipv4_interfaces) + family=$1 + for i in $("$family"_interfaces) do - rdma_interfaces | grep -qw $i && continue + if rdma_interfaces | grep -qw $i; then + echo "$family: Reuse the existing rdma/rxe ${i}_rxe" \ + "for $i with $(get_"$family"_addr $i)" + return + fi + rdma link add "${i}_rxe" type rxe netdev "$i" && { - echo "Setup new rdma/rxe ${i}_rxe for $i with $(get_ipv4_addr $i)" + echo "$family: Setup new rdma/rxe ${i}_rxe" \ + "for $i with $(get_"$family"_addr $i)" return } done - echo "Failed to setup any new rdma/rxe link" >&2 + echo "$family: Failed to setup any new rdma/rxe link" >&2 return 1 } @@ -50,6 +78,12 @@ rdma_rxe_clean() modprobe -r rdma_rxe } +IP_FAMILY=${IP_FAMILY:-ipv4} +if [ "$IP_FAMILY" != "ipv6" ] && [ "$IP_FAMILY" != "ipv4" ]; then + echo "Unknown ip family '$IP_FAMILY', only ipv4 or ipv6 is supported." >&2 + exit 1 +fi + operation=${1:-detect} command -v rdma >/dev/null || { @@ -62,9 +96,14 @@ if [ "$operation" == "setup" ] || [ "$operation" == "clean" ]; then echo "Root privilege is required to setup/clean a rdma/rxe link" >&2 exit 1 } - rdma_rxe_"$operation" + if [ "$operation" == "setup" ]; then + rdma_rxe_setup ipv4 + rdma_rxe_setup ipv6 + else + rdma_rxe_clean + fi elif [ "$operation" == "detect" ]; then - rdma_rxe_detect + rdma_rxe_detect "$IP_FAMILY" else echo "Usage: $0 [setup | detect | clean]" fi diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py index 25aca839a0..2335e25f94 100755 --- a/scripts/vmstate-static-checker.py +++ b/scripts/vmstate-static-checker.py @@ -91,6 +91,7 @@ def check_fields_match(name, s_field, d_field): 'mem_win_size', 'mig_mem_win_size', 'io_win_addr', 'mig_io_win_addr', 'io_win_size', 'mig_io_win_size'], + 'hpet': ['num_timers', 'num_timers_save'], } if not name in changed_names: |