From nobody Tue Feb 10 06:49:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1677025810; cv=none; d=zohomail.com; s=zohoarc; b=U9uWMOicdBfZBGBH2lzb0WKuLJ4/zozPv0/QbsUgDtSgxo5CEHQuf437Pj+rqvoAqi66Gdf4HcZZNB9HulNZ1b3ciJoU3TFk8X8fgDlFK8QPNgzLoI61nV0LPMR4Rtju09k0fApQcLN/Sf9ELc/87jHvj88nh37+6/8tKuZKrl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677025810; h=Content-Type:Content-Transfer-Encoding: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=rUATcI/8dT0fKUh1A0hpnpoW0yw9HY0sNYffPCNBlkY=; b=RxwcMKe+GySwaYAVPvdaAwQ33YgLk0CUklr8obQR92TqQuCvvQ4WxyMPNSspqfCwks3D4jHlTqfOVJJLv+tvMDaQbQzD5rXuFhlfUqWDY7464bfTJ8TJ79R1F0Exdx/espFlOvB+Eib3xAWS/ldN67QHtfrT6id8hhocW30USik= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1677025810521289.3075188422782; Tue, 21 Feb 2023 16:30:10 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-179-go4zD2FgOpaAzwnSwxlLeg-1; Tue, 21 Feb 2023 19:30:05 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E1DB29DD98D; Wed, 22 Feb 2023 00:30:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47A2E492B01; Wed, 22 Feb 2023 00:30:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2BDDA1946589; Wed, 22 Feb 2023 00:30:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8CCEA1946589 for ; Wed, 22 Feb 2023 00:29:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 16141492B06; Wed, 22 Feb 2023 00:29:50 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.2.16.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2C33492B04 for ; Wed, 22 Feb 2023 00:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677025809; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=rUATcI/8dT0fKUh1A0hpnpoW0yw9HY0sNYffPCNBlkY=; b=I8MklHw0Dtu1wFyumAXQM06v8e7DacEWMOvjOfdIx2N/TFuJpjg2vioepFt4Vochf/rCUL 2f+YlftnOT7jOn8XSh6jQF2afHJhIfWU1zxkYM8cB5221HWZ7cCBD6cFJUMLKAwgv16Bel lZMonqZjIVjgiHoiDVsYOVJdnlU0vG0= X-MC-Unique: go4zD2FgOpaAzwnSwxlLeg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] qemu: add check for QEMU_CAPS_NETDEV_STREAM during validation Date: Tue, 21 Feb 2023 19:29:48 -0500 Message-Id: <20230222002949.56722-2-laine@redhat.com> In-Reply-To: <20230222002949.56722-1-laine@redhat.com> References: <20230222002949.56722-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1677025811941100004 Content-Type: text/plain; charset="utf-8"; x-default="true" In commit 5af6134e I had added a new capability that is true if QEMU allows "-netdev stream", but somehow neglected to actually check it in commit a56f0168d when hooking up passt support to qemu. This isn't catastrophic, since QEMU itself will still report an error, but that error isn't as easy to understand as a libvirt-generated error. Fixes: a56f0168d576fa01cec204dc3c67d4d63ab8487f Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- src/qemu/qemu_validate.c | 6 ++ .../net-user-passt.x86_64-latest.xml | 61 +++++++++++++++++++ tests/qemuxml2xmltest.c | 2 +- 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2xmloutdata/net-user-passt.x86_64-latest.x= ml diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 12055d5402..c877aa73d4 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1837,6 +1837,12 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNe= tDef *net, size_t i; =20 if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_USER) { + if (net->backend.type =3D=3D VIR_DOMAIN_NET_BACKEND_PASST && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("the passt network backend is not supported w= ith this QEMU binary")); + return -1; + } if (net->guestIP.nroutes) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Invalid attempt to set network interface " diff --git a/tests/qemuxml2xmloutdata/net-user-passt.x86_64-latest.xml b/te= sts/qemuxml2xmloutdata/net-user-passt.x86_64-latest.xml new file mode 100644 index 0000000000..d7e0ef5f90 --- /dev/null +++ b/tests/qemuxml2xmloutdata/net-user-passt.x86_64-latest.xml @@ -0,0 +1,61 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +