From nobody Sun Apr 28 10:40:46 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=1598270021; cv=none; d=zohomail.com; s=zohoarc; b=OvMuyV4uVrQy+Q2Klf0qKKLOO6cTeGN06KuwbQzWQ2deoV54Yri1lTAksOzdK/0Ev+ZAy5fMBPHpVhbOErOZxmN75y5WiFmxVfnk/wY2V8fgAQyeKfp2X3SQ+c8zrvfdfEkeeSKak/12cO/OFMnSca4OCYAy0syVE5vYY16ntGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270021; 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=2Yy555FXClJx2IvWekEhCBP9iASP2IC+e6sBu+Z/vDU=; b=l0qAvJ2m9gObwMc3W8hJcfR1sp+tx2Q/SyIy3O3o8YoKCfwiu0q4rc7KGFjUxifcw1YgSj7oPO8oIVv5HSL0ZYN+Aq+5jl5LORl0a2y4d9Bj8fIlbKow1RP65uThWa+VM6Dd9igRrQyBC4lW1DnV+we49wubLvvk5+sDdrvXc/o= 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 1598270021296234.14418072216415; Mon, 24 Aug 2020 04:53:41 -0700 (PDT) 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-64-Xtfy-NnLNCym7j0j0e443g-1; Mon, 24 Aug 2020 07:53:37 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 495A281F02F; Mon, 24 Aug 2020 11:53:32 +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 DC0AF5D9E2; Mon, 24 Aug 2020 11:53:31 +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 E02561832FC3; Mon, 24 Aug 2020 11:53:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBoTTk028451 for ; Mon, 24 Aug 2020 07:50:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id AE38E7BE7C; Mon, 24 Aug 2020 11:50:29 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B28850AC5 for ; Mon, 24 Aug 2020 11:50:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598270020; 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=2Yy555FXClJx2IvWekEhCBP9iASP2IC+e6sBu+Z/vDU=; b=PSULychhuloFCKytQxJkw9PTVK7bET3H6dcVg2AZdWYkqN5kK7a1ZpXIsombmk14kIioJt 4tB5R6augoa27+HCTDTkwrprhbe+zY7frtSNdnBD85WHmHprOO5Wk2dLpmwHgz95xGaWy2 EMDsi4t9y8MPJwTpRo6bSMhXMrv7Xts= X-MC-Unique: Xtfy-NnLNCym7j0j0e443g-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 1/8] libvirt-storage: Document volume upload/download stream format Date: Mon, 24 Aug 2020 13:50:14 +0200 Message-Id: <70b67c98d99da9e0f14e9dec97b0047f97af05dc.1598269748.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" For libvirt, the volume is just a binary blob and it doesn't interpret data on volume upload/download. But as it turns out, this unspoken assumption is not clear to our users. Document it explicitly. Suggested in: https://bugzilla.redhat.com/show_bug.cgi?id=3D1851023#c17 Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/libvirt-storage.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c index a45c8b98c1..2a7cdca234 100644 --- a/src/libvirt-storage.c +++ b/src/libvirt-storage.c @@ -1590,7 +1590,10 @@ virStorageVolCreateXMLFrom(virStoragePoolPtr pool, * * Download the content of the volume as a stream. If @length * is zero, then the remaining contents of the volume after - * @offset will be downloaded. + * @offset will be downloaded. Please note that the stream + * transports the volume itself as is, so the downloaded data may + * not correspond to guest OS visible state in cases when a + * complex storage format such as qcow2 or vmdk is used. * * If VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM is set in @flags * effective transmission of holes is enabled. This assumes using @@ -1663,7 +1666,10 @@ virStorageVolDownload(virStorageVolPtr vol, * will fail if @offset + @length exceeds the size of the * volume. Otherwise, if @length is non-zero, an error * will be raised if an attempt is made to upload greater - * than @length bytes of data. + * than @length bytes of data. Please note that the stream + * transports the volume itself as is, so the downloaded data may + * not correspond to guest OS visible state in cases when a + * complex storage format such as qcow2 or vmdk is used. * * If VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM is set in @flags * effective transmission of holes is enabled. This assumes using --=20 2.26.2 From nobody Sun Apr 28 10:40:46 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=1598270049; cv=none; d=zohomail.com; s=zohoarc; b=fQLN5+li0jh1vHTQlrLk/ytF/SHCCt/lvYjq8A0ztn1Jf4RXK7K8gT6aEir5onK+y7FAkZOk9kfp+8n6gN8sEZztp5LqNipUHnQR/+47KXOx4m/UMVnt+N/vnmOdiIhmNFIIrr79wRBy2VDG46DtXNJNVI4Gvzgolc6K7cxbjO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270049; 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=TYWICFr4WOzt3MK/jrL7ZMVyR09mNP3KcOZJFHaaZJw=; b=Tz3ATIRPwe8Nc+5EtwI6fJ4plQ5jFiTPk/a9RM7yS/KtIj80YfLRZ39VlSUBXlPz6C+dt+N5c8vzyphDJrCSmry5/UO11E4pLTQweIBKDk+zUutWXRIvVeORb9NjXeuNRZu4gLiIQx8AZzTnPkeWklYBd7XY9DGYU88vqaf8QMU= 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 1598270049769445.4026125933058; Mon, 24 Aug 2020 04:54:09 -0700 (PDT) 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-97-ZY0AGOJ1P6WV3bWNKD-81Q-1; Mon, 24 Aug 2020 07:54:06 -0400 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 774A4801AE2; Mon, 24 Aug 2020 11:54:00 +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 27BB91972A; Mon, 24 Aug 2020 11:54:00 +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 D52A91832FC5; Mon, 24 Aug 2020 11:53:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBoUD2028457 for ; Mon, 24 Aug 2020 07:50:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C7E250AC5; Mon, 24 Aug 2020 11:50:30 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BE2C7C0F3 for ; Mon, 24 Aug 2020 11:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598270048; 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=TYWICFr4WOzt3MK/jrL7ZMVyR09mNP3KcOZJFHaaZJw=; b=B58vLtebJNaq5GuSLzXqlYEYgGK6AOnmXtjfjJSf4aFMqNMSBarlYRCe7LHXIakHbIoohQ w5M5DGmQcKtw98VJHShCUg5iTz51/72WaHcL7ElQS46sjV5xKm4QSKNZ4uz3J6X5NIGam1 ATMEABPCuJFqnbdrucJ05P5nuJCzx7M= X-MC-Unique: ZY0AGOJ1P6WV3bWNKD-81Q-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 2/8] virsh: Pass virshStreamCallbackDataPtr to virshStreamSink() and virshStreamSkip() Date: Mon, 24 Aug 2020 13:50:15 +0200 Message-Id: <9e745a97171e10f050962c166082439d6724e245.1598269748.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" These callback will need to know more that the FD they are working on. Pass the structure that is passed to other stream callbacks (e.g. virshStreamSource() or virshStreamSourceSkip()) instead of inventing a new one. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- tools/virsh-util.c | 10 +++++----- tools/virsh-volume.c | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/virsh-util.c b/tools/virsh-util.c index 932d6d0849..89f15efd08 100644 --- a/tools/virsh-util.c +++ b/tools/virsh-util.c @@ -146,9 +146,9 @@ virshStreamSink(virStreamPtr st G_GNUC_UNUSED, size_t nbytes, void *opaque) { - int *fd =3D opaque; + virshStreamCallbackDataPtr cbData =3D opaque; =20 - return safewrite(*fd, bytes, nbytes); + return safewrite(cbData->fd, bytes, nbytes); } =20 =20 @@ -186,13 +186,13 @@ virshStreamSkip(virStreamPtr st G_GNUC_UNUSED, long long offset, void *opaque) { - int *fd =3D opaque; + virshStreamCallbackDataPtr cbData =3D opaque; off_t cur; =20 - if ((cur =3D lseek(*fd, offset, SEEK_CUR)) =3D=3D (off_t) -1) + if ((cur =3D lseek(cbData->fd, offset, SEEK_CUR)) =3D=3D (off_t) -1) return -1; =20 - if (ftruncate(*fd, cur) < 0) + if (ftruncate(cbData->fd, cur) < 0) return -1; =20 return 0; diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index e04e2db096..d29db6c38d 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -790,6 +790,7 @@ cmdVolDownload(vshControl *ctl, const vshCmd *cmd) unsigned long long offset =3D 0, length =3D 0; bool created =3D false; virshControlPtr priv =3D ctl->privData; + virshStreamCallbackData cbData; unsigned int flags =3D 0; =20 if (vshCommandOptULongLong(ctl, cmd, "offset", &offset) < 0) @@ -817,6 +818,9 @@ cmdVolDownload(vshControl *ctl, const vshCmd *cmd) created =3D true; } =20 + cbData.ctl =3D ctl; + cbData.fd =3D fd; + if (!(st =3D virStreamNew(priv->conn, 0))) { vshError(ctl, _("cannot create a new stream")); goto cleanup; @@ -827,7 +831,7 @@ cmdVolDownload(vshControl *ctl, const vshCmd *cmd) goto cleanup; } =20 - if (virStreamSparseRecvAll(st, virshStreamSink, virshStreamSkip, &fd) = < 0) { + if (virStreamSparseRecvAll(st, virshStreamSink, virshStreamSkip, &cbDa= ta) < 0) { vshError(ctl, _("cannot receive data from volume %s"), name); goto cleanup; } --=20 2.26.2 From nobody Sun Apr 28 10:40:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1598270073; cv=none; d=zohomail.com; s=zohoarc; b=KnA3i9wJkgkNhIF1EVbvgqfttE2IEVNdrOqeQkRR//DV62AKls3ySKT++bPU/MDK/2Jv6miS7/UQYywVDFSgsjiu+wLPbNW7x9uOkGhcJ80sT8v4On+N7ZNlJ/B3kIH/IeNslXfjxXunjfvW6eQd6NH2TlkOODkaTK1HhnLzhPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270073; 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=MW8PaHqIEF3quSrvrudywjbPVJnU6yJTmqLKmayeIvs=; b=JcNHBpC1Y/evqQnPDEQfccEBcv7TGZohkhOLsOrY3IbuBKoLL5jIa3DtcErbUbQfLczQSlwyWNoOWrDOpSC7FwiAkMvs2dc5uAEkySeerqKlZTi0pdRzhYQWHRIbecNp5zcwP2G6dcIENfHcggpjSCUfp6ptdSZZmDE7c+qenKs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1598270073480852.8421637679506; Mon, 24 Aug 2020 04:54:33 -0700 (PDT) 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-289-CYedcsNBNQudtAirKCQU1Q-1; Mon, 24 Aug 2020 07:54:29 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62322807331; Mon, 24 Aug 2020 11:54:24 +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 4242D7C65B; Mon, 24 Aug 2020 11:54:24 +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 1515666915; Mon, 24 Aug 2020 11:54:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBoVCh028470 for ; Mon, 24 Aug 2020 07:50:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6C6BE7BE7C; Mon, 24 Aug 2020 11:50:31 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id E01E250AC5 for ; Mon, 24 Aug 2020 11:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598270071; 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=MW8PaHqIEF3quSrvrudywjbPVJnU6yJTmqLKmayeIvs=; b=LtmexyfZkf+6dyYwj7UKNJWNHWyLMGGCoryI91ks2q24YTKdF0E8QzGq9e1qte9+a2Tn9V 5QRmlKuWQJa7D7se2GrVzLDUIRt8+mt4myTCaveCUwi13w3fuck1tS6iPkGiAVbHNZWa8T ZQkL6IGK5Icxqpm6IEuyK0R1oC7Fmvo= X-MC-Unique: CYedcsNBNQudtAirKCQU1Q-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 3/8] virsh: Track if vol-upload or vol-download work over a block device Date: Mon, 24 Aug 2020 13:50:16 +0200 Message-Id: <8a0c327f112d959ee54333426c4ae99370ad4daa.1598269748.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We can't use virFileInData() with block devices, but we can emulate being in data section all the time (vol-upload case). Alternatively, we can't just lseek() beyond EOF with block devices to create a hole, we will have to write zeroes (vol-download case). But to decide we need to know if the FD we are reading data from / writing data to is a block device. Store this information in _virshStreamCallbackData. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- tools/virsh-util.h | 1 + tools/virsh-volume.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/tools/virsh-util.h b/tools/virsh-util.h index 72653d9735..9ef28cfe0a 100644 --- a/tools/virsh-util.h +++ b/tools/virsh-util.h @@ -72,6 +72,7 @@ typedef virshStreamCallbackData *virshStreamCallbackDataP= tr; struct _virshStreamCallbackData { vshControl *ctl; int fd; + bool isBlock; }; =20 int diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index d29db6c38d..374bde4318 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -676,6 +676,7 @@ cmdVolUpload(vshControl *ctl, const vshCmd *cmd) virshControlPtr priv =3D ctl->privData; unsigned int flags =3D 0; virshStreamCallbackData cbData; + struct stat sb; =20 if (vshCommandOptULongLong(ctl, cmd, "offset", &offset) < 0) return false; @@ -694,8 +695,14 @@ cmdVolUpload(vshControl *ctl, const vshCmd *cmd) goto cleanup; } =20 + if (fstat(fd, &sb) < 0) { + vshError(ctl, _("unable to stat %s"), file); + goto cleanup; + } + cbData.ctl =3D ctl; cbData.fd =3D fd; + cbData.isBlock =3D !!S_ISBLK(sb.st_mode); =20 if (vshCommandOptBool(cmd, "sparse")) flags |=3D VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM; @@ -792,6 +799,7 @@ cmdVolDownload(vshControl *ctl, const vshCmd *cmd) virshControlPtr priv =3D ctl->privData; virshStreamCallbackData cbData; unsigned int flags =3D 0; + struct stat sb; =20 if (vshCommandOptULongLong(ctl, cmd, "offset", &offset) < 0) return false; @@ -818,8 +826,14 @@ cmdVolDownload(vshControl *ctl, const vshCmd *cmd) created =3D true; } =20 + if (fstat(fd, &sb) < 0) { + vshError(ctl, _("unable to stat %s"), file); + goto cleanup; + } + cbData.ctl =3D ctl; cbData.fd =3D fd; + cbData.isBlock =3D !!S_ISBLK(sb.st_mode); =20 if (!(st =3D virStreamNew(priv->conn, 0))) { vshError(ctl, _("cannot create a new stream")); --=20 2.26.2 From nobody Sun Apr 28 10:40:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1598270091; cv=none; d=zohomail.com; s=zohoarc; b=CbTxy3dfEG4YT0EjKk6z3niZFn4c/fnonZ8ljF98bcJI8NAAdKk5CRHXtS6rqhpR6/FYebDA78+m6QdGTYTMEJUlzRBAxwqA2+O5YKuc+e5UDlprEb4LskS8EILLiyKEELLHccYzgwgpmosz1bdaMjdWGes6x4fwTB26Hse6j/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270091; 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=wxl0IeNd3geMypehoWizHz+LyMXgi3lQpErvaRNqKf0=; b=DPKtDJZo3SUutIOxoCKAINp8Yg7LMElrRAZrPg3tlbS/7jBrlvVKCdikNn5O5Fsw442zZN54A8AtrCsnTUgXpG5srOEvXxWBozzAtSEhEYj6PfPEJnZgVEzWPQWnQbgN9szZw99llOPvsDTEv34u0WQ7cp8ozYJysvjg/wN4JM8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1598270091271532.7611462623934; Mon, 24 Aug 2020 04:54:51 -0700 (PDT) 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-362-SqMWmMjIPiGxvk2uhVF2Xw-1; Mon, 24 Aug 2020 07:54:47 -0400 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 A99FC1006703; Mon, 24 Aug 2020 11:54:42 +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 873D11972A; Mon, 24 Aug 2020 11:54: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 544971832FC5; Mon, 24 Aug 2020 11:54:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBoWBF028477 for ; Mon, 24 Aug 2020 07:50:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CD687BE7C; Mon, 24 Aug 2020 11:50:32 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFE3150AC5 for ; Mon, 24 Aug 2020 11:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598270090; 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=wxl0IeNd3geMypehoWizHz+LyMXgi3lQpErvaRNqKf0=; b=A/LEBGllRHt7kCm8NwsnzLMo2BK2hV5CaFVw0BqP4hieT7HpnyFv2Sq7gWFakU7JqwvyQV jCN+T329x1M4GQEbCXq62SSYYb7Oq9qaM2DsVgYaepr4dwlpt04ZnnPS7CG4WSlASmlePY 078YUoK3CoNh90d6hATnxWVjVGrDD14= X-MC-Unique: SqMWmMjIPiGxvk2uhVF2Xw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 4/8] virshStreamSkip: Emulate skip for block devices Date: Mon, 24 Aug 2020 13:50:17 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This callback is called when the server sends us STREAM_HOLE meaning there is no real data, only zeroes. For regular files we would just seek() beyond EOF and ftruncate() to create the hole. But for block devices this won't work. Not only we can't seek() beyond EOF, and ftruncate() will fail, this approach won't fill the device with zeroes. We have to do it manually. Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1852528 Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- tools/virsh-util.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/tools/virsh-util.c b/tools/virsh-util.c index 89f15efd08..884261eb49 100644 --- a/tools/virsh-util.c +++ b/tools/virsh-util.c @@ -189,11 +189,33 @@ virshStreamSkip(virStreamPtr st G_GNUC_UNUSED, virshStreamCallbackDataPtr cbData =3D opaque; off_t cur; =20 - if ((cur =3D lseek(cbData->fd, offset, SEEK_CUR)) =3D=3D (off_t) -1) - return -1; + if (cbData->isBlock) { + g_autofree char * buf =3D NULL; + const size_t buflen =3D 1 * 1024 * 1024; /* 1MiB */ =20 - if (ftruncate(cbData->fd, cur) < 0) - return -1; + /* While for files it's enough to lseek() and ftruncate() to create + * a hole which would emulate zeroes on read(), for block devices + * we have to write zeroes to read() zeroes. And we have to write + * @got bytes of zeroes. Do that in smaller chunks though.*/ + + buf =3D g_new0(char, buflen); + + while (offset) { + size_t count =3D MIN(offset, buflen); + ssize_t r; + + if ((r =3D safewrite(cbData->fd, buf, count)) < 0) + return -1; + + offset -=3D r; + } + } else { + if ((cur =3D lseek(cbData->fd, offset, SEEK_CUR)) =3D=3D (off_t) -= 1) + return -1; + + if (ftruncate(cbData->fd, cur) < 0) + return -1; + } =20 return 0; } --=20 2.26.2 From nobody Sun Apr 28 10:40:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1598270112; cv=none; d=zohomail.com; s=zohoarc; b=c185qCvPVxgAHa7ACMKwW0KYJfwskWCN0UQ5ncq/ttiSPZ6z/U5GrzEiHsWc6voceA/Fu2UilenSjqwlxXt2zk1TTM/cYIGZr9JseC1p+P9vqcQZ/TTt8kVVRXG8ANT3tf0uD7/dZNtGIvBv+KZe93Q329XelBzroVYbtMsZmOo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270112; 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=qZo73i0zQHqyAepAlFsUIiKw4Ekux/irmB3fFcuXJso=; b=eP49kuMGVxx+vflTjl2iCE0i+Fak9ZQDW1wGcFjxJI6uzbYmICxRPNyxlH3EiY2GCZz3CMqIHUA1gK1wWWqlXqj0Ng06NIkNVY4nfIDYgdkRAeRg8PqisrzeFOv+RWx22HkOB6GzVoyfHdSg/QP1eddzM6KlruZhJileoTn98nY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1598270112509727.3059432079956; Mon, 24 Aug 2020 04:55:12 -0700 (PDT) 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-34-xOjbnuPhP3C35Xt5jkU-MA-1; Mon, 24 Aug 2020 07:55:09 -0400 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 CBDA01006705; Mon, 24 Aug 2020 11:55:03 +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 A7506756BA; Mon, 24 Aug 2020 11:55:03 +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 7531EEC18; Mon, 24 Aug 2020 11:55:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBoXR3028482 for ; Mon, 24 Aug 2020 07:50:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 448B150AC5; Mon, 24 Aug 2020 11:50:33 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id B70B37E72F for ; Mon, 24 Aug 2020 11:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598270111; 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=qZo73i0zQHqyAepAlFsUIiKw4Ekux/irmB3fFcuXJso=; b=EPzG35KmGVLubkzCif/LpcS1FdZIBn7sY3pIcJvP1gbSOwPCvKJpR6Jk/ihIie0MlHuIUy s2/l/7sHQGhQKVcDDNFRVSZBIm7sJ8q/z94xmlTFQ1eXmhplPHcHX70LgTaKUjZtML1cs8 XTN7nrtuGAPrw2zrS7GNnglzMouUANA= X-MC-Unique: xOjbnuPhP3C35Xt5jkU-MA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 5/8] virfdstream: Allow sparse stream vol-download Date: Mon, 24 Aug 2020 13:50:18 +0200 Message-Id: <6e0306fa26c62493b9837d6a0c32fb89a3e77fc1.1598269748.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When handling sparse stream, a thread is executed. This thread runs a read() or write() loop (depending what API is called; in this case it's virStorageVolDownload() and this the thread run read() loop). The read() is handled in virFDStreamThreadDoRead() which is then data/hole section aware, meaning it uses virFileInData() to detect data and hole sections and sends TYPE_DATA or TYPE_HOLE virStream messages accordingly. However, virFileInData() does not work with block devices. Simply because block devices don't have data and hole sections. What we can do though, is to mimic being always in a DATA section. Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1852528 Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/util/virfdstream.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c index 44399b2dc0..39514ef555 100644 --- a/src/util/virfdstream.c +++ b/src/util/virfdstream.c @@ -398,6 +398,7 @@ struct _virFDStreamThreadData { size_t length; bool doRead; bool sparse; + bool isBlock; int fdin; char *fdinname; int fdout; @@ -421,6 +422,7 @@ virFDStreamThreadDataFree(virFDStreamThreadDataPtr data) static ssize_t virFDStreamThreadDoRead(virFDStreamDataPtr fdst, bool sparse, + bool isBlock, const int fdin, const int fdout, const char *fdinname, @@ -437,8 +439,20 @@ virFDStreamThreadDoRead(virFDStreamDataPtr fdst, ssize_t got; =20 if (sparse && *dataLen =3D=3D 0) { - if (virFileInData(fdin, &inData, §ionLen) < 0) - return -1; + if (isBlock) { + /* Block devices are always in data section by definition. The + * @sectionLen is slightly more tricky. While we could try and= get + * how much bytes is there left until EOF, we can pretend ther= e is + * always X bytes left and let the saferead() below hit EOF (w= hich + * is then handled gracefully anyway). Worst case scenario, th= is + * branch is called more than once. + * X was chosen to be 1MiB but it has ho special meaning. */ + inData =3D 1; + sectionLen =3D 1 * 1024 * 1024; + } else { + if (virFileInData(fdin, &inData, §ionLen) < 0) + return -1; + } =20 if (length && sectionLen > length - total) @@ -568,6 +582,7 @@ virFDStreamThread(void *opaque) virStreamPtr st =3D data->st; size_t length =3D data->length; bool sparse =3D data->sparse; + bool isBlock =3D data->isBlock; VIR_AUTOCLOSE fdin =3D data->fdin; char *fdinname =3D data->fdinname; VIR_AUTOCLOSE fdout =3D data->fdout; @@ -604,7 +619,7 @@ virFDStreamThread(void *opaque) } =20 if (doRead) - got =3D virFDStreamThreadDoRead(fdst, sparse, + got =3D virFDStreamThreadDoRead(fdst, sparse, isBlock, fdin, fdout, fdinname, fdoutname, length, total, @@ -1271,6 +1286,7 @@ virFDStreamOpenFileInternal(virStreamPtr st, threadData->st =3D virObjectRef(st); threadData->length =3D length; threadData->sparse =3D sparse; + threadData->isBlock =3D !!S_ISBLK(sb.st_mode); =20 if ((oflags & O_ACCMODE) =3D=3D O_RDONLY) { threadData->fdin =3D fd; --=20 2.26.2 From nobody Sun Apr 28 10:40:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1598270075; cv=none; d=zohomail.com; s=zohoarc; b=KLMKDWgwnsncZ4mh6ofEq8wPz1nNejaBS4oYahg/3Gi9YaLJAhzex/cS96bcpyTIbRWjOS47XgLKWZN8dXHG9/CV2PyQBthgRWKV9pBuZR3OBvyBUezz82x8SWm0OcFY8LRUkEhdtlNi6PKVDW2wrWtPQf4MkH0Yg+01A1tNT0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270075; 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=R3/HSWT2NX1LFAqPPNzqfy1d1s6gOPgAtjw+JY7ZE68=; b=QjNS6JT3lDZFerDwta3EeViHNMhkHz5DL5Rrts76kdgFchothTWBZLBH28nBavwi3tIVk71Ib7CURtjEQMfe0/+Z/lCcIi0R1y6IA+rbkD6sHfIYakyM4irVvvhLvdy2Lbq+ZGgAJw8GznQ/Eam4Nke2RDNODYiSUWJJps2jAQw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1598270075487734.402203705083; Mon, 24 Aug 2020 04:54:35 -0700 (PDT) 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-125-aheL-sXOOIKZce57THXXJA-1; Mon, 24 Aug 2020 07:54:31 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6462E10ABDB8; Mon, 24 Aug 2020 11:54:26 +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 446C45FC36; Mon, 24 Aug 2020 11:54:26 +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 13A546691E; Mon, 24 Aug 2020 11:54:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBoY8L028491 for ; Mon, 24 Aug 2020 07:50:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 24E7450AC5; Mon, 24 Aug 2020 11:50:34 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 982F77C0F3 for ; Mon, 24 Aug 2020 11:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598270073; 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=R3/HSWT2NX1LFAqPPNzqfy1d1s6gOPgAtjw+JY7ZE68=; b=Gr/2wfS5X+KP5NFyLNSy2KFW4TcVes152YNQNOqSL8oWFtT8mFPCJXL84XZqFYMcyPMWNN F8JdfOGHoHCbMz/XZA1L4S5YlM0AkCGX1Wh1JAN9emVe6yJoklWIJPzivntPAzR/oOJBdS Pvu9FN4i3/0ZdM9BFX03GsNWnR1wH5c= X-MC-Unique: aheL-sXOOIKZce57THXXJA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 6/8] virshStreamInData: Handle block devices Date: Mon, 24 Aug 2020 13:50:19 +0200 Message-Id: <9e0ba037cdcd9d9e9a8effc1dcea6d4a136045fb.1598269748.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This is very similar to previous commit. The virshStreamInData() callback is used by virStreamSparseSendAll() to detect whether the file the data is read from is in data or hole section. The SendAll() will then send corresponding type of virStream message to make server create a hole or write actual data. But the callback uses virFileInData() even for block devices, which results in an error. Just like in previous commit, emulate a DATA section for block devices. Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1852528 Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- tools/virsh-util.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/virsh-util.c b/tools/virsh-util.c index 884261eb49..d78a196cc6 100644 --- a/tools/virsh-util.c +++ b/tools/virsh-util.c @@ -230,12 +230,25 @@ virshStreamInData(virStreamPtr st G_GNUC_UNUSED, virshStreamCallbackDataPtr cbData =3D opaque; vshControl *ctl =3D cbData->ctl; int fd =3D cbData->fd; - int ret; =20 - if ((ret =3D virFileInData(fd, inData, offset)) < 0) - vshError(ctl, "%s", _("Unable to get current position in stream")); + if (cbData->isBlock) { + /* Block devices are always in data section by definition. The + * @sectionLen is slightly more tricky. While we could try and get + * how much bytes is there left until EOF, we can pretend there is + * always X bytes left and let the saferead() below hit EOF (which + * is then handled gracefully anyway). Worst case scenario, this + * branch is called more than once. + * X was chosen to be 1MiB but it has ho special meaning. */ + *inData =3D 1; + *offset =3D 1 * 1024 * 1024; + } else { + if (virFileInData(fd, inData, offset) < 0) { + vshError(ctl, "%s", _("Unable to get current position in strea= m")); + return -1; + } + } =20 - return ret; + return 0; } =20 =20 --=20 2.26.2 From nobody Sun Apr 28 10:40:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1598270069; cv=none; d=zohomail.com; s=zohoarc; b=dQD3zBta880d5svVEi1Z3N0g+E0NzWURC3PTEuGTU+th/ztLwtiZ+D0ABzeDxIR8JZn+bqoN1An88WYFgaoyZPhrX2JJLgIN6a16/5itTH5VnjwKwxQpyBs5u7vWFC8Txs9LFIF7azgXGNOqq45MGkgHCtT10rpQcAVvs6Xbtbk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270069; 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=/rcfbqeiNKGn5YNK1DOPQXqp2uvIK6PLKcSnh+YBL6M=; b=OmGlNWwSU9a5PDbeIZcD23l1dmbhts0jvo5up19IrO19+1AvJITWQdb+OxgBx/ZiZFKQmxUFbt7UZWWM6XVDaGDIO9fbWI9bsCpudHV+3PrXJNOhOrSccgv1W/9H5DCyNCBQlVO9m+qVIOejZ219II9OLbx9ggAh9FBzCrcjCT4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1598270068910792.0273195191174; Mon, 24 Aug 2020 04:54:28 -0700 (PDT) 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-86-xSMZtA-COZaLSGzwM_BDTQ-1; Mon, 24 Aug 2020 07:54:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EF14110ABDAC; Mon, 24 Aug 2020 11:54:16 +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 D24C25C1BB; Mon, 24 Aug 2020 11:54:16 +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 A2FEA6690B; Mon, 24 Aug 2020 11:54:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBoZZb028501 for ; Mon, 24 Aug 2020 07:50:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 04C0C7C867; Mon, 24 Aug 2020 11:50:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 783A750AC5 for ; Mon, 24 Aug 2020 11:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598270065; 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=/rcfbqeiNKGn5YNK1DOPQXqp2uvIK6PLKcSnh+YBL6M=; b=LpQd7UsAm5ijvx1FxSXXJB8Xc90Titn/ueiKcvlo7IqpTWqiAjkSbzNJoTh5FfuE54fplf Ftebi+Z4BLJ1xMMmwN0z9bARTjASq1VcdS8oDN3stElPMY5WsFkzS1O3NGRvMCZ/p68+DP hs6iyDGImfgOdCXMfZTczfHbU9fhleI= X-MC-Unique: xSMZtA-COZaLSGzwM_BDTQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 7/8] virfdstream: Emulate skip for block devices Date: Mon, 24 Aug 2020 13:50:20 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This is similar to one of previous patches. When receiving stream (on virStorageVolUpload() and subsequent virStreamSparseSendAll()) we may receive a hole. If the volume we are saving the incoming data into is a regular file we just lseek() and ftruncate() to create the hole. But this won't work if the file is a block device. If that is the case we must write zeroes so that any subsequent reader reads nothing just zeroes (just like they would from a hole in a regular file). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1852528 Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/util/virfdstream.c | 59 +++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c index 39514ef555..1a7b671179 100644 --- a/src/util/virfdstream.c +++ b/src/util/virfdstream.c @@ -512,6 +512,7 @@ virFDStreamThreadDoRead(virFDStreamDataPtr fdst, static ssize_t virFDStreamThreadDoWrite(virFDStreamDataPtr fdst, bool sparse, + bool isBlock, const int fdin, const int fdout, const char *fdinname, @@ -519,7 +520,6 @@ virFDStreamThreadDoWrite(virFDStreamDataPtr fdst, { ssize_t got =3D 0; virFDStreamMsgPtr msg =3D fdst->msg; - off_t off; bool pop =3D false; =20 switch (msg->type) { @@ -547,19 +547,48 @@ virFDStreamThreadDoWrite(virFDStreamDataPtr fdst, } =20 got =3D msg->stream.hole.len; - off =3D lseek(fdout, got, SEEK_CUR); - if (off =3D=3D (off_t) -1) { - virReportSystemError(errno, - _("unable to seek in %s"), - fdoutname); - return -1; - } - - if (ftruncate(fdout, off) < 0) { - virReportSystemError(errno, - _("unable to truncate %s"), - fdoutname); - return -1; + if (isBlock) { + g_autofree char * buf =3D NULL; + const size_t buflen =3D 1 * 1024 * 1024; /* 1MiB */ + size_t toWrite =3D got; + + /* While for files it's enough to lseek() and ftruncate() to c= reate + * a hole which would emulate zeroes on read(), for block devi= ces + * we have to write zeroes to read() zeroes. And we have to wr= ite + * @got bytes of zeroes. Do that in smaller chunks though.*/ + + buf =3D g_new0(char, buflen); + + while (toWrite) { + size_t count =3D MIN(toWrite, buflen); + ssize_t r; + + if ((r =3D safewrite(fdout, buf, count)) < 0) { + virReportSystemError(errno, + _("Unable to write %s"), + fdoutname); + return -1; + } + + toWrite -=3D r; + } + } else { + off_t off; + + off =3D lseek(fdout, got, SEEK_CUR); + if (off =3D=3D (off_t) -1) { + virReportSystemError(errno, + _("unable to seek in %s"), + fdoutname); + return -1; + } + + if (ftruncate(fdout, off) < 0) { + virReportSystemError(errno, + _("unable to truncate %s"), + fdoutname); + return -1; + } } =20 pop =3D true; @@ -625,7 +654,7 @@ virFDStreamThread(void *opaque) length, total, &dataLen, buflen); else - got =3D virFDStreamThreadDoWrite(fdst, sparse, + got =3D virFDStreamThreadDoWrite(fdst, sparse, isBlock, fdin, fdout, fdinname, fdoutname); =20 --=20 2.26.2 From nobody Sun Apr 28 10:40:46 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=1598270083; cv=none; d=zohomail.com; s=zohoarc; b=R1atpq0Z46TIthomsAi5XQ4//iZvr9H313q3AchIrb0NTLLdO2yt1ybpP0yhZEjuW4KJvkVQ3lMvnYbHf+DhOzsCThYVk4dNCXyoSD9yVLAFBLnMeZh4OOtqjmlvXMRQZVZj34Iuw3l/23V+im6vNw4paOw5u940+PHSmNiwZeE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598270083; 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=gkdiAzlGxWNn7leiXtD6j5aD1YxQEs+vf9G/vVwmyR8=; b=IRHJ5FLozsApIXCO6s4/SEc23B3Hr+xB/r0Uyifk9VswckJnOflKgIpH45jKTs9QbgPA/J9Byp7Q8fN/OhAiXBKVi48ia/KmpJOny7b1oMDfNB47VoU8xYpFGxO25wk6g/kcg5XrFvzpbUegXUKXJzunwrh7GS03uc4q85NSh7k= 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 1598270083813356.24537606306694; Mon, 24 Aug 2020 04:54:43 -0700 (PDT) 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-328-GTMAI_rAP6GkWKXp5gQDOg-1; Mon, 24 Aug 2020 07:54:40 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3CC97807335; Mon, 24 Aug 2020 11:54:35 +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 1D350808BA; Mon, 24 Aug 2020 11:54:35 +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 DCE2A1832FD2; Mon, 24 Aug 2020 11:54:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OBoZm0028513 for ; Mon, 24 Aug 2020 07:50:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id D8CCF7BE7C; Mon, 24 Aug 2020 11:50:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5812350AC5 for ; Mon, 24 Aug 2020 11:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598270082; 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=gkdiAzlGxWNn7leiXtD6j5aD1YxQEs+vf9G/vVwmyR8=; b=dH4etQiEkkx6W77+hPh8WdbAuFbCJbp/FHaVusc0FHwXcObnTR0qnoECBikgtvQqXEDH1n lCmm7XtcDk67+xVWWI9411FQhQTIqGfH9s5kT6yehsfXzmbzDK2A1Bs5j8Xnp0CIW2957r uhExceKzrWRAXbbTcXLsb47QN0nx16M= X-MC-Unique: GTMAI_rAP6GkWKXp5gQDOg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 8/8] news: Document sparse streams for block devices Date: Mon, 24 Aug 2020 13:50:21 +0200 Message-Id: <9ba993cedd20bc3b525a692c32ac8bf201d64831.1598269748.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.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" Signed-off-by: Michal Privoznik --- NEWS.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 0669051ee6..3cd09decf6 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -15,6 +15,13 @@ v6.7.0 (unreleased) =20 * **Improvements** =20 + * Allow sparse streams for block devices + + Sparse streams (e.g. ``virsh vol-download --sparse`` or ``virsh vol-up= load + --sparse``) now handle if one of the stream ends is a block device. A = zero + block detection is performed so that zero block are not transferred and + thus bandwidth is saved. + * **Bug fixes** =20 * virdevmapper: Deal with kernels without DM support --=20 2.26.2