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.129.124]) by passt.top (Postfix) with ESMTP id 493785A0082 for ; Tue, 14 Feb 2023 12:51:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676375488; 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=0hM631/fI8CcDfZboKHrXCjjp0T/Vab2DlMll3CJvdk=; b=geWnYQRe22VpiDbrKwil/8fYJJfWc5DCp969lBjhTSP67mcJTkDUvF967JtKHhxocKo/9b i5OmdOrNH7DUQAvMGKMJylT7oumzMn+I1xgfaQo2WAfg5CyYbPQgMtZ3E3vhkQKbbSH08l YtTMqCD7N+ZWmg8TUWIzW9wTegsf5uM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-325-j0hpnsGLNa2M54nkP6ddtw-1; Tue, 14 Feb 2023 06:51:26 -0500 X-MC-Unique: j0hpnsGLNa2M54nkP6ddtw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A20E718E004D for ; Tue, 14 Feb 2023 11:51:26 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14BC3140EBF6; Tue, 14 Feb 2023 11:51:25 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/4] qemu_extdevice: Make qemuExtDevicesHasDevice() check def->nets Date: Tue, 14 Feb 2023 12:51:20 +0100 Message-Id: <446dd5c17d7c3aa302f30253edc33fa8788100fa.1676374699.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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: CO57NE75K6U3XHPO6VPYNKXQLPWOIZHV X-Message-ID-Hash: CO57NE75K6U3XHPO6VPYNKXQLPWOIZHV X-Mailman-Approved-At: Tue, 14 Feb 2023 14:06:27 +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: 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. Signed-off-by: Michal Privoznik --- src/qemu/qemu_extdevice.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index fdefe59215..47e97f3565 100644 --- a/src/qemu/qemu_extdevice.c +++ b/src/qemu/qemu_extdevice.c @@ -296,6 +296,17 @@ qemuExtDevicesHasDevice(virDomainDef *def) return true; } + for (i = 0; i < def->nnets; i++) { + virDomainNetDef *net = def->nets[i]; + + if (QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp) + return true; + + if (net->type == VIR_DOMAIN_NET_TYPE_USER && + net->backend.type == VIR_DOMAIN_NET_BACKEND_PASST) + return true; + } + for (i = 0; i < def->ntpms; i++) { if (def->tpms[i]->type == VIR_DOMAIN_TPM_TYPE_EMULATOR) return true; -- 2.39.1