From nobody Tue Feb 10 10:54:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652002663; cv=none; d=zohomail.com; s=zohoarc; b=gXwPTo+EOO4iVZj4J7567fELo1D5yxxPrVzLnksND4YZW1V5KL+3Fp3Z1i+4htK/rPYWmenXz2zUNpjfor5nDJwL3KVmvWyA2B4H6A5Oi4VVELl52+HrXnByrrtaBVSHRhvhxmQGUc5d0vIusQ+KwIUFULtPf3MB4w/eqTGMGU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652002663; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Uv+wMdkn8fKZ5tfLdhBHRhBzVWdj1htzdQqNI2/aivk=; b=oE71Zsofo0D5w5JeiBKt5+xjeEeTsjum7Esiaf+XEfmsmWsJo3DjpDPn80mW8iYoTxwHGWuDYd9GBITptRWLS2TkCB6ev1UMB8xB8SsysLQgahe3I/AhXtTz4ZNgbTfVyexptCcqV1xTwvIiIkIE/FxV/NK6mdvA9SPn+74nU/U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652002663966985.4694686321791; Sun, 8 May 2022 02:37:43 -0700 (PDT) Received: from localhost ([::1]:40512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nndME-0001Aa-IT for importer@patchew.org; Sun, 08 May 2022 05:37:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nndGP-0001ec-JP for qemu-devel@nongnu.org; Sun, 08 May 2022 05:31:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nndGN-0008Pt-Vm for qemu-devel@nongnu.org; Sun, 08 May 2022 05:31:41 -0400 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-48-c2dpe1-dOVqhrDfjYel6-g-1; Sun, 08 May 2022 05:31:38 -0400 Received: by mail-ed1-f72.google.com with SMTP id l24-20020a056402231800b00410f19a3103so6550496eda.5 for ; Sun, 08 May 2022 02:31:38 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:e3ec:5559:7c5c:1928]) by smtp.gmail.com with ESMTPSA id vf20-20020a170907239400b006f3ef214dabsm3829117ejb.17.2022.05.08.02.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 02:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652002299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uv+wMdkn8fKZ5tfLdhBHRhBzVWdj1htzdQqNI2/aivk=; b=MtL2+znj1fsftslcGWCt8xiaysyUEJZARnxnUn61ycVjuhWZfiL3P17tKL0SWbD9uSN//g yE0B00cmfUVZgFtGlIlloAIRHr1+ieZs8Lu0k8jvhw3dbSY7qEJeK28uvEFz8S1c51OEUq Rjs6UpksnfkfVh0LzmjagxEpN1iFQe4= X-MC-Unique: c2dpe1-dOVqhrDfjYel6-g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uv+wMdkn8fKZ5tfLdhBHRhBzVWdj1htzdQqNI2/aivk=; b=Pda2zY95rdCH6T3RDFs1kfKGnsSwbS9evkiNBdCXhOXL4LaAFfDCXmrfyb36WCVGfN sn2GJic2WS4g4V66lrhlN6iz9jb7JJkjxRFYMU5dKF1erF/VQhS4Lt+Xc0OV54/uBNeq +jhFlbZ9mSIAYbS+sfCPHoKXRu8Ryeq23hDUuh+XaYMFQihjOQvOe+8/n9tk3tm1+9Dv /MAM/1u9wU0jb4ZuGocH+7nx7Wk90xbkpzmfUZ/+5LtQ5DKoBmljUw6eS2gF75yqUeEz UeDoJJhOBLznaEcbDT4O/ZhKieX4kPFG3nm25tnMkdU+7oZJTcuwNFYS2116BLCLpuml Dx+A== X-Gm-Message-State: AOAM532PEh1RNdG3a8N4B3YgwEzkyxDbqz2pW6pyYcLBGpdbHJVgGm31 gAg+d19BjEaEaz7HGVgCigI2NXjYFX1VNE4Q6R43lh+a8wcc00sfZM3zF6g9iOfl7quIYtDalZT 6eG2uDFW9cYqZdqADBUprk3U+zetJhZzKMVEZ4qLsAF3+ALZAr1lw4Ewljy3Dq2Fort0= X-Received: by 2002:a05:6402:4414:b0:419:28bc:55dc with SMTP id y20-20020a056402441400b0041928bc55dcmr12241248eda.130.1652002296703; Sun, 08 May 2022 02:31:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm0PUOGB+YUnEq6W1eShEhzWHO7UnokoDYBkn5b0igLeQxmnApkSb+gByrNfwmzfhhdKfbxQ== X-Received: by 2002:a05:6402:4414:b0:419:28bc:55dc with SMTP id y20-20020a056402441400b0041928bc55dcmr12241236eda.130.1652002296489; Sun, 08 May 2022 02:31:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: berrange@redhat.com, malureau@redhat.com Subject: [PATCH v2 3/5] net: slirp: switch to slirp_new Date: Sun, 8 May 2022 11:31:18 +0200 Message-Id: <20220508093120.173131-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220508093120.173131-1-pbonzini@redhat.com> References: <20220508093120.173131-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652002665826100001 Content-Type: text/plain; charset="utf-8" Replace slirp_init with slirp_new, so that a more recent cfg.version can be specified. Only support version 3 of the configuration for simplicity, corresponding to a minimum slirp version of 4.3.0. Signed-off-by: Paolo Bonzini --- meson.build | 2 +- net/slirp.c | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 1712ea9e46..264a5fb5ed 100644 --- a/meson.build +++ b/meson.build @@ -2638,7 +2638,7 @@ if have_system if slirp_opt in ['enabled', 'auto', 'system'] have_internal =3D fs.exists(meson.current_source_dir() / 'slirp/meson.= build') slirp =3D dependency('slirp', kwargs: static_kwargs, - method: 'pkg-config', + method: 'pkg-config', version: '>=3D4.1.0', required: slirp_opt =3D=3D 'system' or slirp_opt =3D=3D 'enabled' and not have_i= nternal) if slirp.found() diff --git a/net/slirp.c b/net/slirp.c index f1e25d741f..b7464be86b 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -389,6 +389,7 @@ static int net_slirp_init(NetClientState *peer, const c= har *model, #if defined(CONFIG_SMBD_COMMAND) struct in_addr smbsrv =3D { .s_addr =3D 0 }; #endif + SlirpConfig cfg =3D { 0 }; NetClientState *nc; SlirpState *s; char buf[20]; @@ -577,12 +578,26 @@ static int net_slirp_init(NetClientState *peer, const= char *model, =20 s =3D DO_UPCAST(SlirpState, nc, nc); =20 - s->slirp =3D slirp_init(restricted, ipv4, net, mask, host, - ipv6, ip6_prefix, vprefix6_len, ip6_host, - vhostname, tftp_server_name, - tftp_export, bootfile, dhcp, - dns, ip6_dns, dnssearch, vdomainname, - &slirp_cb, s); + cfg.version =3D 1; + cfg.restricted =3D restricted; + cfg.in_enabled =3D ipv4; + cfg.vnetwork =3D net; + cfg.vnetmask =3D mask; + cfg.vhost =3D host; + cfg.in6_enabled =3D ipv6; + cfg.vprefix_addr6 =3D ip6_prefix; + cfg.vprefix_len =3D vprefix6_len; + cfg.vhost6 =3D ip6_host; + cfg.vhostname =3D vhostname; + cfg.tftp_server_name =3D tftp_server_name; + cfg.tftp_path =3D tftp_export; + cfg.bootfile =3D bootfile; + cfg.vdhcp_start =3D dhcp; + cfg.vnameserver =3D dns; + cfg.vnameserver6 =3D ip6_dns; + cfg.vdnssearch =3D dnssearch; + cfg.vdomainname =3D vdomainname; + s->slirp =3D slirp_new(&cfg, &slirp_cb, s); QTAILQ_INSERT_TAIL(&slirp_stacks, s, entry); =20 /* --=20 2.35.1