From nobody Fri Apr 26 18:06:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1605782033; cv=none; d=zohomail.com; s=zohoarc; b=OO5BEH/0347Inr4ObZc8YvASCJ/7JNBi3fhla22XIeQMevPMqFVKwHyiyWlnAD4TntjeqStepA6d0t8e35WoschytiDVzK0qof8fPwRaFirfG3lGZ0YiyjFtaCHQObQ3Fo9hBwqydJjeh+YCjWcScm74lX/QQTbI8xCkuqaRLfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605782033; 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=VkC2q98edAyVF+GK4QeID2sdPrD0FkJfDij0m4IMWww=; b=LF4Hs5WalqPU62LllMVZkRWAu73sepVOOXH+xfxZOezkUb9F2zgsBJ2kuUNI3d0tdm+n58K+ReEgctEWjQgeIl/QyZCBUGRZFCbdd5PUdSz72+Gh5SIlWKIae+mOWz3mXkJRLB7fybndCPrkBjkXFdyKH2MfIqhBWUK1pCUlabs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605782033842313.8075011483953; Thu, 19 Nov 2020 02:33:53 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-9T0wjDc5MHGpTkaRmB05iQ-1; Thu, 19 Nov 2020 05:33:50 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4342B18A8223; Thu, 19 Nov 2020 10:33:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F34B60BE2; Thu, 19 Nov 2020 10:33:44 +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 DB6071809C9F; Thu, 19 Nov 2020 10:33:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AJAXcsh004326 for ; Thu, 19 Nov 2020 05:33:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2779519C48; Thu, 19 Nov 2020 10:33:38 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 705FB19C47 for ; Thu, 19 Nov 2020 10:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605782032; 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=VkC2q98edAyVF+GK4QeID2sdPrD0FkJfDij0m4IMWww=; b=cXzTlAvr5+INPN4gHz9vaa+m9AVpe6mLddXmHLW2TIj4ewTEk8nEyrQHQYgYs0dHWxnRlr w1nXpFSbga28VqFZpmA/pVFJiooP978Db1bIR3/IZGu1wjr2d34ejKpFAuvTcaeiOld31d 6cdDSCtXKRiNxY7gc2heN7sHRk2HNzs= X-MC-Unique: 9T0wjDc5MHGpTkaRmB05iQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] openvzDomainMigratePrepare3Params: correctly use hostname Date: Thu, 19 Nov 2020 11:33:27 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) In case no uri_in was supplied, we forgot to set the hostname to the current hostname and formatted a useless uri_out. src/util/glibcompat.h:57:26: error: =E2=80=98%s=E2=80=99 directive argument= is null [-Werror=3Dformat-overflow=3D] 57 | # define g_strdup_printf vir_g_strdup_printf src/openvz/openvz_driver.c:2136:16: note: in expansion of macro =E2=80=98g_= strdup_printf=E2=80=99 2136 | *uri_out =3D g_strdup_printf("ssh://%s", hostname); Signed-off-by: J=C3=A1n Tomko Reported-by: Jaroslav Suchanek Fixes: e3c626a61d6c3d808555653684c0fb1e7c4d74ec Reviewed-by: Erik Skultety --- src/openvz/openvz_driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 62bf418027..4fa7511f88 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -2113,6 +2113,8 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn, " but migration requires an FQDN")); goto error; } + + hostname =3D my_hostname; } else { uri =3D virURIParse(uri_in); =20 --=20 2.26.2 From nobody Fri Apr 26 18:06:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1605782047; cv=none; d=zohomail.com; s=zohoarc; b=U1jL8vXWTkXM1Fi0592TUeFMulGu8BA7vs9qBUgNmQ7ngdj7ZWjL8U2RmdIKs6SelF24nr/RVr72ZTMzQ66AnfM0fsBDTIAjeP3y70pajC5+URAW9mHxUjCcr4nnzR4jepmT+JR7cc0jBcbLEqC3fQcGZa4IS2fXCMs2GJpmWoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605782047; 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=XABZV9WXUwwofJcueIEzMBwOaMrlZz2LuA0PXXvx2rY=; b=alDVzZ6HvwheUEDrkZMbgDlM3/2OJkmv8V+yDTn0lIYQrJsQ/I6vePN4Xf5asw1/+mfx/YFPrNrdXXLTRvuykoO//q/gVNfh5ponMOOJKJqHk7HZATl4u/4i0vTWGPcw2X1CDsPdGOU/6WwqI69voodrLvlgSL1f8yJ3+f7rQGk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1605782047632549.5300131680411; Thu, 19 Nov 2020 02:34:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-xufzbs3KOYarhfa7sWvjPQ-1; Thu, 19 Nov 2020 05:33:53 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 169F8801B18; Thu, 19 Nov 2020 10:33:47 +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 E037619C47; Thu, 19 Nov 2020 10:33:46 +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 AE5714E590; Thu, 19 Nov 2020 10:33:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AJAXdOK004333 for ; Thu, 19 Nov 2020 05:33:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4898C19C48; Thu, 19 Nov 2020 10:33:39 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id A363F19C47 for ; Thu, 19 Nov 2020 10:33:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605782046; 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=XABZV9WXUwwofJcueIEzMBwOaMrlZz2LuA0PXXvx2rY=; b=BoYVikIcz2bD1ut9glmRGwZk3uPQu/chyvg+0Phu6Igsz1+0x8JqV69Q6cgowS0b1FRElB R+WoLmPwDo8QubUumySFDjRQ45NN3td+WnpAtsuKKbVxR1lz/thDAW6SmsWKmqlsibxSjx XWn9uQT+mwrU0BPFpI0umj2ESvAo2Jg= X-MC-Unique: xufzbs3KOYarhfa7sWvjPQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] openvzDomainMigratePrepare3Params: remove else after goto Date: Thu, 19 Nov 2020 11:33:28 +0100 Message-Id: <9b560ac7c62e63e62673e80c89ac13f2f9464be4.1605781932.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) We jump to the error label if the 'if' condition is true. Remove the explicit else to make it more obvious that 'hostname' is filled on both branches of 'if (!uri_in)'. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Erik Skultety --- src/openvz/openvz_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 4fa7511f88..c6b7e21e7a 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -2130,9 +2130,9 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn, _("missing host in migration URI: %s"), uri_in); goto error; - } else { - hostname =3D uri->server; } + + hostname =3D uri->server; } =20 *uri_out =3D g_strdup_printf("ssh://%s", hostname); --=20 2.26.2 From nobody Fri Apr 26 18:06:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1605782044; cv=none; d=zohomail.com; s=zohoarc; b=L4jmsb/lvh9RxJvrCyaVNCur+zWc6DdOQHs880LgojuqgtUul8zd4CaH8ytBZXQ4UJ/UousWH3HoSTR2M6inltEL8dziEPx4iE2EeykRnhF8m8VXYQNMbkKpQv3KDMh4//6H7vf651vwqSqhkdCpOzFCyVHW4K7EglXJqHZ3RxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605782044; 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=1xyu6krEsLDotmMzdn6rCEiEhXYf/qkIhlnkkAZurkE=; b=iiHm58kPL5ujfZ78NCDarNCpIVuQZG/z7oHawXmyf1sn3xAwf4YVFifFMjNdM/WIZedA6z9kyipiU6Qc8gS7nx26NzFkaBIgwr9Gw3p5/duYspF0w7obHpSnJbHqmTgj8pqcJ70QuH2qwiNHR6xSmongtaoRbzg7BDHQwjOCcgM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 160578204494243.23669061368366; Thu, 19 Nov 2020 02:34:04 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-ollh73DgMXStixwrHpwedg-1; Thu, 19 Nov 2020 05:33:47 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1DAE107ACE8; Thu, 19 Nov 2020 10:33:42 +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 B3F4560C0F; Thu, 19 Nov 2020 10:33:42 +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 320AA4A7C7; Thu, 19 Nov 2020 10:33:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AJAXe40004346 for ; Thu, 19 Nov 2020 05:33:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4817E19C48; Thu, 19 Nov 2020 10:33:40 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id A595E19C47 for ; Thu, 19 Nov 2020 10:33:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605782044; 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=1xyu6krEsLDotmMzdn6rCEiEhXYf/qkIhlnkkAZurkE=; b=Np1Xq5X6WJdlh1mCrpUzthf18bKWozlU/oP8Sb7V6NBwN0RKGP/Z+XY8ae46ZrcLZ+hd4A r2huPiRhIvrXbQr5ul5fhoFqaN8Se1XTeKMO6LHctMVmWrMS02e4QmUJEEzksFLVOcHIdv 1qjNae4AyIEPH/VljidfVFT8Sla4ZvY= X-MC-Unique: ollh73DgMXStixwrHpwedg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] openvzDomainMigratePrepare3Params: use g_auto Date: Thu, 19 Nov 2020 11:33:29 +0100 Message-Id: <4e37f1adfc4a3973f0f1994a8c8a1ffa9aa2b577.1605781932.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Erik Skultety --- src/openvz/openvz_driver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index c6b7e21e7a..96535a8216 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -2067,9 +2067,9 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn, const char *uri_in =3D NULL; virDomainDefPtr def =3D NULL; virDomainObjPtr vm =3D NULL; - char *my_hostname =3D NULL; + g_autofree char *my_hostname =3D NULL; const char *hostname =3D NULL; - virURIPtr uri =3D NULL; + g_autoptr(virURI) uri =3D NULL; int ret =3D -1; =20 if (virTypedParamsValidate(params, nparams, OPENVZ_MIGRATION_PARAMETER= S) < 0) @@ -2146,8 +2146,6 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn, virDomainObjListRemove(driver->domains, vm); =20 done: - VIR_FREE(my_hostname); - virURIFree(uri); virDomainObjEndAPI(&vm); return ret; } --=20 2.26.2