From nobody Wed May 14 07:00:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526917242865349.52140073141993; Mon, 21 May 2018 08:40:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F8A029B378; Mon, 21 May 2018 15:40:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 173355D6B5; Mon, 21 May 2018 15:40:41 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C6F464BB78; Mon, 21 May 2018 15:40:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4LFbXEl024079 for ; Mon, 21 May 2018 11:37:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6598210EE6D7; Mon, 21 May 2018 15:37:33 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0A1F10EE6D5; Mon, 21 May 2018 15:37:32 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Mon, 21 May 2018 17:37:12 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: stefanha@redhat.com Subject: [libvirt] [PATCH 2/9] qemu: prepare for missing interface model X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 21 May 2018 15:40:42 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Use STREQ_NULLABLE instead of STREQ to allow future addition of interface types that do not have models. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_domain_address.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9da2d609e8..1f03cc70fe 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3375,7 +3375,7 @@ qemuBuildNicDevStr(virDomainDefPtr def, bool usingVirtio =3D false; char macaddr[VIR_MAC_STRING_BUFLEN]; =20 - if (STREQ(net->model, "virtio")) { + if (STREQ_NULLABLE(net->model, "virtio")) { if (net->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) nic =3D "virtio-net-ccw"; else if (net->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRT= IO_S390) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index b7c82cb6f1..c93e6fd8b2 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -622,14 +622,14 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDev= iceDefPtr dev, * addresses for other hostdev devices. */ if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_HOSTDEV || - STREQ(net->model, "usb-net")) { + STREQ_NULLABLE(net->model, "usb-net")) { return 0; } =20 - if (STREQ(net->model, "virtio")) + if (STREQ_NULLABLE(net->model, "virtio")) return virtioFlags; =20 - if (STREQ(net->model, "e1000e")) + if (STREQ_NULLABLE(net->model, "e1000e")) return pcieFlags; =20 return pciFlags; --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list