From nobody Tue Mar 24 01:18:54 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; dkim=fail; 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1774016344; cv=none; d=zohomail.com; s=zohoarc; b=hUkUn5xElEKNWk2X6k/9RjjZjiwkLEVPcjc6fhYYAsQaWGZbe79tYToW62ZC2EdWSM0eLKzn+9bD0aPDcVlxuHw3u5+esYwv45/nguJPEI6jzqUN9QWEkaUOxeNuVFJYEdg60Ce5mFGK1ExNN3qoPfW0NosGSYkUXsmes3xUqQM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774016344; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=S2XOIRHJVhQ5f/ojuFzqQeZzh+y9ggOUY3Vtxph5i0Y=; b=j5c4chYySDfl8AQXeFqwlA4GASPbbjXY9W/7wmtIJ2V4A+c3oTPswzL0wlKHstqq/+6JrqriF79uJzI1ds1H1rYRdZhqjLKxY1Yl0eQN5HOdzCHKh6caf1lQohh6FNcI9/sav1RGVvWavNNBHB7l7qeGD5LPJkeL1Mxr8h65kQI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1774016344062642.2562294546618; Fri, 20 Mar 2026 07:19:04 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 3252C41A55; Fri, 20 Mar 2026 10:19:03 -0400 (EDT) Received: from [172.19.199.12] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 8B43841B87; Fri, 20 Mar 2026 10:16:50 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2B93041818; Fri, 20 Mar 2026 10:16:46 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id AB1154180D for ; Fri, 20 Mar 2026 10:16:45 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-587-vNQCLdwMPkaoZF1vPM_2_w-1; Fri, 20 Mar 2026 10:16:44 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3385B1800345 for ; Fri, 20 Mar 2026 14:16:43 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.45.242.5]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8317B30002DF for ; Fri, 20 Mar 2026 14:16:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774016205; h=from:from: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; bh=S2XOIRHJVhQ5f/ojuFzqQeZzh+y9ggOUY3Vtxph5i0Y=; b=Ap9jsaVqsOLZ6wHZx4zAILWkxyZD5XN7h+4kVvsaGenmowLCYhQDMtepeeXNqA+JknIFBl I6j678vuNc6xaHcPvKp1dKvIisoQtBOlLa6+hwkx3wjHWqBA/xlqu3K5GAMq46v9hZU6eE RG/5rKqortp88AHKjKmzOWiNLsSCSCI= X-MC-Unique: vNQCLdwMPkaoZF1vPM_2_w-1 X-Mimecast-MFC-AGG-ID: vNQCLdwMPkaoZF1vPM_2_w_1774016203 To: devel@lists.libvirt.org Subject: [PATCH 2/3] qemu: conf: Don't use VIR_ERR_INTERNAL_ERROR for config file parsing errors Date: Fri, 20 Mar 2026 15:16:37 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: wmsvHU9WRUpDKrh-aeNFv7eG2RkbyxsZHK8Uv1VP3d8_1774016203 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: W75PNSDJQPKNGSDXH3BGJLJZJ43RXBLH X-Message-ID-Hash: W75PNSDJQPKNGSDXH3BGJLJZJ43RXBLH X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1774016345591158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa When parsing port ranges for the port allocator VIR_ERR_INTERNAL_ERROR is not the right error code for errors on the user-supplied numbers. Use VIR_ERR_CONF_SYNTAX instead. Signed-off-by: Peter Krempa --- src/qemu/qemu_conf.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index d43e0c2b97..712422f995 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -626,7 +626,7 @@ virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriver= Config *cfg, /* if the port is too low, we can't get the display name * to tell to vnc (usually subtract 5700, e.g. localhost:1 * for port 5701) */ - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_CONF_SYNTAX, _("%1$s: remote_websocket_port_min: port must be gr= eater than or equal to %2$d"), filename, QEMU_WEBSOCKET_PORT_MIN); return -1; @@ -636,14 +636,14 @@ virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriv= erConfig *cfg, return -1; if (cfg->webSocketPortMax > QEMU_WEBSOCKET_PORT_MAX || cfg->webSocketPortMax < cfg->webSocketPortMin) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_CONF_SYNTAX, _("%1$s: remote_websocket_port_max: port must be b= etween the minimal port and %2$d"), filename, QEMU_WEBSOCKET_PORT_MAX); return -1; } if (cfg->webSocketPortMin > cfg->webSocketPortMax) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_CONF_SYNTAX, _("%1$s: remote_websocket_port_min: min port must = not be greater than max port"), filename); return -1; @@ -655,7 +655,7 @@ virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriver= Config *cfg, /* if the port is too low, we can't get the display name * to tell to vnc (usually subtract 5900, e.g. localhost:1 * for port 5901) */ - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_CONF_SYNTAX, _("%1$s: remote_display_port_min: port must be grea= ter than or equal to %2$d"), filename, QEMU_REMOTE_PORT_MIN); return -1; @@ -665,14 +665,14 @@ virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriv= erConfig *cfg, return -1; if (cfg->remotePortMax > QEMU_REMOTE_PORT_MAX || cfg->remotePortMax < cfg->remotePortMin) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_CONF_SYNTAX, _("%1$s: remote_display_port_max: port must be bet= ween the minimal port and %2$d"), filename, QEMU_REMOTE_PORT_MAX); return -1; } if (cfg->remotePortMin > cfg->remotePortMax) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_CONF_SYNTAX, _("%1$s: remote_display_port_min: min port must no= t be greater than max port"), filename); return -1; @@ -979,7 +979,7 @@ virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConfig= *cfg, if (virConfGetValueUInt(conf, "migration_port_min", &cfg->migrationPor= tMin) < 0) return -1; if (cfg->migrationPortMin <=3D 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_CONF_SYNTAX, _("%1$s: migration_port_min: port must be greater t= han 0"), filename); return -1; @@ -989,7 +989,7 @@ virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConfig= *cfg, return -1; if (cfg->migrationPortMax > 65535 || cfg->migrationPortMax < cfg->migrationPortMin) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_CONF_SYNTAX, _("%1$s: migration_port_max: port must be between = the minimal port %2$d and 65535"), filename, cfg->migrationPortMin); return -1; @@ -998,7 +998,7 @@ virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConfig= *cfg, if (virConfGetValueUInt(conf, "backup_port_min", &cfg->backupPortMin) = < 0) return -1; if (cfg->backupPortMin <=3D 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_CONF_SYNTAX, _("%1$s: backup_port_min: port must be greater than= 0"), filename); return -1; @@ -1008,7 +1008,7 @@ virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConf= ig *cfg, return -1; if (cfg->backupPortMax > 65535 || cfg->backupPortMax < cfg->backupPortMin) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_CONF_SYNTAX, _("%1$s: backup_port_max: port must be between the= minimal port %2$d and 65535"), filename, cfg->backupPortMin); return -1; --=20 2.53.0