From nobody Sun Feb 8 10:03:18 2026 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=1607961375; cv=none; d=zohomail.com; s=zohoarc; b=feJyVAw30xUqB8mzF7aW1PBckEUUsVssQuZaFZNUEYelEbkXeSAv2Q2jjIHLw5bdg229i4Et0PGZ7Nkmshs4bTmWeifPsPKehsjcLTTttezFmgdUNC43TJXF3l8A626rEBJmHVE+Y+T4p357ICgOflly1kaCmsHNg/Do+kDzUCo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607961375; 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=RaPMPzkry3kAg5Me7gf0Ezi4HSr54Gr4FtfebKV5s/w=; b=Fc7v3kKRVyxPcLEyxdtSSWRKisiB56buBnoOhC3znzWlriJbwabKLIZX/N8P4YjYO3h9x9Z921oUchJnnzkDH3dBlidR6NVZGHa11ZSQItplSyVBnaPGrR4jngpejibo6qkMoITgCyNUugJWx4gY22TlL0ntzB+0Lm4DzItimvE= 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 1607961375865902.9638405035118; Mon, 14 Dec 2020 07:56:15 -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-491-QZGs1-_1PnWKDu2tWgBuxQ-1; Mon, 14 Dec 2020 10:56:11 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C3ABC1005513; Mon, 14 Dec 2020 15:56:04 +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 9EF0C36FA; Mon, 14 Dec 2020 15:56:04 +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 526101809CA6; Mon, 14 Dec 2020 15:56:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BEFtieb028494 for ; Mon, 14 Dec 2020 10:55:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 393FB17B77; Mon, 14 Dec 2020 15:55:44 +0000 (UTC) Received: from antique-work.lan (unknown [10.40.194.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id A95915D6D5 for ; Mon, 14 Dec 2020 15:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607961373; 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=RaPMPzkry3kAg5Me7gf0Ezi4HSr54Gr4FtfebKV5s/w=; b=S9enPArsuv50kvN+dS7YL7gZC2Xqz930SFkc2ah67+7fJwYSTCuOtr7QK3aHdPYE/Sd8JE QJVPOYe0aJAaGMmXLwiV0fixoFy58xOI+syuUl6q8EXhbQlNvdCM3q2CJVVbmhSci2y3dk L4wSd0EieFOGCYHZeFwXdOGSyp3yc74= X-MC-Unique: QZGs1-_1PnWKDu2tWgBuxQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 01/17] util: remove unused virStorageGenerateQcowPassphrase Date: Mon, 14 Dec 2020 16:55:21 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.13 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) Content-Type: text/plain; charset="utf-8" The last user was removed by commit <40f0e0348dfc84f28a500e262c4953b0d3b44fa0>. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/virstorageencryption.c | 34 --------------------------------- src/util/virstorageencryption.h | 2 -- 3 files changed, 37 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index d0e548b0a3..8e1d101a97 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3117,7 +3117,6 @@ virSocketAddrSetPort; virStorageEncryptionFormat; virStorageEncryptionFree; virStorageEncryptionParseNode; -virStorageGenerateQcowPassphrase; =20 =20 # util/virstoragefile.h diff --git a/src/util/virstorageencryption.c b/src/util/virstorageencryptio= n.c index a330b79637..c893f0babe 100644 --- a/src/util/virstorageencryption.c +++ b/src/util/virstorageencryption.c @@ -364,37 +364,3 @@ virStorageEncryptionFormat(virBufferPtr buf, =20 return 0; } - -int -virStorageGenerateQcowPassphrase(unsigned char *dest) -{ - int fd; - size_t i; - - /* A qcow passphrase is up to 16 bytes, with any data following a NUL - ignored. Prohibit control and non-ASCII characters to avoid possib= le - unpleasant surprises with the qemu monitor input mechanism. */ - fd =3D open("/dev/urandom", O_RDONLY); - if (fd < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Cannot open /dev/urandom")); - return -1; - } - i =3D 0; - while (i < VIR_STORAGE_QCOW_PASSPHRASE_SIZE) { - ssize_t r; - - while ((r =3D read(fd, dest + i, 1)) =3D=3D -1 && errno =3D=3D EIN= TR) - ; - if (r <=3D 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Cannot read from /dev/urandom")); - VIR_FORCE_CLOSE(fd); - return -1; - } - if (dest[i] >=3D 0x20 && dest[i] <=3D 0x7E) - i++; /* Got an acceptable character */ - } - VIR_FORCE_CLOSE(fd); - return 0; -} diff --git a/src/util/virstorageencryption.h b/src/util/virstorageencryptio= n.h index 05a7bffdfc..352dd373d6 100644 --- a/src/util/virstorageencryption.h +++ b/src/util/virstorageencryption.h @@ -90,5 +90,3 @@ int virStorageEncryptionFormat(virBufferPtr buf, enum { VIR_STORAGE_QCOW_PASSPHRASE_SIZE =3D 16 }; - -int virStorageGenerateQcowPassphrase(unsigned char *dest); --=20 2.28.0