qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: QEMU <qemu-devel@nongnu.org>, Daniele Buono <dbuono@linux.vnet.ibm.com>
Subject: Re: [PATCH 3/5] net: slirp: switch to slirp_new
Date: Thu, 5 May 2022 10:29:07 +0200	[thread overview]
Message-ID: <CABgObfZaucTwU5vo5JKLabiBEKg7dEPhqYv+vSDvbHS72bDk1A@mail.gmail.com> (raw)
In-Reply-To: <CAJ+F1CLyTN90uBhc5W8i8i_Vre+FsMU3O-OXUy53kf-4EWxRiQ@mail.gmail.com>

On Thu, May 5, 2022 at 10:20 AM Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi
>
> On Thu, May 5, 2022 at 1:07 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> Replace slirp_init with slirp_new, so that a more recent cfg.version
>> can be specified.
>
>
> It was introduced in v4.1.0, but I don't see a minimum libslirp version check.

In fact 4.3.0 is needed for version 3 of the struct, so the following
needs to be
squashed:

diff --git a/meson.build b/meson.build
index 11876f5141..c902dfabd3 100644
--- a/meson.build
+++ b/meson.build
@@ -2638,7 +2638,7 @@ if have_system
   if slirp_opt in ['enabled', 'auto', 'system']
     have_internal = fs.exists(meson.current_source_dir() / 'slirp/meson.build')
     slirp = dependency('slirp', kwargs: static_kwargs,
-                       method: 'pkg-config',
+                       method: 'pkg-config', version: '>=4.3.0',
                        required: slirp_opt == 'system' or
                                  slirp_opt == 'enabled' and not have_internal)
     if slirp.found()


Paolo


>
>>
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>  net/slirp.c | 27 +++++++++++++++++++++------
>>  1 file changed, 21 insertions(+), 6 deletions(-)
>>
>> diff --git a/net/slirp.c b/net/slirp.c
>> index f1e25d741f..b3a92d6e38 100644
>> --- a/net/slirp.c
>> +++ b/net/slirp.c
>> @@ -389,6 +389,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
>>  #if defined(CONFIG_SMBD_COMMAND)
>>      struct in_addr smbsrv = { .s_addr = 0 };
>>  #endif
>> +    SlirpConfig cfg = { 0 };
>>      NetClientState *nc;
>>      SlirpState *s;
>>      char buf[20];
>> @@ -577,12 +578,26 @@ static int net_slirp_init(NetClientState *peer, const char *model,
>>
>>      s = DO_UPCAST(SlirpState, nc, nc);
>>
>> -    s->slirp = 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 = 3;
>> +    cfg.restricted = restricted;
>> +    cfg.in_enabled = ipv4;
>> +    cfg.vnetwork = net;
>> +    cfg.vnetmask = mask;
>> +    cfg.vhost = host;
>> +    cfg.in6_enabled = ipv6;
>> +    cfg.vprefix_addr6 = ip6_prefix;
>> +    cfg.vprefix_len = vprefix6_len;
>> +    cfg.vhost6 = ip6_host;
>> +    cfg.vhostname = vhostname;
>> +    cfg.tftp_server_name = tftp_server_name;
>> +    cfg.tftp_path = tftp_export;
>> +    cfg.bootfile = bootfile;
>> +    cfg.vdhcp_start = dhcp;
>> +    cfg.vnameserver = dns;
>> +    cfg.vnameserver6 = ip6_dns;
>> +    cfg.vdnssearch = dnssearch;
>> +    cfg.vdomainname = vdomainname;
>> +    s->slirp = slirp_new(&cfg, &slirp_cb, s);
>>      QTAILQ_INSERT_TAIL(&slirp_stacks, s, entry);
>>
>>      /*
>> --
>> 2.35.1
>>
>>
>
>
> --
> Marc-André Lureau



  reply	other threads:[~2022-05-05  9:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 20:59 [PATCH 0/5] net: support for CFI with libslirp >= 4.7 Paolo Bonzini
2022-05-04 20:59 ` [PATCH 1/5] slirp: bump submodule to 4.7 release Paolo Bonzini
2022-05-05  8:21   ` Marc-André Lureau
2022-05-05  8:34     ` Paolo Bonzini
2022-05-05  8:37       ` Marc-André Lureau
2022-05-05  8:42         ` Paolo Bonzini
2022-05-04 20:59 ` [PATCH 2/5] net: slirp: introduce a wrapper struct for QemuTimer Paolo Bonzini
2022-05-05  8:22   ` Marc-André Lureau
2022-05-04 20:59 ` [PATCH 3/5] net: slirp: switch to slirp_new Paolo Bonzini
2022-05-05  8:20   ` Marc-André Lureau
2022-05-05  8:29     ` Paolo Bonzini [this message]
2022-05-05 10:07       ` Daniel P. Berrangé
2022-05-05 12:02         ` Paolo Bonzini
2022-05-04 21:00 ` [PATCH 4/5] net: slirp: add support for CFI-friendly timer API Paolo Bonzini
2022-05-05  8:24   ` Marc-André Lureau
2022-05-04 21:00 ` [PATCH 5/5] net: slirp: allow CFI with libslirp >= 4.7 Paolo Bonzini
2022-05-05  8:21   ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABgObfZaucTwU5vo5JKLabiBEKg7dEPhqYv+vSDvbHS72bDk1A@mail.gmail.com \
    --to=pbonzini@redhat.com \
    --cc=dbuono@linux.vnet.ibm.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).