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 A11E15A0268 for ; Mon, 9 Jan 2023 05:11:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673237475; 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=3dNPnz4WIETZj3V/4yJIIHXObcS68i0G5QW/xMlEk4w=; b=btCEHbmnLEzn5h/J8tgqFr0IsQXwDU+Lwj/6t8ksu/GfFW4UWabKegZn1MVG8s89iXHZYR 1nSg/ws4dpw7rVjbMSEL8X0UfJ5xQkcIDoNoDyE/Td4aC0tFGFyoZP4WHdrBUi4FMPlM/Y aKWZD4z33pvprmj/flz5FzPhKQdJSDc= 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-192-HrMAwuPFP5ynr7d2rbKBjw-1; Sun, 08 Jan 2023 23:11:13 -0500 X-MC-Unique: HrMAwuPFP5ynr7d2rbKBjw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9429B858F09 for ; Mon, 9 Jan 2023 04:11:13 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.2.16.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 740F41121314; Mon, 9 Jan 2023 04:11:13 +0000 (UTC) From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 1/9] conf: rename virDomainNetBackend* to virDomainNetDriver* Date: Sun, 8 Jan 2023 23:11:04 -0500 Message-Id: <20230109041112.368790-2-laine@redhat.com> In-Reply-To: <20230109041112.368790-1-laine@redhat.com> References: <20230109041112.368790-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: BBRIXYGSM6EC7NM2IXYLZ7HV6G3BMVJQ X-Message-ID-Hash: BBRIXYGSM6EC7NM2IXYLZ7HV6G3BMVJQ X-MailFrom: laine@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header 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: This fits better with the element containing the value (), and allows us to use virDomainNetBackend* for things in the element. Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 8 ++++---- src/conf/domain_conf.h | 14 +++++++------- src/qemu/qemu_interface.c | 8 ++++---- src/security/virt-aa-helper.c | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a180398b14..30b0cef131 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -604,8 +604,8 @@ VIR_ENUM_IMPL(virDomainNetModel, "82543GC", ); -VIR_ENUM_IMPL(virDomainNetBackend, - VIR_DOMAIN_NET_BACKEND_TYPE_LAST, +VIR_ENUM_IMPL(virDomainNetDriver, + VIR_DOMAIN_NET_DRIVER_TYPE_LAST, "default", "qemu", "vhost", @@ -8862,7 +8862,7 @@ virDomainNetDefParseXMLDriver(virDomainNetDef *def, xmlNodePtr guestNode; if (virXMLPropEnum(driver_node, "name", - virDomainNetBackendTypeFromString, + virDomainNetDriverTypeFromString, VIR_XML_PROP_NONZERO, &def->driver.virtio.name) < 0) return -1; @@ -23190,7 +23190,7 @@ virDomainVirtioNetDriverFormat(virBuffer *buf, { if (def->driver.virtio.name) { virBufferAsprintf(buf, " name='%s'", - virDomainNetBackendTypeToString(def->driver.virtio.name)); + virDomainNetDriverTypeToString(def->driver.virtio.name)); } if (def->driver.virtio.txmode) { virBufferAsprintf(buf, " txmode='%s'", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c19dfc5470..61d2ee819b 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -975,12 +975,12 @@ typedef enum { /* the backend driver used for virtio interfaces */ typedef enum { - VIR_DOMAIN_NET_BACKEND_TYPE_DEFAULT = 0, /* prefer kernel, fall back to user */ - VIR_DOMAIN_NET_BACKEND_TYPE_QEMU, /* userland */ - VIR_DOMAIN_NET_BACKEND_TYPE_VHOST, /* kernel */ + VIR_DOMAIN_NET_DRIVER_TYPE_DEFAULT = 0, /* prefer kernel, fall back to user */ + VIR_DOMAIN_NET_DRIVER_TYPE_QEMU, /* userland */ + VIR_DOMAIN_NET_DRIVER_TYPE_VHOST, /* kernel */ - VIR_DOMAIN_NET_BACKEND_TYPE_LAST -} virDomainNetBackendType; + VIR_DOMAIN_NET_DRIVER_TYPE_LAST +} virDomainNetDriverType; /* the TX algorithm used for virtio interfaces */ typedef enum { @@ -1062,7 +1062,7 @@ struct _virDomainNetDef { char *modelstr; union { struct { - virDomainNetBackendType name; /* which driver backend to use */ + virDomainNetDriverType name; /* which driver backend to use */ virDomainNetVirtioTxModeType txmode; virTristateSwitch ioeventfd; virTristateSwitch event_idx; @@ -4020,7 +4020,7 @@ VIR_ENUM_DECL(virDomainFSModel); VIR_ENUM_DECL(virDomainFSCacheMode); VIR_ENUM_DECL(virDomainFSSandboxMode); VIR_ENUM_DECL(virDomainNet); -VIR_ENUM_DECL(virDomainNetBackend); +VIR_ENUM_DECL(virDomainNetDriver); VIR_ENUM_DECL(virDomainNetVirtioTxMode); VIR_ENUM_DECL(virDomainNetMacType); VIR_ENUM_DECL(virDomainNetTeaming); diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index 264d5e060c..b6895cedde 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -719,14 +719,14 @@ qemuInterfaceOpenVhostNet(virDomainObj *vm, /* If running a plain QEMU guest, or * if the config says explicitly to not use vhost, return now */ if (vm->def->virtType != VIR_DOMAIN_VIRT_KVM || - net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_QEMU) + net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_QEMU) return 0; /* If qemu doesn't support vhost-net mode (including the -netdev and * -device command options), don't try to open the device. */ if (!qemuDomainSupportsNicdev(vm->def, net)) { - if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) { + if (net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_VHOST) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("vhost-net is not supported with this QEMU binary")); return -1; @@ -736,7 +736,7 @@ qemuInterfaceOpenVhostNet(virDomainObj *vm, /* If the nic model isn't virtio, don't try to open. */ if (!virDomainNetIsVirtioModel(net)) { - if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) { + if (net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_VHOST) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("vhost-net is only supported for virtio network interfaces")); return -1; @@ -753,7 +753,7 @@ qemuInterfaceOpenVhostNet(virDomainObj *vm, */ if (fd < 0) { virDomainAuditNetDevice(vm->def, net, vhostnet_path, false); - if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) { + if (net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_VHOST) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("vhost-net was requested for an interface, but is unavailable")); return -1; diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 53a1cd1048..62a20ba0e8 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1282,7 +1282,7 @@ get_files(vahControl * ctl) for (i = 0; i < ctl->def->nnets; i++) { virDomainNetDef *net = ctl->def->nets[i]; if (net && virDomainNetGetModelString(net)) { - if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_QEMU) + if (net->driver.virtio.name == VIR_DOMAIN_NET_DRIVER_TYPE_QEMU) continue; if (!virDomainNetIsVirtioModel(net)) continue; -- 2.38.1