From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599309491936.6371728126131; Tue, 1 Aug 2017 07:55:09 -0700 (PDT) Received: from localhost ([::1]:43050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYZf-0006nT-Kh for importer@patchew.org; Tue, 01 Aug 2017 10:55:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRq-0000S0-4A for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRi-0005W3-Tc for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34262) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRU-0005GO-5C; Tue, 01 Aug 2017 10:46:40 -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 mx1.redhat.com (Postfix) with ESMTPS id 089C7107953; Tue, 1 Aug 2017 14:46:39 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37839A5787; Tue, 1 Aug 2017 14:46:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 089C7107953 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:18 +0200 Message-Id: <20170801144632.3831-2-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 01 Aug 2017 14:46:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/15] docs: add qemu-block-drivers(7) man page X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi Block driver documentation is available in qemu-doc.html. It would be convenient to have documentation for formats, protocols, and filter drivers in a man page. Extract the relevant part of qemu-doc.html into a new file called docs/qemu-block-drivers.texi. This file can also be built as a stand-alone document (man, html, etc). Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- Makefile | 23 +- docs/qemu-block-drivers.texi | 799 +++++++++++++++++++++++++++++++++++++++= ++++ qemu-doc.texi | 780 +--------------------------------------= --- 3 files changed, 818 insertions(+), 784 deletions(-) create mode 100644 docs/qemu-block-drivers.texi diff --git a/Makefile b/Makefile index 97a58a0f4e..aa40957967 100644 --- a/Makefile +++ b/Makefile @@ -209,6 +209,9 @@ ifdef BUILD_DOCS DOCS=3Dqemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8 DOCS+=3Ddocs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/= interop/qemu-qmp-ref.7 DOCS+=3Ddocs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/in= terop/qemu-ga-ref.7 +DOCS+=3Ddocs/qemu-block-drivers.html +DOCS+=3Ddocs/qemu-block-drivers.txt +DOCS+=3Ddocs/qemu-block-drivers.7 ifdef CONFIG_VIRTFS DOCS+=3Dfsdev/virtfs-proxy-helper.1 endif @@ -530,6 +533,8 @@ distclean: clean rm -f docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html + rm -f docs/qemu-block-drivers.7 docs/qemu-block-drivers.txt + rm -f docs/qemu-block-drivers.pdf docs/qemu-block-drivers.html for d in $(TARGET_DIRS); do \ rm -rf $$d || exit 1 ; \ done @@ -570,11 +575,14 @@ install-doc: $(DOCS) $(INSTALL_DATA) qemu-doc.txt "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)" + $(INSTALL_DATA) docs/qemu-block-drivers.html "$(DESTDIR)$(qemu_docdir)" + $(INSTALL_DATA) docs/qemu-block-drivers.txt "$(DESTDIR)$(qemu_docdir)" ifdef CONFIG_POSIX $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1" $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7" $(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7" + $(INSTALL_DATA) docs/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7" ifneq ($(TOOLS),) $(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1" $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8" @@ -721,15 +729,15 @@ fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helpe= r.texi qemu-nbd.8: qemu-nbd.texi qemu-option-trace.texi qemu-ga.8: qemu-ga.texi =20 -html: qemu-doc.html docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-re= f.html -info: qemu-doc.info docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-re= f.info -pdf: qemu-doc.pdf docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.p= df -txt: qemu-doc.txt docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.t= xt +html: qemu-doc.html docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-re= f.html docs/qemu-block-drivers.html +info: qemu-doc.info docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-re= f.info docs/qemu-block-drivers.info +pdf: qemu-doc.pdf docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.p= df docs/qemu-block-drivers.pdf +txt: qemu-doc.txt docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.t= xt docs/qemu-block-drivers.txt =20 qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \ qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \ qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ - qemu-monitor-info.texi + qemu-monitor-info.texi docs/qemu-block-drivers.texi =20 docs/interop/qemu-ga-ref.dvi docs/interop/qemu-ga-ref.html \ docs/interop/qemu-ga-ref.info docs/interop/qemu-ga-ref.pdf \ @@ -741,6 +749,11 @@ docs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qmp-re= f.html \ docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \ docs/interop/qemu-qmp-ref.texi docs/interop/qemu-qmp-qapi.texi =20 +docs/qemu-block-drivers.dvi docs/qemu-block-drivers.html \ + docs/qemu-block-drivers.info docs/qemu-block-drivers.pdf \ + docs/qemu-block-drivers.txt docs/qemu-block-drivers.7: \ + docs/qemu-block-drivers.texi + =20 ifdef CONFIG_WIN32 =20 diff --git a/docs/qemu-block-drivers.texi b/docs/qemu-block-drivers.texi new file mode 100644 index 0000000000..43ec3faf15 --- /dev/null +++ b/docs/qemu-block-drivers.texi @@ -0,0 +1,799 @@ +@c man begin SYNOPSIS +QEMU block driver reference manual +@c man end + +@c man begin DESCRIPTION + +@node disk_images_formats + +@subsection Disk image file formats + +QEMU supports many image file formats that can be used with VMs as well as= with +any of the tools (like @code{qemu-img}). This includes the preferred forma= ts +raw and qcow2 as well as formats that are supported for compatibility with +older QEMU versions or other hypervisors. + +Depending on the image format, different options can be passed to +@code{qemu-img create} and @code{qemu-img convert} using the @code{-o} opt= ion. +This section describes each format and the options that are supported for = it. + +@table @option +@item raw + +Raw disk image format. This format has the advantage of +being simple and easily exportable to all other emulators. If your +file system supports @emph{holes} (for example in ext2 or ext3 on +Linux or NTFS on Windows), then only the written sectors will reserve +space. Use @code{qemu-img info} to know the real size used by the +image or @code{ls -ls} on Unix/Linux. + +Supported options: +@table @code +@item preallocation +Preallocation mode (allowed values: @code{off}, @code{falloc}, @code{full}= ). +@code{falloc} mode preallocates space for image by calling posix_fallocate= (). +@code{full} mode preallocates space for image by writing zeros to underlyi= ng +storage. +@end table + +@item qcow2 +QEMU image format, the most versatile format. Use it to have smaller +images (useful if your filesystem does not supports holes, for example +on Windows), zlib based compression and support of multiple VM +snapshots. + +Supported options: +@table @code +@item compat +Determines the qcow2 version to use. @code{compat=3D0.10} uses the +traditional image format that can be read by any QEMU since 0.10. +@code{compat=3D1.1} enables image format extensions that only QEMU 1.1 and +newer understand (this is the default). Amongst others, this includes +zero clusters, which allow efficient copy-on-read for sparse images. + +@item backing_file +File name of a base image (see @option{create} subcommand) +@item backing_fmt +Image format of the base image +@item encryption +This option is deprecated and equivalent to @code{encrypt.format=3Daes} + +@item encrypt.format + +If this is set to @code{luks}, it requests that the qcow2 payload (not +qcow2 header) be encrypted using the LUKS format. The passphrase to +use to unlock the LUKS key slot is given by the @code{encrypt.key-secret} +parameter. LUKS encryption parameters can be tuned with the other +@code{encrypt.*} parameters. + +If this is set to @code{aes}, the image is encrypted with 128-bit AES-CBC. +The encryption key is given by the @code{encrypt.key-secret} parameter. +This encryption format is considered to be flawed by modern cryptography +standards, suffering from a number of design problems: + +@itemize @minus +@item The AES-CBC cipher is used with predictable initialization vectors b= ased +on the sector number. This makes it vulnerable to chosen plaintext attacks +which can reveal the existence of encrypted data. +@item The user passphrase is directly used as the encryption key. A poorly +chosen or short passphrase will compromise the security of the encryption. +@item In the event of the passphrase being compromised there is no way to +change the passphrase to protect data in any qcow images. The files must +be cloned, using a different encryption passphrase in the new file. The +original file must then be securely erased using a program like shred, +though even this is ineffective with many modern storage technologies. +@end itemize + +The use of this is no longer supported in system emulators. Support only +remains in the command line utilities, for the purposes of data liberation +and interoperability with old versions of QEMU. The @code{luks} format +should be used instead. + +@item encrypt.key-secret + +Provides the ID of a @code{secret} object that contains the passphrase +(@code{encrypt.format=3Dluks}) or encryption key (@code{encrypt.format=3Da= es}). + +@item encrypt.cipher-alg + +Name of the cipher algorithm and key length. Currently defaults +to @code{aes-256}. Only used when @code{encrypt.format=3Dluks}. + +@item encrypt.cipher-mode + +Name of the encryption mode to use. Currently defaults to @code{xts}. +Only used when @code{encrypt.format=3Dluks}. + +@item encrypt.ivgen-alg + +Name of the initialization vector generator algorithm. Currently defaults +to @code{plain64}. Only used when @code{encrypt.format=3Dluks}. + +@item encrypt.ivgen-hash-alg + +Name of the hash algorithm to use with the initialization vector generator +(if required). Defaults to @code{sha256}. Only used when @code{encrypt.for= mat=3Dluks}. + +@item encrypt.hash-alg + +Name of the hash algorithm to use for PBKDF algorithm +Defaults to @code{sha256}. Only used when @code{encrypt.format=3Dluks}. + +@item encrypt.iter-time + +Amount of time, in milliseconds, to use for PBKDF algorithm per key slot. +Defaults to @code{2000}. Only used when @code{encrypt.format=3Dluks}. + +@item cluster_size +Changes the qcow2 cluster size (must be between 512 and 2M). Smaller clust= er +sizes can improve the image file size whereas larger cluster sizes general= ly +provide better performance. + +@item preallocation +Preallocation mode (allowed values: @code{off}, @code{metadata}, @code{fal= loc}, +@code{full}). An image with preallocated metadata is initially larger but = can +improve performance when the image needs to grow. @code{falloc} and @code{= full} +preallocations are like the same options of @code{raw} format, but sets up +metadata also. + +@item lazy_refcounts +If this option is set to @code{on}, reference count updates are postponed = with +the goal of avoiding metadata I/O and improving performance. This is +particularly interesting with @option{cache=3Dwritethrough} which doesn't = batch +metadata updates. The tradeoff is that after a host crash, the reference c= ount +tables must be rebuilt, i.e. on the next open an (automatic) @code{qemu-img +check -r all} is required, which may take some time. + +This option can only be enabled if @code{compat=3D1.1} is specified. + +@item nocow +If this option is set to @code{on}, it will turn off COW of the file. It's= only +valid on btrfs, no effect on other file systems. + +Btrfs has low performance when hosting a VM image file, even more when the= guest +on the VM also using btrfs as file system. Turning off COW is a way to mit= igate +this bad performance. Generally there are two ways to turn off COW on btrf= s: +a) Disable it by mounting with nodatacow, then all newly created files wil= l be +NOCOW. b) For an empty file, add the NOCOW file attribute. That's what thi= s option +does. + +Note: this option is only valid to new or empty files. If there is an exis= ting +file which is COW and has data blocks already, it couldn't be changed to N= OCOW +by setting @code{nocow=3Don}. One can issue @code{lsattr filename} to chec= k if +the NOCOW flag is set or not (Capital 'C' is NOCOW flag). + +@end table + +@item qed +Old QEMU image format with support for backing files and compact image fil= es +(when your filesystem or transport medium does not support holes). + +When converting QED images to qcow2, you might want to consider using the +@code{lazy_refcounts=3Don} option to get a more QED-like behaviour. + +Supported options: +@table @code +@item backing_file +File name of a base image (see @option{create} subcommand). +@item backing_fmt +Image file format of backing file (optional). Useful if the format cannot= be +autodetected because it has no header, like some vhd/vpc files. +@item cluster_size +Changes the cluster size (must be power-of-2 between 4K and 64K). Smaller +cluster sizes can improve the image file size whereas larger cluster sizes +generally provide better performance. +@item table_size +Changes the number of clusters per L1/L2 table (must be power-of-2 between= 1 +and 16). There is normally no need to change this value but this option c= an be +used for performance benchmarking. +@end table + +@item qcow +Old QEMU image format with support for backing files, compact image files, +encryption and compression. + +Supported options: +@table @code +@item backing_file +File name of a base image (see @option{create} subcommand) +@item encryption +This option is deprecated and equivalent to @code{encrypt.format=3Daes} + +@item encrypt.format +If this is set to @code{aes}, the image is encrypted with 128-bit AES-CBC. +The encryption key is given by the @code{encrypt.key-secret} parameter. +This encryption format is considered to be flawed by modern cryptography +standards, suffering from a number of design problems enumerated previously +against the @code{qcow2} image format. + +The use of this is no longer supported in system emulators. Support only +remains in the command line utilities, for the purposes of data liberation +and interoperability with old versions of QEMU. + +Users requiring native encryption should use the @code{qcow2} format +instead with @code{encrypt.format=3Dluks}. + +@item encrypt.key-secret + +Provides the ID of a @code{secret} object that contains the encryption +key (@code{encrypt.format=3Daes}). + +@end table + +@item luks + +LUKS v1 encryption format, compatible with Linux dm-crypt/cryptsetup + +Supported options: +@table @code + +@item key-secret + +Provides the ID of a @code{secret} object that contains the passphrase. + +@item cipher-alg + +Name of the cipher algorithm and key length. Currently defaults +to @code{aes-256}. + +@item cipher-mode + +Name of the encryption mode to use. Currently defaults to @code{xts}. + +@item ivgen-alg + +Name of the initialization vector generator algorithm. Currently defaults +to @code{plain64}. + +@item ivgen-hash-alg + +Name of the hash algorithm to use with the initialization vector generator +(if required). Defaults to @code{sha256}. + +@item hash-alg + +Name of the hash algorithm to use for PBKDF algorithm +Defaults to @code{sha256}. + +@item iter-time + +Amount of time, in milliseconds, to use for PBKDF algorithm per key slot. +Defaults to @code{2000}. + +@end table + +@item vdi +VirtualBox 1.1 compatible image format. +Supported options: +@table @code +@item static +If this option is set to @code{on}, the image is created with metadata +preallocation. +@end table + +@item vmdk +VMware 3 and 4 compatible image format. + +Supported options: +@table @code +@item backing_file +File name of a base image (see @option{create} subcommand). +@item compat6 +Create a VMDK version 6 image (instead of version 4) +@item hwversion +Specify vmdk virtual hardware version. Compat6 flag cannot be enabled +if hwversion is specified. +@item subformat +Specifies which VMDK subformat to use. Valid options are +@code{monolithicSparse} (default), +@code{monolithicFlat}, +@code{twoGbMaxExtentSparse}, +@code{twoGbMaxExtentFlat} and +@code{streamOptimized}. +@end table + +@item vpc +VirtualPC compatible image format (VHD). +Supported options: +@table @code +@item subformat +Specifies which VHD subformat to use. Valid options are +@code{dynamic} (default) and @code{fixed}. +@end table + +@item VHDX +Hyper-V compatible image format (VHDX). +Supported options: +@table @code +@item subformat +Specifies which VHDX subformat to use. Valid options are +@code{dynamic} (default) and @code{fixed}. +@item block_state_zero +Force use of payload blocks of type 'ZERO'. Can be set to @code{on} (defa= ult) +or @code{off}. When set to @code{off}, new blocks will be created as +@code{PAYLOAD_BLOCK_NOT_PRESENT}, which means parsers are free to return +arbitrary data for those blocks. Do not set to @code{off} when using +@code{qemu-img convert} with @code{subformat=3Ddynamic}. +@item block_size +Block size; min 1 MB, max 256 MB. 0 means auto-calculate based on image s= ize. +@item log_size +Log size; min 1 MB. +@end table +@end table + +@subsubsection Read-only formats +More disk image file formats are supported in a read-only mode. +@table @option +@item bochs +Bochs images of @code{growing} type. +@item cloop +Linux Compressed Loop image, useful only to reuse directly compressed +CD-ROM images present for example in the Knoppix CD-ROMs. +@item dmg +Apple disk image. +@item parallels +Parallels disk image format. +@end table + + +@node host_drives +@subsection Using host drives + +In addition to disk image files, QEMU can directly access host +devices. We describe here the usage for QEMU version >=3D 0.8.3. + +@subsubsection Linux + +On Linux, you can directly use the host device filename instead of a +disk image filename provided you have enough privileges to access +it. For example, use @file{/dev/cdrom} to access to the CDROM. + +@table @code +@item CD +You can specify a CDROM device even if no CDROM is loaded. QEMU has +specific code to detect CDROM insertion or removal. CDROM ejection by +the guest OS is supported. Currently only data CDs are supported. +@item Floppy +You can specify a floppy device even if no floppy is loaded. Floppy +removal is currently not detected accurately (if you change floppy +without doing floppy access while the floppy is not loaded, the guest +OS will think that the same floppy is loaded). +Use of the host's floppy device is deprecated, and support for it will +be removed in a future release. +@item Hard disks +Hard disks can be used. Normally you must specify the whole disk +(@file{/dev/hdb} instead of @file{/dev/hdb1}) so that the guest OS can +see it as a partitioned disk. WARNING: unless you know what you do, it +is better to only make READ-ONLY accesses to the hard disk otherwise +you may corrupt your host data (use the @option{-snapshot} command +line option or modify the device permissions accordingly). +@end table + +@subsubsection Windows + +@table @code +@item CD +The preferred syntax is the drive letter (e.g. @file{d:}). The +alternate syntax @file{\\.\d:} is supported. @file{/dev/cdrom} is +supported as an alias to the first CDROM drive. + +Currently there is no specific code to handle removable media, so it +is better to use the @code{change} or @code{eject} monitor commands to +change or eject media. +@item Hard disks +Hard disks can be used with the syntax: @file{\\.\PhysicalDrive@var{N}} +where @var{N} is the drive number (0 is the first hard disk). + +WARNING: unless you know what you do, it is better to only make +READ-ONLY accesses to the hard disk otherwise you may corrupt your +host data (use the @option{-snapshot} command line so that the +modifications are written in a temporary file). +@end table + + +@subsubsection Mac OS X + +@file{/dev/cdrom} is an alias to the first CDROM. + +Currently there is no specific code to handle removable media, so it +is better to use the @code{change} or @code{eject} monitor commands to +change or eject media. + +@node disk_images_fat_images +@subsection Virtual FAT disk images + +QEMU can automatically create a virtual FAT disk image from a +directory tree. In order to use it, just type: + +@example +qemu-system-i386 linux.img -hdb fat:/my_directory +@end example + +Then you access access to all the files in the @file{/my_directory} +directory without having to copy them in a disk image or to export +them via SAMBA or NFS. The default access is @emph{read-only}. + +Floppies can be emulated with the @code{:floppy:} option: + +@example +qemu-system-i386 linux.img -fda fat:floppy:/my_directory +@end example + +A read/write support is available for testing (beta stage) with the +@code{:rw:} option: + +@example +qemu-system-i386 linux.img -fda fat:floppy:rw:/my_directory +@end example + +What you should @emph{never} do: +@itemize +@item use non-ASCII filenames ; +@item use "-snapshot" together with ":rw:" ; +@item expect it to work when loadvm'ing ; +@item write to the FAT directory on the host system while accessing it wit= h the guest system. +@end itemize + +@node disk_images_nbd +@subsection NBD access + +QEMU can access directly to block device exported using the Network Block = Device +protocol. + +@example +qemu-system-i386 linux.img -hdb nbd://my_nbd_server.mydomain.org:1024/ +@end example + +If the NBD server is located on the same host, you can use an unix socket = instead +of an inet socket: + +@example +qemu-system-i386 linux.img -hdb nbd+unix://?socket=3D/tmp/my_socket +@end example + +In this case, the block device must be exported using qemu-nbd: + +@example +qemu-nbd --socket=3D/tmp/my_socket my_disk.qcow2 +@end example + +The use of qemu-nbd allows sharing of a disk between several guests: +@example +qemu-nbd --socket=3D/tmp/my_socket --share=3D2 my_disk.qcow2 +@end example + +@noindent +and then you can use it with two guests: +@example +qemu-system-i386 linux1.img -hdb nbd+unix://?socket=3D/tmp/my_socket +qemu-system-i386 linux2.img -hdb nbd+unix://?socket=3D/tmp/my_socket +@end example + +If the nbd-server uses named exports (supported since NBD 2.9.18, or with = QEMU's +own embedded NBD server), you must specify an export name in the URI: +@example +qemu-system-i386 -cdrom nbd://localhost/debian-500-ppc-netinst +qemu-system-i386 -cdrom nbd://localhost/openSUSE-11.1-ppc-netinst +@end example + +The URI syntax for NBD is supported since QEMU 1.3. An alternative syntax= is +also available. Here are some example of the older syntax: +@example +qemu-system-i386 linux.img -hdb nbd:my_nbd_server.mydomain.org:1024 +qemu-system-i386 linux2.img -hdb nbd:unix:/tmp/my_socket +qemu-system-i386 -cdrom nbd:localhost:10809:exportname=3Ddebian-500-ppc-ne= tinst +@end example + +@node disk_images_sheepdog +@subsection Sheepdog disk images + +Sheepdog is a distributed storage system for QEMU. It provides highly +available block level storage volumes that can be attached to +QEMU-based virtual machines. + +You can create a Sheepdog disk image with the command: +@example +qemu-img create sheepdog:///@var{image} @var{size} +@end example +where @var{image} is the Sheepdog image name and @var{size} is its +size. + +To import the existing @var{filename} to Sheepdog, you can use a +convert command. +@example +qemu-img convert @var{filename} sheepdog:///@var{image} +@end example + +You can boot from the Sheepdog disk image with the command: +@example +qemu-system-i386 sheepdog:///@var{image} +@end example + +You can also create a snapshot of the Sheepdog image like qcow2. +@example +qemu-img snapshot -c @var{tag} sheepdog:///@var{image} +@end example +where @var{tag} is a tag name of the newly created snapshot. + +To boot from the Sheepdog snapshot, specify the tag name of the +snapshot. +@example +qemu-system-i386 sheepdog:///@var{image}#@var{tag} +@end example + +You can create a cloned image from the existing snapshot. +@example +qemu-img create -b sheepdog:///@var{base}#@var{tag} sheepdog:///@var{image} +@end example +where @var{base} is a image name of the source snapshot and @var{tag} +is its tag name. + +You can use an unix socket instead of an inet socket: + +@example +qemu-system-i386 sheepdog+unix:///@var{image}?socket=3D@var{path} +@end example + +If the Sheepdog daemon doesn't run on the local host, you need to +specify one of the Sheepdog servers to connect to. +@example +qemu-img create sheepdog://@var{hostname}:@var{port}/@var{image} @var{size} +qemu-system-i386 sheepdog://@var{hostname}:@var{port}/@var{image} +@end example + +@node disk_images_iscsi +@subsection iSCSI LUNs + +iSCSI is a popular protocol used to access SCSI devices across a computer +network. + +There are two different ways iSCSI devices can be used by QEMU. + +The first method is to mount the iSCSI LUN on the host, and make it appear= as +any other ordinary SCSI device on the host and then to access this device = as a +/dev/sd device from QEMU. How to do this differs between host OSes. + +The second method involves using the iSCSI initiator that is built into +QEMU. This provides a mechanism that works the same way regardless of which +host OS you are running QEMU on. This section will describe this second me= thod +of using iSCSI together with QEMU. + +In QEMU, iSCSI devices are described using special iSCSI URLs + +@example +URL syntax: +iscsi://[[%]@@][:]// +@end example + +Username and password are optional and only used if your target is set up +using CHAP authentication for access control. +Alternatively the username and password can also be set via environment +variables to have these not show up in the process list + +@example +export LIBISCSI_CHAP_USERNAME=3D +export LIBISCSI_CHAP_PASSWORD=3D +iscsi://// +@end example + +Various session related parameters can be set via special options, either +in a configuration file provided via '-readconfig' or directly on the +command line. + +If the initiator-name is not specified qemu will use a default name +of 'iqn.2008-11.org.linux-kvm[:'] where is the name of the +virtual machine. + + +@example +Setting a specific initiator name to use when logging in to the target +-iscsi initiator-name=3Diqn.qemu.test:my-initiator +@end example + +@example +Controlling which type of header digest to negotiate with the target +-iscsi header-digest=3DCRC32C|CRC32C-NONE|NONE-CRC32C|NONE +@end example + +These can also be set via a configuration file +@example +[iscsi] + user =3D "CHAP username" + password =3D "CHAP password" + initiator-name =3D "iqn.qemu.test:my-initiator" + # header digest is one of CRC32C|CRC32C-NONE|NONE-CRC32C|NONE + header-digest =3D "CRC32C" +@end example + + +Setting the target name allows different options for different targets +@example +[iscsi "iqn.target.name"] + user =3D "CHAP username" + password =3D "CHAP password" + initiator-name =3D "iqn.qemu.test:my-initiator" + # header digest is one of CRC32C|CRC32C-NONE|NONE-CRC32C|NONE + header-digest =3D "CRC32C" +@end example + + +Howto use a configuration file to set iSCSI configuration options: +@example +cat >iscsi.conf <=3D 0.8.3. - -@subsubsection Linux - -On Linux, you can directly use the host device filename instead of a -disk image filename provided you have enough privileges to access -it. For example, use @file{/dev/cdrom} to access to the CDROM. - -@table @code -@item CD -You can specify a CDROM device even if no CDROM is loaded. QEMU has -specific code to detect CDROM insertion or removal. CDROM ejection by -the guest OS is supported. Currently only data CDs are supported. -@item Floppy -You can specify a floppy device even if no floppy is loaded. Floppy -removal is currently not detected accurately (if you change floppy -without doing floppy access while the floppy is not loaded, the guest -OS will think that the same floppy is loaded). -Use of the host's floppy device is deprecated, and support for it will -be removed in a future release. -@item Hard disks -Hard disks can be used. Normally you must specify the whole disk -(@file{/dev/hdb} instead of @file{/dev/hdb1}) so that the guest OS can -see it as a partitioned disk. WARNING: unless you know what you do, it -is better to only make READ-ONLY accesses to the hard disk otherwise -you may corrupt your host data (use the @option{-snapshot} command -line option or modify the device permissions accordingly). -@end table - -@subsubsection Windows - -@table @code -@item CD -The preferred syntax is the drive letter (e.g. @file{d:}). The -alternate syntax @file{\\.\d:} is supported. @file{/dev/cdrom} is -supported as an alias to the first CDROM drive. - -Currently there is no specific code to handle removable media, so it -is better to use the @code{change} or @code{eject} monitor commands to -change or eject media. -@item Hard disks -Hard disks can be used with the syntax: @file{\\.\PhysicalDrive@var{N}} -where @var{N} is the drive number (0 is the first hard disk). - -WARNING: unless you know what you do, it is better to only make -READ-ONLY accesses to the hard disk otherwise you may corrupt your -host data (use the @option{-snapshot} command line so that the -modifications are written in a temporary file). -@end table - - -@subsubsection Mac OS X - -@file{/dev/cdrom} is an alias to the first CDROM. - -Currently there is no specific code to handle removable media, so it -is better to use the @code{change} or @code{eject} monitor commands to -change or eject media. - -@node disk_images_fat_images -@subsection Virtual FAT disk images - -QEMU can automatically create a virtual FAT disk image from a -directory tree. In order to use it, just type: - -@example -qemu-system-i386 linux.img -hdb fat:/my_directory -@end example - -Then you access access to all the files in the @file{/my_directory} -directory without having to copy them in a disk image or to export -them via SAMBA or NFS. The default access is @emph{read-only}. - -Floppies can be emulated with the @code{:floppy:} option: - -@example -qemu-system-i386 linux.img -fda fat:floppy:/my_directory -@end example - -A read/write support is available for testing (beta stage) with the -@code{:rw:} option: - -@example -qemu-system-i386 linux.img -fda fat:floppy:rw:/my_directory -@end example - -What you should @emph{never} do: -@itemize -@item use non-ASCII filenames ; -@item use "-snapshot" together with ":rw:" ; -@item expect it to work when loadvm'ing ; -@item write to the FAT directory on the host system while accessing it wit= h the guest system. -@end itemize - -@node disk_images_nbd -@subsection NBD access - -QEMU can access directly to block device exported using the Network Block = Device -protocol. - -@example -qemu-system-i386 linux.img -hdb nbd://my_nbd_server.mydomain.org:1024/ -@end example - -If the NBD server is located on the same host, you can use an unix socket = instead -of an inet socket: - -@example -qemu-system-i386 linux.img -hdb nbd+unix://?socket=3D/tmp/my_socket -@end example - -In this case, the block device must be exported using qemu-nbd: - -@example -qemu-nbd --socket=3D/tmp/my_socket my_disk.qcow2 -@end example - -The use of qemu-nbd allows sharing of a disk between several guests: -@example -qemu-nbd --socket=3D/tmp/my_socket --share=3D2 my_disk.qcow2 -@end example - -@noindent -and then you can use it with two guests: -@example -qemu-system-i386 linux1.img -hdb nbd+unix://?socket=3D/tmp/my_socket -qemu-system-i386 linux2.img -hdb nbd+unix://?socket=3D/tmp/my_socket -@end example - -If the nbd-server uses named exports (supported since NBD 2.9.18, or with = QEMU's -own embedded NBD server), you must specify an export name in the URI: -@example -qemu-system-i386 -cdrom nbd://localhost/debian-500-ppc-netinst -qemu-system-i386 -cdrom nbd://localhost/openSUSE-11.1-ppc-netinst -@end example - -The URI syntax for NBD is supported since QEMU 1.3. An alternative syntax= is -also available. Here are some example of the older syntax: -@example -qemu-system-i386 linux.img -hdb nbd:my_nbd_server.mydomain.org:1024 -qemu-system-i386 linux2.img -hdb nbd:unix:/tmp/my_socket -qemu-system-i386 -cdrom nbd:localhost:10809:exportname=3Ddebian-500-ppc-ne= tinst -@end example - -@node disk_images_sheepdog -@subsection Sheepdog disk images - -Sheepdog is a distributed storage system for QEMU. It provides highly -available block level storage volumes that can be attached to -QEMU-based virtual machines. - -You can create a Sheepdog disk image with the command: -@example -qemu-img create sheepdog:///@var{image} @var{size} -@end example -where @var{image} is the Sheepdog image name and @var{size} is its -size. - -To import the existing @var{filename} to Sheepdog, you can use a -convert command. -@example -qemu-img convert @var{filename} sheepdog:///@var{image} -@end example - -You can boot from the Sheepdog disk image with the command: -@example -qemu-system-i386 sheepdog:///@var{image} -@end example - -You can also create a snapshot of the Sheepdog image like qcow2. -@example -qemu-img snapshot -c @var{tag} sheepdog:///@var{image} -@end example -where @var{tag} is a tag name of the newly created snapshot. - -To boot from the Sheepdog snapshot, specify the tag name of the -snapshot. -@example -qemu-system-i386 sheepdog:///@var{image}#@var{tag} -@end example - -You can create a cloned image from the existing snapshot. -@example -qemu-img create -b sheepdog:///@var{base}#@var{tag} sheepdog:///@var{image} -@end example -where @var{base} is a image name of the source snapshot and @var{tag} -is its tag name. - -You can use an unix socket instead of an inet socket: - -@example -qemu-system-i386 sheepdog+unix:///@var{image}?socket=3D@var{path} -@end example - -If the Sheepdog daemon doesn't run on the local host, you need to -specify one of the Sheepdog servers to connect to. -@example -qemu-img create sheepdog://@var{hostname}:@var{port}/@var{image} @var{size} -qemu-system-i386 sheepdog://@var{hostname}:@var{port}/@var{image} -@end example - -@node disk_images_iscsi -@subsection iSCSI LUNs - -iSCSI is a popular protocol used to access SCSI devices across a computer -network. - -There are two different ways iSCSI devices can be used by QEMU. - -The first method is to mount the iSCSI LUN on the host, and make it appear= as -any other ordinary SCSI device on the host and then to access this device = as a -/dev/sd device from QEMU. How to do this differs between host OSes. - -The second method involves using the iSCSI initiator that is built into -QEMU. This provides a mechanism that works the same way regardless of which -host OS you are running QEMU on. This section will describe this second me= thod -of using iSCSI together with QEMU. - -In QEMU, iSCSI devices are described using special iSCSI URLs - -@example -URL syntax: -iscsi://[[%]@@][:]// -@end example - -Username and password are optional and only used if your target is set up -using CHAP authentication for access control. -Alternatively the username and password can also be set via environment -variables to have these not show up in the process list - -@example -export LIBISCSI_CHAP_USERNAME=3D -export LIBISCSI_CHAP_PASSWORD=3D -iscsi://// -@end example - -Various session related parameters can be set via special options, either -in a configuration file provided via '-readconfig' or directly on the -command line. - -If the initiator-name is not specified qemu will use a default name -of 'iqn.2008-11.org.linux-kvm[:'] where is the name of the -virtual machine. - - -@example -Setting a specific initiator name to use when logging in to the target --iscsi initiator-name=3Diqn.qemu.test:my-initiator -@end example - -@example -Controlling which type of header digest to negotiate with the target --iscsi header-digest=3DCRC32C|CRC32C-NONE|NONE-CRC32C|NONE -@end example - -These can also be set via a configuration file -@example -[iscsi] - user =3D "CHAP username" - password =3D "CHAP password" - initiator-name =3D "iqn.qemu.test:my-initiator" - # header digest is one of CRC32C|CRC32C-NONE|NONE-CRC32C|NONE - header-digest =3D "CRC32C" -@end example - - -Setting the target name allows different options for different targets -@example -[iscsi "iqn.target.name"] - user =3D "CHAP username" - password =3D "CHAP password" - initiator-name =3D "iqn.qemu.test:my-initiator" - # header digest is one of CRC32C|CRC32C-NONE|NONE-CRC32C|NONE - header-digest =3D "CRC32C" -@end example - - -Howto use a configuration file to set iSCSI configuration options: -@example -cat >iscsi.conf < Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599109016607.656618563363; Tue, 1 Aug 2017 07:51:49 -0700 (PDT) Received: from localhost ([::1]:43038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYWR-00047a-6w for importer@patchew.org; Tue, 01 Aug 2017 10:51:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRd-0000Cy-FC for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRc-0005Q6-Jt for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59752) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRV-0005Hm-ND; Tue, 01 Aug 2017 10:46:41 -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 mx1.redhat.com (Postfix) with ESMTPS id 6DF2E1916A7; Tue, 1 Aug 2017 14:46:40 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52BEA60482; Tue, 1 Aug 2017 14:46:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6DF2E1916A7 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:19 +0200 Message-Id: <20170801144632.3831-3-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 01 Aug 2017 14:46:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/15] iotests: Fix test 156 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz On one hand, the _make_test_img invocation for creating the target image was missing a -u because its backing file is not supposed to exist at that point. On the other hand, nobody noticed probably because the backing file is created later on and _cleanup failed to remove it: The quotation marks were misplaced so bash tried to delete a file literally called "$TEST_IMG{,.target}..." instead of performing brace expansion. Thus, the files stayed around after the first run and qemu-img create did not complain about a missing backing file on any run but the first. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Jeff Cody Signed-off-by: Kevin Wolf --- tests/qemu-iotests/156 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156 index 2c4a06e2d8..e75dc4d743 100755 --- a/tests/qemu-iotests/156 +++ b/tests/qemu-iotests/156 @@ -38,7 +38,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_qemu - rm -f "$TEST_IMG{,.target}{,.backing,.overlay}" + rm -f "$TEST_IMG"{,.target}{,.backing,.overlay} } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 @@ -83,7 +83,7 @@ _send_qemu_cmd $QEMU_HANDLE \ 'return' =20 # Create target image -TEST_IMG=3D"$TEST_IMG.target.overlay" _make_test_img -b "$TEST_IMG.target"= 1M +TEST_IMG=3D"$TEST_IMG.target.overlay" _make_test_img -u -b "$TEST_IMG.targ= et" 1M =20 # Mirror snapshot _send_qemu_cmd $QEMU_HANDLE \ --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599114378134.9902357621445; Tue, 1 Aug 2017 07:51:54 -0700 (PDT) Received: from localhost ([::1]:43039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYWW-0004DK-RB for importer@patchew.org; Tue, 01 Aug 2017 10:51:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRc-0000CN-HK for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRb-0005PA-Lx for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60630) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRW-0005K6-Si; Tue, 01 Aug 2017 10:46:43 -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 mx1.redhat.com (Postfix) with ESMTPS id C930A11BACD; Tue, 1 Aug 2017 14:46:41 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id B898D60482; Tue, 1 Aug 2017 14:46:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C930A11BACD Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:20 +0200 Message-Id: <20170801144632.3831-4-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 01 Aug 2017 14:46:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/15] iotests: Redirect stderr to stdout in 186 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz Without redirecting qemu's stderr to stdout, _filter_qemu will not apply to warnings. This results in $QEMU_PROG not being replaced by QEMU_PROG which is not great if your qemu executable is not called qemu-system-x86_64 (e.g. qemu-system-i386). Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Jeff Cody Signed-off-by: Kevin Wolf --- tests/qemu-iotests/186 | 2 +- tests/qemu-iotests/186.out | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/186 b/tests/qemu-iotests/186 index ab83ee402a..2b9f618f90 100755 --- a/tests/qemu-iotests/186 +++ b/tests/qemu-iotests/186 @@ -56,7 +56,7 @@ function do_run_qemu() done fi echo quit - ) | $QEMU -S -nodefaults -display none -device virtio-scsi-pci -monito= r stdio "$@" + ) | $QEMU -S -nodefaults -display none -device virtio-scsi-pci -monito= r stdio "$@" 2>&1 echo } =20 diff --git a/tests/qemu-iotests/186.out b/tests/qemu-iotests/186.out index b8bf9a2550..c8377fe146 100644 --- a/tests/qemu-iotests/186.out +++ b/tests/qemu-iotests/186.out @@ -442,28 +442,28 @@ ide0-cd0 (NODE_NAME): null-co:// (null-co, read-only) Cache mode: writeback (qemu) quit =20 -qemu-system-x86_64: -drive if=3Dscsi,driver=3Dnull-co: warning: bus=3D0,un= it=3D0 is deprecated with this machine type Testing: -drive if=3Dscsi,driver=3Dnull-co QEMU X.Y.Z monitor - type 'help' for more information -(qemu) info block +(qemu) QEMU_PROG: -drive if=3Dscsi,driver=3Dnull-co: warning: bus=3D0,unit= =3D0 is deprecated with this machine type +info block scsi0-hd0 (NODE_NAME): null-co:// (null-co) Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] Cache mode: writeback (qemu) quit =20 -qemu-system-x86_64: -drive if=3Dscsi,media=3Dcdrom: warning: bus=3D0,unit= =3D0 is deprecated with this machine type Testing: -drive if=3Dscsi,media=3Dcdrom QEMU X.Y.Z monitor - type 'help' for more information -(qemu) info block +(qemu) QEMU_PROG: -drive if=3Dscsi,media=3Dcdrom: warning: bus=3D0,unit=3D= 0 is deprecated with this machine type +info block scsi0-cd0: [not inserted] Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] Removable device: not locked, tray closed (qemu) quit =20 -qemu-system-x86_64: -drive if=3Dscsi,driver=3Dnull-co,media=3Dcdrom: warni= ng: bus=3D0,unit=3D0 is deprecated with this machine type Testing: -drive if=3Dscsi,driver=3Dnull-co,media=3Dcdrom QEMU X.Y.Z monitor - type 'help' for more information -(qemu) info block +(qemu) QEMU_PROG: -drive if=3Dscsi,driver=3Dnull-co,media=3Dcdrom: warning= : bus=3D0,unit=3D0 is deprecated with this machine type +info block scsi0-cd0 (NODE_NAME): null-co:// (null-co, read-only) Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] Removable device: not locked, tray closed --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150159894783617.03043922339714; Tue, 1 Aug 2017 07:49:07 -0700 (PDT) Received: from localhost ([::1]:43021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYTm-0001Zq-8X for importer@patchew.org; Tue, 01 Aug 2017 10:49:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRc-0000Bw-ES for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRb-0005PF-N4 for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35732) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRY-0005LG-7E; Tue, 01 Aug 2017 10:46:44 -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 mx1.redhat.com (Postfix) with ESMTPS id 2C89B67AD0; Tue, 1 Aug 2017 14:46:43 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E56E60482; Tue, 1 Aug 2017 14:46:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2C89B67AD0 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:21 +0200 Message-Id: <20170801144632.3831-5-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 01 Aug 2017 14:46:43 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/15] iotests: Check dirty bitmap statistics in 124 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake We had a bug for multiple releases where dirty-bitmap count was documented in bytes but reported in sectors; enhance the testsuite to add coverage of DirtyBitmapInfo to ensure we do not regress again. Signed-off-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: John Snow Signed-off-by: Kevin Wolf --- tests/qemu-iotests/124 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124 index d0d2c2bfb0..8e76e62f93 100644 --- a/tests/qemu-iotests/124 +++ b/tests/qemu-iotests/124 @@ -336,7 +336,12 @@ class TestIncrementalBackup(TestIncrementalBackupBase): (('0xab', 0, 512), ('0xfe', '16M', '256k'), ('0x64', '32736k', '64k'))) - + # Check the dirty bitmap stats + result =3D self.vm.qmp('query-block') + self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/name', 'bitmap= 0') + self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/count', 458752) + self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/granularity', = 65536) + self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/status', 'acti= ve') =20 # Prepare a cluster_size=3D128k backup target without a backing fi= le. (target, _) =3D bitmap0.new_target() --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599283247530.578255257606; Tue, 1 Aug 2017 07:54:43 -0700 (PDT) Received: from localhost ([::1]:43048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYZF-0006Vd-EK for importer@patchew.org; Tue, 01 Aug 2017 10:54:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRd-0000D6-M8 for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRc-0005Py-Ir for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58818) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRZ-0005Mj-Jv; Tue, 01 Aug 2017 10:46:45 -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 mx1.redhat.com (Postfix) with ESMTPS id 858CA136B96; Tue, 1 Aug 2017 14:46:44 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77E23A5787; Tue, 1 Aug 2017 14:46:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 858CA136B96 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:22 +0200 Message-Id: <20170801144632.3831-6-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 01 Aug 2017 14:46:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/15] iotests: Add test of recent fix to 'qemu-img measure' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake The new test 190 ensures we don't regress back to an infinite loop when measuring the size of a 2T+ qcow2 image. I did not append to test 178, because that test is also designed to run with format 'raw'; also, this gives us some coverage of the measure command under the quick group. Signed-off-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- tests/qemu-iotests/190 | 59 ++++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/190.out | 11 +++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 71 insertions(+) create mode 100755 tests/qemu-iotests/190 create mode 100644 tests/qemu-iotests/190.out diff --git a/tests/qemu-iotests/190 b/tests/qemu-iotests/190 new file mode 100755 index 0000000000..8f808fef5d --- /dev/null +++ b/tests/qemu-iotests/190 @@ -0,0 +1,59 @@ +#!/bin/bash +# +# qemu-img measure sub-command tests on huge qcow2 files +# +# Copyright (C) 2017 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# creator +owner=3Deblake@redhat.com + +seq=3D`basename $0` +echo "QA output created by $seq" + +here=3D`pwd` +status=3D1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img + rm -f "$TEST_IMG.converted" +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.pattern + +# See 178 for more extensive tests across more formats +_supported_fmt qcow2 +_supported_proto file +_supported_os Linux + +echo "=3D=3D Huge file =3D=3D" +echo + +IMGOPTS=3D'cluster_size=3D2M' _make_test_img 2T + +$QEMU_IMG measure -O raw -f qcow2 "$TEST_IMG" +$QEMU_IMG measure -O qcow2 -o cluster_size=3D64k -f qcow2 "$TEST_IMG" +$QEMU_IMG measure -O qcow2 -o cluster_size=3D2M -f qcow2 "$TEST_IMG" + +# success, all done +echo "*** done" +rm -f $seq.full +status=3D0 diff --git a/tests/qemu-iotests/190.out b/tests/qemu-iotests/190.out new file mode 100644 index 0000000000..d001942002 --- /dev/null +++ b/tests/qemu-iotests/190.out @@ -0,0 +1,11 @@ +QA output created by 190 +=3D=3D Huge file =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2199023255552 +required size: 2199023255552 +fully allocated size: 2199023255552 +required size: 335806464 +fully allocated size: 2199359062016 +required size: 18874368 +fully allocated size: 2199042129920 +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 287f0ea27d..823811076d 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -184,3 +184,4 @@ 186 rw auto 188 rw auto quick 189 rw auto +190 rw auto quick --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501598955031542.8534082566525; Tue, 1 Aug 2017 07:49:15 -0700 (PDT) Received: from localhost ([::1]:43022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYTx-0001kq-K9 for importer@patchew.org; Tue, 01 Aug 2017 10:49:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRe-0000DZ-3j for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRd-0005RB-AS for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35884) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRb-0005Nn-01; Tue, 01 Aug 2017 10:46:47 -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 mx1.redhat.com (Postfix) with ESMTPS id DF5E267AD0; Tue, 1 Aug 2017 14:46:45 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0D7B7DB3B; Tue, 1 Aug 2017 14:46:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DF5E267AD0 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:23 +0200 Message-Id: <20170801144632.3831-7-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 01 Aug 2017 14:46:46 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/15] block: fix dangling bs->explicit_options in block.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Manos Pitsidianakis In some error paths it is possible to QDECREF a freed dangling explicit_options, resulting in a heap overflow crash. For example bdrv_open_inherit()'s fail unrefs it, then calls bdrv_unref which calls bdrv_close which also unrefs it. Signed-off-by: Manos Pitsidianakis Signed-off-by: Kevin Wolf --- block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block.c b/block.c index 37e72b7a96..7a78bc647b 100644 --- a/block.c +++ b/block.c @@ -2608,6 +2608,7 @@ fail: QDECREF(bs->options); QDECREF(options); bs->options =3D NULL; + bs->explicit_options =3D NULL; bdrv_unref(bs); error_propagate(errp, local_err); return NULL; @@ -3087,6 +3088,7 @@ static void bdrv_close(BlockDriverState *bs) QDECREF(bs->options); QDECREF(bs->explicit_options); bs->options =3D NULL; + bs->explicit_options =3D NULL; QDECREF(bs->full_open_options); bs->full_open_options =3D NULL; } --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599139084902.0338460599585; Tue, 1 Aug 2017 07:52:19 -0700 (PDT) Received: from localhost ([::1]:43041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYWv-0004XU-Nv for importer@patchew.org; Tue, 01 Aug 2017 10:52:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRg-0000GA-Gl for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRf-0005TK-Ib for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49600) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRc-0005Pi-T3; Tue, 01 Aug 2017 10:46:49 -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 mx1.redhat.com (Postfix) with ESMTPS id 6E6C8DEA8B; Tue, 1 Aug 2017 14:46:47 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 377E27E23C; Tue, 1 Aug 2017 14:46:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6E6C8DEA8B Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:24 +0200 Message-Id: <20170801144632.3831-8-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 01 Aug 2017 14:46:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/15] block: fix leaks in bdrv_open_driver() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Manos Pitsidianakis bdrv_open_driver() is called in two places, bdrv_new_open_driver() and bdrv_open_common(). In the latter, failure cleanup in is in its caller, bdrv_open_inherit(), which unrefs the bs->file of the failed driver open if it exists. Let's move the bs->file cleanup to bdrv_open_driver() to take care of all callers and do not set bs->drv to NULL unless the driver's open function failed. When bs is destroyed by removing its last reference, it calls bdrv_close() which checks bs->drv to perform the needed cleanups and also call the driver's close function. Since it cleans up options and opaque we must take care not leave dangling pointers. The error paths in bdrv_open_driver() are now two: If open fails, drv->bdrv_close() should not be called. Unref the child if it exists, free what we allocated and set bs->drv to NULL. Return the error and let callers free their stuff. If open succeeds but we fail after, return the error and let callers unref and delete their bs, while cleaning up their allocations. Signed-off-by: Manos Pitsidianakis Signed-off-by: Kevin Wolf --- block.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/block.c b/block.c index 7a78bc647b..ce9cce7b3c 100644 --- a/block.c +++ b/block.c @@ -1119,20 +1119,19 @@ static int bdrv_open_driver(BlockDriverState *bs, B= lockDriver *drv, } else { error_setg_errno(errp, -ret, "Could not open image"); } - goto free_and_fail; + goto open_failed; } =20 ret =3D refresh_total_sectors(bs, bs->total_sectors); if (ret < 0) { error_setg_errno(errp, -ret, "Could not refresh total sector count= "); - goto free_and_fail; + return ret; } =20 bdrv_refresh_limits(bs, &local_err); if (local_err) { error_propagate(errp, local_err); - ret =3D -EINVAL; - goto free_and_fail; + return -EINVAL; } =20 assert(bdrv_opt_mem_align(bs) !=3D 0); @@ -1140,12 +1139,14 @@ static int bdrv_open_driver(BlockDriverState *bs, B= lockDriver *drv, assert(is_power_of_2(bs->bl.request_alignment)); =20 return 0; - -free_and_fail: - /* FIXME Close bs first if already opened*/ +open_failed: + bs->drv =3D NULL; + if (bs->file !=3D NULL) { + bdrv_unref_child(bs, bs->file); + bs->file =3D NULL; + } g_free(bs->opaque); bs->opaque =3D NULL; - bs->drv =3D NULL; return ret; } =20 @@ -1166,7 +1167,9 @@ BlockDriverState *bdrv_new_open_driver(BlockDriver *d= rv, const char *node_name, ret =3D bdrv_open_driver(bs, drv, node_name, bs->options, flags, errp); if (ret < 0) { QDECREF(bs->explicit_options); + bs->explicit_options =3D NULL; QDECREF(bs->options); + bs->options =3D NULL; bdrv_unref(bs); return NULL; } @@ -2600,9 +2603,6 @@ static BlockDriverState *bdrv_open_inherit(const char= *filename, =20 fail: blk_unref(file); - if (bs->file !=3D NULL) { - bdrv_unref_child(bs, bs->file); - } QDECREF(snapshot_options); QDECREF(bs->explicit_options); QDECREF(bs->options); --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599272134201.59230961149217; Tue, 1 Aug 2017 07:54:32 -0700 (PDT) Received: from localhost ([::1]:43047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYZ1-0006Kh-FT for importer@patchew.org; Tue, 01 Aug 2017 10:54:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRk-0000Kl-E7 for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRg-0005Tv-5C for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60966) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRd-0005R1-T9; Tue, 01 Aug 2017 10:46:50 -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 mx1.redhat.com (Postfix) with ESMTPS id BC469A0B20; Tue, 1 Aug 2017 14:46:48 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB13C7E23D; Tue, 1 Aug 2017 14:46:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BC469A0B20 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:25 +0200 Message-Id: <20170801144632.3831-9-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 01 Aug 2017 14:46:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/15] qemu-iotests/041: Fix leaked scratch images X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" qemu-iotests 041 left quorum_snapshot.img and target.img behind in the scratch directory. Make sure to clean up after completing the tests. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody Reviewed-by: Eric Blake --- tests/qemu-iotests/041 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 4cda540735..a860a31e9a 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -418,6 +418,7 @@ new_state =3D "1" def tearDown(self): self.vm.shutdown() os.remove(test_img) + os.remove(target_img) os.remove(backing_img) os.remove(self.blkdebug_file) =20 @@ -568,6 +569,7 @@ new_state =3D "1" def tearDown(self): self.vm.shutdown() os.remove(test_img) + os.remove(target_img) os.remove(backing_img) os.remove(self.blkdebug_file) =20 @@ -821,7 +823,7 @@ class TestRepairQuorum(iotests.QMPTestCase): =20 def tearDown(self): self.vm.shutdown() - for i in self.IMAGES + [ quorum_repair_img ]: + for i in self.IMAGES + [ quorum_repair_img, quorum_snapshot_file ]: # Do a try/except because the test may have deleted some images try: os.remove(i) --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599451847660.3867932825431; Tue, 1 Aug 2017 07:57:31 -0700 (PDT) Received: from localhost ([::1]:43069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYbx-0000ht-Ed for importer@patchew.org; Tue, 01 Aug 2017 10:57:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRl-0000Lg-5n for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRk-0005XU-Jw for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35410) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRf-0005SU-AK; Tue, 01 Aug 2017 10:46:51 -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 mx1.redhat.com (Postfix) with ESMTPS id 30280349E40; Tue, 1 Aug 2017 14:46:50 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10C2860482; Tue, 1 Aug 2017 14:46:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 30280349E40 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:26 +0200 Message-Id: <20170801144632.3831-10-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 01 Aug 2017 14:46:50 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/15] qemu-iotests: Remove blkdebug.conf after tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" qemu-iotests 074 and 179 left a blkdebug.conf behind in the scratch directory. Make sure to clean up after completing the tests. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody Reviewed-by: Eric Blake --- tests/qemu-iotests/074 | 1 + tests/qemu-iotests/179 | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/qemu-iotests/074 b/tests/qemu-iotests/074 index aba126cb69..b17866bd34 100755 --- a/tests/qemu-iotests/074 +++ b/tests/qemu-iotests/074 @@ -32,6 +32,7 @@ _cleanup() echo "Cleanup" _cleanup_test_img rm "${TEST_IMG2}" + rm -f "$TEST_DIR/blkdebug.conf" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/179 b/tests/qemu-iotests/179 index 7bc8db8fe0..115944a753 100755 --- a/tests/qemu-iotests/179 +++ b/tests/qemu-iotests/179 @@ -30,6 +30,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img + rm -f "$TEST_DIR/blkdebug.conf" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599297782894.5700535800793; Tue, 1 Aug 2017 07:54:57 -0700 (PDT) Received: from localhost ([::1]:43049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYZU-0006gZ-CX for importer@patchew.org; Tue, 01 Aug 2017 10:54:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRm-0000NA-6a for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRl-0005Yj-HN for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:46:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59744) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRh-0005UB-3U; Tue, 01 Aug 2017 10:46:53 -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 mx1.redhat.com (Postfix) with ESMTPS id AB9C7C0E4D1A; Tue, 1 Aug 2017 14:46:51 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A31B60482; Tue, 1 Aug 2017 14:46:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AB9C7C0E4D1A Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:27 +0200 Message-Id: <20170801144632.3831-11-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 01 Aug 2017 14:46:52 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/15] qemu-iotests/141: Fix image cleanup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" qemu-iotests 141 attempted to use brace expansion to remove all images with a single command. However, for this to work, the braces shouldn't be quoted. With this fix, the tests correctly cleans up its scratch images. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody Reviewed-by: Eric Blake --- tests/qemu-iotests/141 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141 index 40a3405968..2f9d7b9bc2 100755 --- a/tests/qemu-iotests/141 +++ b/tests/qemu-iotests/141 @@ -31,7 +31,7 @@ _cleanup() { _cleanup_qemu _cleanup_test_img - rm -f "$TEST_DIR/{b,m,o}.$IMGFMT" + rm -f "$TEST_DIR"/{b,m,o}.$IMGFMT } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599132994171.44501353521775; Tue, 1 Aug 2017 07:52:12 -0700 (PDT) Received: from localhost ([::1]:43040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYWp-0004Td-Is for importer@patchew.org; Tue, 01 Aug 2017 10:52:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRp-0000RW-O7 for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRp-0005c0-5v for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46430) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRi-0005VJ-8R; Tue, 01 Aug 2017 10:46:54 -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 mx1.redhat.com (Postfix) with ESMTPS id 0C506246FD0; Tue, 1 Aug 2017 14:46:53 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5A2F7DB3B; Tue, 1 Aug 2017 14:46:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0C506246FD0 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:28 +0200 Message-Id: <20170801144632.3831-12-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 01 Aug 2017 14:46:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/15] qemu-iotests/153: Fix leaked scratch images X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" qemu-iotests 153 left t.qcow2.c behind in the scratch directory. Make sure to clean it up after completing the tests. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody Reviewed-by: Eric Blake --- tests/qemu-iotests/153 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153 index 0b45d78ea3..fa25eb24bd 100755 --- a/tests/qemu-iotests/153 +++ b/tests/qemu-iotests/153 @@ -35,6 +35,7 @@ _cleanup() rm -f "${TEST_IMG}.convert" rm -f "${TEST_IMG}.a" rm -f "${TEST_IMG}.b" + rm -f "${TEST_IMG}.c" rm -f "${TEST_IMG}.lnk" } trap "_cleanup; exit \$status" 0 1 2 3 15 --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599524300885.7806907162903; Tue, 1 Aug 2017 07:58:44 -0700 (PDT) Received: from localhost ([::1]:43080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYd9-0001nI-1L for importer@patchew.org; Tue, 01 Aug 2017 10:58:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRu-0000Wo-7x for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRp-0005cT-Ut for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35810) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRk-0005WQ-6x; Tue, 01 Aug 2017 10:46:56 -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 mx1.redhat.com (Postfix) with ESMTPS id 1C23B1B6F64; Tue, 1 Aug 2017 14:46:55 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B19C60482; Tue, 1 Aug 2017 14:46:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1C23B1B6F64 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:29 +0200 Message-Id: <20170801144632.3831-13-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 01 Aug 2017 14:46:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/15] qemu-iotests/162: Fix leaked temporary files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" qemu-iotests 162 left qemu-nbd.pid behind in the scratch directory, and potentially a file called '42' in the current directory. Make sure to clean it up after completing the tests. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody Reviewed-by: Eric Blake --- tests/qemu-iotests/162 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/qemu-iotests/162 b/tests/qemu-iotests/162 index cad2bd70ab..477a806360 100755 --- a/tests/qemu-iotests/162 +++ b/tests/qemu-iotests/162 @@ -28,6 +28,13 @@ echo "QA output created by $seq" here=3D"$PWD" status=3D1 # failure is the default! =20 +_cleanup() +{ + rm -f "${TEST_DIR}/qemu-nbd.pid" + rm -f 42 +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + # get standard environment, filters and checks . ./common.rc . ./common.filter --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501598960841873.244664304016; Tue, 1 Aug 2017 07:49:20 -0700 (PDT) Received: from localhost ([::1]:43023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYU3-0001qz-H9 for importer@patchew.org; Tue, 01 Aug 2017 10:49:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRo-0000Q0-BH for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRn-0005aQ-Lj for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35908) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRl-0005Y4-KK; Tue, 01 Aug 2017 10:46:57 -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 mx1.redhat.com (Postfix) with ESMTPS id 749A3CC264; Tue, 1 Aug 2017 14:46:56 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66FA960482; Tue, 1 Aug 2017 14:46:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 749A3CC264 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:30 +0200 Message-Id: <20170801144632.3831-14-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 01 Aug 2017 14:46:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 13/15] qemu-iotests/063: Fix leaked image X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" qemu-iotests 063 left t.raw.raw1 behind in the scratch directory because it used the wrong suffix. Make sure to clean it up after completing the test. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody Reviewed-by: Eric Blake --- tests/qemu-iotests/063 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063 index 352e78c778..e4f6ea9385 100755 --- a/tests/qemu-iotests/063 +++ b/tests/qemu-iotests/063 @@ -31,7 +31,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.orig" "$TEST_IMG.raw" "$TEST_IMG.raw2" + rm -f "$TEST_IMG.orig" "$TEST_IMG.raw1" "$TEST_IMG.raw2" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 @@ -91,8 +91,6 @@ if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG.= orig" "$TEST_IMG" >/dev exit 1 fi =20 -rm -f "$TEST_IMG.orig" "$TEST_IMG.raw" "$TEST_IMG.raw2" - echo "*** done" rm -f $seq.full status=3D0 --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150159944033520.832098093556056; Tue, 1 Aug 2017 07:57:20 -0700 (PDT) Received: from localhost ([::1]:43068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYbk-0000XX-NM for importer@patchew.org; Tue, 01 Aug 2017 10:57:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRw-0000Z3-IX for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRq-0005cd-7r for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50178) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRn-0005Za-2u; Tue, 01 Aug 2017 10:46:59 -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 mx1.redhat.com (Postfix) with ESMTPS id 02F9512E540; Tue, 1 Aug 2017 14:46:58 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id C032760482; Tue, 1 Aug 2017 14:46:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 02F9512E540 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:31 +0200 Message-Id: <20170801144632.3831-15-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 01 Aug 2017 14:46:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 14/15] qemu-iotests/059: Fix leaked image files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" qemu-iotests 059 left a whole lot of image files behind in the scratch directory because VMDK creates additional files for extents and cleaning them up requires the original image intact (it parses qemu-img info output to find all extent files), but the image overwrote it many times like it works for all other image formats. In addition, _use_sample_img overwrites the TEST_IMG variable, causing new images created afterwards to reuse the name of the sample file rather than the usual t.IMGFMT. This patch adds an intermediate _cleanup_test_img after each subtest that created an image file with additional extent files, and also after each use of a sample image. _cleanup_test_img is also changed so that it resets TEST_IMG after a sample image is cleaned up. Note that this test was failing before this commit and continues to do so after it. This failure was introduced in commit 9877860 ('block/vmdk: Report failures in vmdk_read_cid()') and needs to be dealt with separately. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody Reviewed-by: Eric Blake --- tests/qemu-iotests/059 | 11 ++++++++++- tests/qemu-iotests/059.out | 22 +++++++++++----------- tests/qemu-iotests/common.rc | 3 +++ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 index 6655aaf384..a1c34eeb7c 100755 --- a/tests/qemu-iotests/059 +++ b/tests/qemu-iotests/059 @@ -29,7 +29,8 @@ status=3D1 # failure is the default! =20 _cleanup() { - _cleanup_test_img + _cleanup_test_img + rm -f "$TEST_IMG.qcow2" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 @@ -72,15 +73,18 @@ echo echo "=3D=3D=3D Testing monolithicFlat creation and opening =3D=3D=3D" IMGOPTS=3D"subformat=3DmonolithicFlat" _make_test_img 2G _img_info +_cleanup_test_img =20 echo echo "=3D=3D=3D Testing monolithicFlat with zeroed_grain =3D=3D=3D" IMGOPTS=3D"subformat=3DmonolithicFlat,zeroed_grain=3Don" _make_test_img 2G +_cleanup_test_img =20 echo echo "=3D=3D=3D Testing big twoGbMaxExtentFlat =3D=3D=3D" IMGOPTS=3D"subformat=3DtwoGbMaxExtentFlat" _make_test_img 1000G $QEMU_IMG info $TEST_IMG | _filter_testdir | sed -e 's/cid: [0-9]*/cid: XX= XXXXXX/' +_cleanup_test_img =20 echo echo "=3D=3D=3D Testing malformed VMFS extent description line =3D=3D=3D" @@ -114,6 +118,7 @@ echo "=3D=3D=3D Testing monolithicFlat with internally = generated JSON file name =3D=3D=3D" IMGOPTS=3D"subformat=3DmonolithicFlat" _make_test_img 64M $QEMU_IO -c "open -o driver=3D$IMGFMT,file.driver=3Dblkdebug,file.image.fi= lename=3D$TEST_IMG,file.inject-error.0.event=3Dread_aio" 2>&1 \ | _filter_testdir | _filter_imgfmt +_cleanup_test_img =20 echo echo "=3D=3D=3D Testing version 3 =3D=3D=3D" @@ -123,6 +128,7 @@ for i in {0..99}; do $QEMU_IO -r -c "read -P $(( i % 10 + 0x30 )) $(( i * 64 * 1024 * 10 + = i * 512 )) 512" $TEST_IMG \ | _filter_qemu_io done +_cleanup_test_img =20 echo echo "=3D=3D=3D Testing 4TB monolithicFlat creation and IO =3D=3D=3D" @@ -130,6 +136,7 @@ IMGOPTS=3D"subformat=3DmonolithicFlat" _make_test_img 4T _img_info $QEMU_IO -c "write -P 0xa 900G 512" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "read -v 900G 1024" "$TEST_IMG" | _filter_qemu_io +_cleanup_test_img =20 echo echo "=3D=3D=3D Testing qemu-img map on extents =3D=3D=3D" @@ -139,12 +146,14 @@ for fmt in monolithicSparse twoGbMaxExtentSparse; do $QEMU_IO -c "write 2147483136 1k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "write 5G 1k" "$TEST_IMG" | _filter_qemu_io $QEMU_IMG map "$TEST_IMG" | _filter_testdir + _cleanup_test_img done =20 echo echo "=3D=3D=3D Testing afl image with a very large capacity =3D=3D=3D" _use_sample_img afl9.vmdk.bz2 _img_info +_cleanup_test_img =20 # success, all done echo "*** done" diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out index 6154509bc3..f6dce7947c 100644 --- a/tests/qemu-iotests/059.out +++ b/tests/qemu-iotests/059.out @@ -2259,8 +2259,8 @@ read 512/512 bytes at offset 64931328 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing 4TB monolithicFlat creation and IO =3D=3D=3D -Formatting 'TEST_DIR/iotest-version3.IMGFMT', fmt=3DIMGFMT size=3D43980465= 11104 subformat=3DmonolithicFlat -image: TEST_DIR/iotest-version3.IMGFMT +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D4398046511104 subforma= t=3DmonolithicFlat +image: TEST_DIR/t.IMGFMT file format: IMGFMT virtual size: 4.0T (4398046511104 bytes) wrote 512/512 bytes at offset 966367641600 @@ -2333,7 +2333,7 @@ read 1024/1024 bytes at offset 966367641600 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing qemu-img map on extents =3D=3D=3D -Formatting 'TEST_DIR/iotest-version3.IMGFMT', fmt=3DIMGFMT size=3D33285996= 544 subformat=3DmonolithicSparse +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D33285996544 subformat= =3DmonolithicSparse wrote 1024/1024 bytes at offset 65024 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 1024/1024 bytes at offset 2147483136 @@ -2341,10 +2341,10 @@ wrote 1024/1024 bytes at offset 2147483136 wrote 1024/1024 bytes at offset 5368709120 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Offset Length Mapped to File -0 0x20000 0x3f0000 TEST_DIR/iotest-version3.v= mdk -0x7fff0000 0x20000 0x410000 TEST_DIR/iotest-version3.v= mdk -0x140000000 0x10000 0x430000 TEST_DIR/iotest-version3.v= mdk -Formatting 'TEST_DIR/iotest-version3.IMGFMT', fmt=3DIMGFMT size=3D33285996= 544 subformat=3DtwoGbMaxExtentSparse +0 0x20000 0x3f0000 TEST_DIR/t.vmdk +0x7fff0000 0x20000 0x410000 TEST_DIR/t.vmdk +0x140000000 0x10000 0x430000 TEST_DIR/t.vmdk +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D33285996544 subformat= =3DtwoGbMaxExtentSparse wrote 1024/1024 bytes at offset 65024 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 1024/1024 bytes at offset 2147483136 @@ -2352,10 +2352,10 @@ wrote 1024/1024 bytes at offset 2147483136 wrote 1024/1024 bytes at offset 5368709120 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Offset Length Mapped to File -0 0x20000 0x50000 TEST_DIR/iotest-version3-s= 001.vmdk -0x7fff0000 0x10000 0x70000 TEST_DIR/iotest-version3-s= 001.vmdk -0x80000000 0x10000 0x50000 TEST_DIR/iotest-version3-s= 002.vmdk -0x140000000 0x10000 0x50000 TEST_DIR/iotest-version3-s= 003.vmdk +0 0x20000 0x50000 TEST_DIR/t-s001.vmdk +0x7fff0000 0x10000 0x70000 TEST_DIR/t-s001.vmdk +0x80000000 0x10000 0x50000 TEST_DIR/t-s002.vmdk +0x140000000 0x10000 0x50000 TEST_DIR/t-s003.vmdk =20 =3D=3D=3D Testing afl image with a very large capacity =3D=3D=3D qemu-img: Can't get image size 'TEST_DIR/afl9.IMGFMT': File too large diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 2548e58b99..bfbc80e5f6 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -92,6 +92,7 @@ else TEST_IMG=3D$IMGPROTO:$TEST_DIR/t.$IMGFMT fi fi +ORIG_TEST_IMG=3D"$TEST_IMG" =20 _optstr_add() { @@ -228,6 +229,8 @@ _cleanup_test_img() if [ -n "$SAMPLE_IMG_FILE" ] then rm -f "$TEST_DIR/$SAMPLE_IMG_FILE" + SAMPLE_IMG_FILE=3D + TEST_IMG=3D"$ORIG_TEST_IMG" fi ;; =20 --=20 2.13.3 From nobody Fri May 3 00:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501599624597569.3846977745293; Tue, 1 Aug 2017 08:00:24 -0700 (PDT) Received: from localhost ([::1]:43088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYek-00039N-Ml for importer@patchew.org; Tue, 01 Aug 2017 11:00:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcYRu-0000Wn-75 for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcYRq-0005cv-He for qemu-devel@nongnu.org; Tue, 01 Aug 2017 10:47:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46099) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcYRo-0005aV-Du; Tue, 01 Aug 2017 10:47:00 -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 mx1.redhat.com (Postfix) with ESMTPS id 5ADA31505E6; Tue, 1 Aug 2017 14:46:59 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.ams2.redhat.com [10.36.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E02460482; Tue, 1 Aug 2017 14:46:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5ADA31505E6 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 1 Aug 2017 16:46:32 +0200 Message-Id: <20170801144632.3831-16-kwolf@redhat.com> In-Reply-To: <20170801144632.3831-1-kwolf@redhat.com> References: <20170801144632.3831-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 01 Aug 2017 14:46:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 15/15] block/qapi: Remove redundant NULL check to silence Coverity X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When skipping implicit nodes in bdrv_block_device_info(), we know that bs0 is always non-NULL; initially, because it's taken from a BdrvChild and a BdrvChild never has a NULL bs, and after the first iteration because implicit nodes always have a backing file. Remove the NULL check and add an assertion that the implicit node does indeed have a backing file. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Jeff Cody --- block/qapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/qapi.c b/block/qapi.c index d2b18ee9df..5f1a71f5d2 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -145,8 +145,9 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *b= lk, =20 /* Skip automatically inserted nodes that the user isn't aware of = for * query-block (blk !=3D NULL), but not for query-named-block-node= s */ - while (blk && bs0 && bs0->drv && bs0->implicit) { + while (blk && bs0->drv && bs0->implicit) { bs0 =3D backing_bs(bs0); + assert(bs0); } } =20 --=20 2.13.3