From nobody Sun May 12 20:07:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1646748903; cv=none; d=zohomail.com; s=zohoarc; b=jtV5hC3Q4aUP04brYngZiCmb7eHIkvdc5ckyeNKGf+5QoCE2ME5siXPr8EjBFGf6NLCeiNYwnJ9H7J+9PQp2ElloQSpn760/E3RCmPVxCYi3qWS3fZvCyiC+C5zKaY5jk8AJ/gyNFQkrP7FKbN7V+iGy/oxT00hMACxyU+rxzVo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646748903; 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=HyNRxXKOLsT+qPEB8mn7HtCziZuKie9R351x5l7p8EI=; b=aNpgBq+HV8trmutc1dM8210r4XAi02Gdav8kbdur/s/ycgX20NZWz/WQzAIz/LAGlQdcOmKIuZnJpJIQ0713Y7S/ZL51XtyXjDAUZ35pCd8hbf6qQikiKMATs3/iEP+GRAVVmzljm9o/g6vR4X83sIY5zonoDFq8b9+qKKmcF6I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 164674890370367.93697348038245; Tue, 8 Mar 2022 06:15:03 -0800 (PST) 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-507-Ik9R5mvCNuevR6lQgtOugQ-1; Tue, 08 Mar 2022 09:14:04 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BD884803D62; Tue, 8 Mar 2022 14:14:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E9C314582F2; Tue, 8 Mar 2022 14:14:01 +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 50C8E196BBB3; Tue, 8 Mar 2022 14:13:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 031991931BD6 for ; Tue, 8 Mar 2022 14:13:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B855C7B8E4; Tue, 8 Mar 2022 14:13:57 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 434037BCD7 for ; Tue, 8 Mar 2022 14:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646748902; 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=HyNRxXKOLsT+qPEB8mn7HtCziZuKie9R351x5l7p8EI=; b=FyUwUtIwXGmgyhFtKWs35kUTCS/K1of61gKD9vN2ax9SRU9yauntffpxuFs355CSDaUMax O94EcJZ/1tcuUajRaolaZx7LagkiNdZXpA2HuSOBhqfiL3/QEZzAcmTBZ5nbULeglmokKv kezvWwhFgT7+6LWwd6dEIB1IOvMhAD4= X-MC-Unique: Ik9R5mvCNuevR6lQgtOugQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/2] libvirt-qemu: Don't allow NULL cmd in virDomainQemuMonitorCommandWithFiles() Date: Tue, 8 Mar 2022 15:13:51 +0100 Message-Id: <69fb3129f40929276a8714ee27e9331cf07ee5b6.1646748799.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1646748904645100001 Content-Type: text/plain; charset="utf-8" Nothing in daemon code is prepared for the command in virDomainQemuMonitorCommandWithFiles() to be NULL. In fact, the client side doesn't expect this either as our RPC describes the argument as: remote_nonnull_string cmd; Validate the argument in the public API implementation. Signed-off-by: Michal Privoznik --- src/libvirt-qemu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c index 9e80577b56..c4f71c0311 100644 --- a/src/libvirt-qemu.c +++ b/src/libvirt-qemu.c @@ -153,6 +153,8 @@ virDomainQemuMonitorCommandWithFiles(virDomainPtr domai= n, virCheckDomainReturn(domain, -1); conn =3D domain->conn; =20 + virCheckNonNullArgGoto(cmd, error); + if (ninfiles > 0 || outfiles) { int rc; if ((rc =3D VIR_DRV_SUPPORTS_FEATURE(conn->driver, conn, --=20 2.34.1 From nobody Sun May 12 20:07:06 2024 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=1646748848; cv=none; d=zohomail.com; s=zohoarc; b=dxrsim/2z808+7LH8JKxHJKtDqFvz/kaOafXWR+NujfCGcAoRZLWQNUg5WMC0hsUzMtVYCSUMKXTQWOcikNJViTZu+sQk2DOkzep2PNR/6eK630pBiRmsQks6m4eLoIsP2Ppzy41tblYPF8QXBpfd+QURYSwhxpSeOUJcbq6FJo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646748848; 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=1Y9G524aFnu4chW6qcG4pqE39t6dbj+RwWlN+JXEso8=; b=imbfroRRxhn2hjFWv41CRica2n6t/xYOgfcmr4M1lhK3qvU06kKFxYKrfclvh0dnZ4uYbYNFgWFaEMqmR01cwOPWGG9WNmqVIoLrTdGa+S8s9HQ2vQEBHcA3d6MqLF3Kif3YC0gIcHPtDbZkeQdPTG2F8iaMZ63+GywBNkmDeDg= 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 1646748848268345.0076268812436; Tue, 8 Mar 2022 06:14:08 -0800 (PST) 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-643-Env2GDJ2MoG0PYibItwx3g-1; Tue, 08 Mar 2022 09:14:04 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BDDF2188120E; Tue, 8 Mar 2022 14:14:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BD43404779C; Tue, 8 Mar 2022 14:14:01 +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 66DDC196BBBE; Tue, 8 Mar 2022 14:13:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E9BB01931BD6 for ; Tue, 8 Mar 2022 14:13:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 856707B8E4; Tue, 8 Mar 2022 14:13:58 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1038A7BCD5 for ; Tue, 8 Mar 2022 14:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646748847; 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=1Y9G524aFnu4chW6qcG4pqE39t6dbj+RwWlN+JXEso8=; b=B2NNI61LqsZ4N3n3tpH1Nj7HKXG/HRSWI5lFlQVCJqWOKsIjID2TXRCaCPTq9c4A5vCHlc XlUPwkkQnkWInqkka0M/dmTXYc0xvqxXr9vJNX277SlNF9qjoQ7hiKxGUAr6hGZ0o69uyk AdJUoefGVEvyJZS+oblgMMSuGZX9nmM= X-MC-Unique: Env2GDJ2MoG0PYibItwx3g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] libvirt-qemu: Fix capitalization of QEMU Date: Tue, 8 Mar 2022 15:13:52 +0100 Message-Id: <126484dcfbc1aa11b7a8fc4aaf3cee436d786cee.1646748799.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1646748848716100003 Content-Type: text/plain; charset="utf-8" In plenty of places we mention qemu, Qemu but the correct form is all capitals. Signed-off-by: Michal Privoznik --- src/libvirt-qemu.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c index c4f71c0311..896aba2f0b 100644 --- a/src/libvirt-qemu.c +++ b/src/libvirt-qemu.c @@ -1,5 +1,5 @@ /* - * libvirt-qemu.c: Interfaces for the libvirt library to handle qemu-speci= fic + * libvirt-qemu.c: Interfaces for the libvirt library to handle QEMU-speci= fic * APIs. * * Copyright (C) 2010-2014 Red Hat, Inc. @@ -33,7 +33,7 @@ VIR_LOG_INIT("libvirt-qemu"); /** * virDomainQemuMonitorCommand: * @domain: a domain object - * @cmd: the qemu monitor command string + * @cmd: the QEMU monitor command string * @result: a string returned by @cmd * @flags: bitwise-or of supported virDomainQemuMonitorCommandFlags * @@ -41,14 +41,14 @@ VIR_LOG_INIT("libvirt-qemu"); * connections to the QEMU driver. * * Send an arbitrary monitor command @cmd to @domain through the - * qemu monitor. There are several requirements to safely and + * QEMU monitor. There are several requirements to safely and * successfully use this API: * * - A @cmd that queries state without making any modifications is safe * - A @cmd that alters state that is also tracked by libvirt is unsafe, * and may cause libvirtd to crash * - A @cmd that alters state not tracked by the current version of - * libvirt is possible as a means to test new qemu features before + * libvirt is possible as a means to test new QEMU features before * they have support in libvirt, but no guarantees are made to safety * * If VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP is set, the command is @@ -99,9 +99,9 @@ virDomainQemuMonitorCommand(virDomainPtr domain, const ch= ar *cmd, /** * virDomainQemuMonitorCommandWithFiles: * @domain: a domain object - * @cmd: the qemu monitor command string + * @cmd: the QEMU monitor command string * @ninfiles: number of filedescriptors passed in @infiles - * @infiles: filedescriptors to be passed to qemu with the command + * @infiles: filedescriptors to be passed to QEMU with the command * @noutfiles: if non-NULL filled with number of returned file descriptors * @outfiles: if non-NULL filled with an array of returned file descriptors * @result: a string returned by @cmd @@ -111,7 +111,7 @@ virDomainQemuMonitorCommand(virDomainPtr domain, const = char *cmd, * connections to the QEMU driver with local connections using the unix so= cket. * * Send an arbitrary monitor command @cmd with file descriptors @infiles to - * @domain through the qemu monitor and optionally return file descriptors= via + * @domain through the QEMU monitor and optionally return file descriptors= via * @outfiles. There are several requirements to safely and successfully use * this API: * @@ -119,7 +119,7 @@ virDomainQemuMonitorCommand(virDomainPtr domain, const = char *cmd, * - A @cmd that alters state that is also tracked by libvirt is unsafe, * and may cause libvirtd to crash * - A @cmd that alters state not tracked by the current version of - * libvirt is possible as a means to test new qemu features before + * libvirt is possible as a means to test new QEMU features before * they have support in libvirt, but no guarantees are made to safety * * If VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP is set, the command is @@ -321,10 +321,10 @@ virDomainQemuAgentCommand(virDomainPtr domain, * This API is QEMU specific, so it will only work with hypervisor * connections to the QEMU driver. * - * Adds a callback to receive notifications of arbitrary qemu monitor even= ts - * occurring on a domain. Many qemu monitor events also result in a libvi= rt + * Adds a callback to receive notifications of arbitrary QEMU monitor even= ts + * occurring on a domain. Many QEMU monitor events also result in a libvi= rt * event which can be delivered via virConnectDomainEventRegisterAny(); th= is - * command is primarily for testing new qemu events that have not yet been + * command is primarily for testing new QEMU events that have not yet been * given a libvirt counterpart event. * * If @dom is NULL, then events will be monitored for any domain. If @dom --=20 2.34.1