From nobody Sat Feb 7 23:15:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 171560879124760.81883650937175; Mon, 13 May 2024 06:59:51 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1DF131A9B; Mon, 13 May 2024 09:59:50 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2EAF91A8F; Mon, 13 May 2024 09:59:18 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 498B41A37; Mon, 13 May 2024 09:59:15 -0400 (EDT) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B43901A2C for ; Mon, 13 May 2024 09:59:11 -0400 (EDT) Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2e0b2ddc5d1so63109131fa.3 for ; Mon, 13 May 2024 06:59:11 -0700 (PDT) Received: from localhost.localdomain ([212.70.119.223]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733beb89e7sm6438436a12.21.2024.05.13.06.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 06:59:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715608750; x=1716213550; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xvtM/wL4I/9zdr7xA7nJJphIIV7p22DaefKoyLw+4Qw=; b=Rj8xf0EoPiF9B5KC7RgKETh/8+JrJrfknxezloQ6FbybpcOTgBIaYRhUCu0v5lQk7O BlGPxRDMUp01urvg+m3B89xQqlSbE1nydl4Vahb0605xOGUDdnOlKe1j7h2jXSMMBw2x z2uKqOpRIWsuIjJQBfr6alRrsPBlUoT4nSPIBPdzAvbdQ3VACPyLupZjbsoBsl0UdBDw 5PVChlj/XV8bUOoKWKlvkQA22Ne8JbTLXRtx87/ODGp002A6fvx2Lr4/NXyl3iZezEvD aUh9k0E60wr4RxbvsVasbDbGc08EbvctBc/BkkfLLX0/veD78YxTqOCQsnkkSJ3+8xqH YLbQ== X-Gm-Message-State: AOJu0YzaPnEQ9f6KyeZVj6VM8mjgmdldsgm9/iKAmbooe7goYVOMOoK9 MR3a8vqTZtpa3ct7jOTbbIOO5aJEpRKvR6f+pacZTs3/Q3G1TNX33xzllw== X-Google-Smtp-Source: AGHT+IHF/1KUgvbKCaNRYTX7pC8CqsN5ywGI/nbElwNfrGRmZhmiiDtz9J0v357w/WuGCvwL/gVQ3g== X-Received: by 2002:a2e:8957:0:b0:2dc:ae40:c797 with SMTP id 38308e7fff4ca-2e51fe53177mr68251421fa.15.1715608749715; Mon, 13 May 2024 06:59:09 -0700 (PDT) From: Rayhan Faizel To: devel@lists.libvirt.org Subject: [PATCH v2] qemu_hotplug: Properly assign USB address to hotplugged usb-net device Date: Mon, 13 May 2024 19:25:03 +0530 Message-Id: <20240513135502.12529-1-rayhan.faizel@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: AI6PXVLMFASPOBQWZI2WRAUFA3VB5BBL X-Message-ID-Hash: AI6PXVLMFASPOBQWZI2WRAUFA3VB5BBL X-MailFrom: rayhan.faizel@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Rayhan Faizel X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1715608792566100001 Previously, the network device hotplug logic would try to ensure only CCW or PCI addresses. With recent support for the usb-net model, this patch will ensure USB addresses for usb-net network devices. [Changes in v2] - Additional information in commit message - Relevant gitlab issue link (mostly already resolved but hotplugging is mentioned in one of the comments) Resolves: https://gitlab.com/libvirt/libvirt/-/issues/14 Signed-off-by: Rayhan Faizel Reviewed-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 774962b0df..3b39941780 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1159,8 +1159,11 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver, goto cleanup; } =20 - if (qemuDomainIsS390CCW(vm->def) && - net->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { + if (net->model =3D=3D VIR_DOMAIN_NET_MODEL_USB_NET) { + if (virDomainUSBAddressEnsure(priv->usbaddrs, &net->info) < 0) + goto cleanup; + } else if (qemuDomainIsS390CCW(vm->def) && + net->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { net->info.type =3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; if (!(ccwaddrs =3D virDomainCCWAddressSetCreateFromDomain(vm->def)= )) goto cleanup; --=20 2.34.1 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org