From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhMgT-0003dG-Jm for qemu-devel@nongnu.org; Fri, 15 Nov 2013 11:55:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhMgO-0008Or-Mi for qemu-devel@nongnu.org; Fri, 15 Nov 2013 11:55:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhMgO-0008Od-Bu for qemu-devel@nongnu.org; Fri, 15 Nov 2013 11:55:48 -0500 Message-ID: <52865211.4020306@redhat.com> Date: Fri, 15 Nov 2013 09:55:45 -0700 From: Eric Blake MIME-Version: 1.0 References: <52864A3A.4030601@gmail.com> In-Reply-To: <52864A3A.4030601@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lJFbGtmor2vATGql0j6LQ2vKVBIB1af5W" Subject: Re: [Qemu-devel] [PATCH] HMP: snapshot_blkdev can not consider //root/sn1 and /root/sn1 as the same file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: lijun , qemu-devel@nongnu.org Cc: lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lJFbGtmor2vATGql0j6LQ2vKVBIB1af5W Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/15/2013 09:22 AM, lijun wrote: > From: Jun Li >=20 > Hi all, >=20 > snapshot_blkdev can not consider //root/sn1 and /root/sn1 as the same > file. When file /root/sn1 is the base file, do snapshot using file > //root/sn1, qemu consider it as a new file. So this will rewrite the > base file. Careful. On cygwin, /root and //root are two different files (and POSIX allows this). While qemu hasn't yet been ported to cygwin, we should not make the task harder by using incorrect ad-hoc normalization. > + /* Delete duplicate '/' in filename. */ > + while (*p !=3D '\0') { Rather than hand-rolling a loop, you should use realpath() (guaranteed by POSIX, but not always portable) or its appropriate glib wrapper, where we can assume that glib will properly account for // being distinct on platforms where it matters. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --lJFbGtmor2vATGql0j6LQ2vKVBIB1af5W Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJShlIRAAoJEKeha0olJ0Nqi1IH/0+yWXeEKsppDv5hEDKzhU6h tTVLM1sL27yIWLED7LznxhwrbflJASJEQ7Dxnv5N/xwWeFOTPxxOCYLhVKPnmGAk 7TVuyeBsBtL/SiOmUdF+K0Ggmnq4ga9mKxW9ddbfMtW9luazw3NVHcGMns8U4Gts xrdkqVfiPfwgBgw7Vlm0BOw4liOABDEWhBaaaFZfsoviNu7W/Dd/m5SnIFKbUD1R nbhdR/wjDTTccawDIsJLxZ6/DO7ZHKl7zdQuBrEehpt0erRKOLc1mnKy7c+CUifE DoDbnacFp1Y0KDXciEvT5R5u2Xb6X5fftATYOiTq26uSk8MoFsIgFY910QFiNRw= =MmGM -----END PGP SIGNATURE----- --lJFbGtmor2vATGql0j6LQ2vKVBIB1af5W--