From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id B1D035A005E for ; Wed, 15 Feb 2023 16:23:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676474625; 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=Gt8LTXL5udqH8OtCx7UgEX80mToVelrPPuMUnu1f3OA=; b=EkTVpO3fDaErUGcvW/jEamcahsz3P2ScMNce3q1iV97eSYwMtDrkqEoqDoqMuTsAY3zYG2 vs8RQzq2SoZHBpJ/WZMlxYfQlLDzAs6bcXuPlS7M0OJFGuDDFr0Ly1YcEduoShfeWn4/+I LoEarQCxuJCek+2zo/G8g/7Eu5odnyk= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-76-Dx2ZVPQ-NnacGi0ru55udA-1; Wed, 15 Feb 2023 10:23:44 -0500 X-MC-Unique: Dx2ZVPQ-NnacGi0ru55udA-1 Received: by mail-qk1-f200.google.com with SMTP id s7-20020ae9f707000000b007294677a6e8so11662917qkg.17 for ; Wed, 15 Feb 2023 07:23:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Gt8LTXL5udqH8OtCx7UgEX80mToVelrPPuMUnu1f3OA=; b=N5l6L5LM06RpglKg/AuFJWsW3PRiTFtALD4XKcI7SJpwTV/O634UHc7+hKzdnLUZPk +0VQb7scqxWR6/tSVgt7QAJsk++tk+ExXQqq4tFYrLWfir0zAyuGT2tMrBsHGleJgvLk C2pH41snhGVYV5A3oy19giTqS7RaU7MyUEVvA0kkQ58GG9lRJc+9AetFFVTX2HqJqEyf eLMzhnK2XBI3YvT5jQUwBma32p1xvI7h4X8aRCLwVOgeFavGhWs7U/QTuSDEAWpUV/rx fCJR7DnPDe7Vae/UA3CHI3TD1/fDjPHIKnwBehXxyoUUFwbdRF2stDMoP/c/d/Ox35dh hL8A== X-Gm-Message-State: AO0yUKWU7bI/zY/zZ8tRRSV7PMGENPQrd2/lNChXHutigUI0qlx+qRq0 O5rMxyhMXAxEgRZlf88uw3S2fLJJGKMtHC7P4eWtYYyqtLRUhWIPmuB5txh/ppMis/Ulh1WHJJ2 ScwhYb0OgqfUK X-Received: by 2002:ac8:5c86:0:b0:3b8:938e:73b3 with SMTP id r6-20020ac85c86000000b003b8938e73b3mr3593271qta.45.1676474623974; Wed, 15 Feb 2023 07:23:43 -0800 (PST) X-Google-Smtp-Source: AK7set+chPeK4zqbq3veUINL5rdvuo+i1TLvrMqIirZe7qBtkG3JCiHyr+uNJldiG2OhwVfHthd+5w== X-Received: by 2002:ac8:5c86:0:b0:3b8:938e:73b3 with SMTP id r6-20020ac85c86000000b003b8938e73b3mr3593240qta.45.1676474623713; Wed, 15 Feb 2023 07:23:43 -0800 (PST) Received: from [10.40.23.222] (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id f30-20020ac8015e000000b003b9bd163403sm13289865qtg.4.2023.02.15.07.23.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Feb 2023 07:23:43 -0800 (PST) Message-ID: Date: Wed, 15 Feb 2023 16:23:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH 2/4] qemu_extdevice: Make qemuExtDevicesHasDevice() check def->nets To: Laine Stump , libvir-list@redhat.com References: <446dd5c17d7c3aa302f30253edc33fa8788100fa.1676374699.git.mprivozn@redhat.com> From: =?UTF-8?B?TWljaGFsIFByw612b3puw61r?= In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: Q7T4XAL65HUTVKR6ZWUKMU5UXO7FLWTA X-Message-ID-Hash: Q7T4XAL65HUTVKR6ZWUKMU5UXO7FLWTA X-Mailman-Approved-At: Wed, 15 Feb 2023 17:28:49 +0100 CC: sbrivio@redhat.com, passt-dev@passt.top X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2/15/23 08:22, Laine Stump wrote: > On 2/14/23 6:51 AM, Michal Privoznik wrote: >> We can have external helper processes running for domain >> too (e.g. slirp or passt). But this is not reflected >> in qemuExtDevicesHasDevice() which simply ignores these. > > The slirp-helper patches missed adding the check in this (oddly-named) > function (even while adding in the correct hunk to > qemuExtDevicesSetupCroup()) probably because it wasn't really obvious > without reading/interpreting/understanding all the code in two separate > files that it was needed; my passt patches missed adding the check in > this function because I was following the pattern of what was done for > slirp, and slirp hadn't touched this function (nor had it touched the > function that calls both of these functions, > qemuSetupCgroupForExtDevices(), which is in another file). It's > reasonable to think that some future person may also not notice > qemuExtDevicesHasDevice(), and believe that they only need to modify > qemuExtDevicesSetupCgroup(). > > Anyway, my point is that I think this could be avoided by adding a > comment in qemuExtDevicesSetupCgroup() that points out it is only called > if qemuExtDevicesHasDevice() returns true, and so any addition to > qemuExtDevicesSetupCgroup() should have a corresponding addition to > qemuExtDevicesHasDevice(). It's too late at night / early in the morning > for my brain to compose a concise sentence to this effect, but it would > make me happy if you added one before pushing. Sounds good, but I'd rather do that in a follow up patch, as it's a different semantic change than this commit. Done here: https://listman.redhat.com/archives/libvir-list/2023-February/237863.html > >> >> Signed-off-by: Michal Privoznik > > Reviewed-by: Laine Stump Michal