qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: lijun <junmuzi@gmail.com>, qemu-devel@nongnu.org
Cc: lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH] HMP: snapshot_blkdev can not consider //root/sn1 and /root/sn1 as the same file
Date: Fri, 15 Nov 2013 09:55:45 -0700	[thread overview]
Message-ID: <52865211.4020306@redhat.com> (raw)
In-Reply-To: <52864A3A.4030601@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 976 bytes --]

On 11/15/2013 09:22 AM, lijun wrote:
> From: Jun Li <junmuzi@gmail.com>
> 
> Hi all,
> 
> 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 != '\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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  reply	other threads:[~2013-11-15 16:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15 16:22 [Qemu-devel] [PATCH] HMP: snapshot_blkdev can not consider //root/sn1 and /root/sn1 as the same file lijun
2013-11-15 16:55 ` Eric Blake [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-11-15 16:31 lijun
2013-11-15 16:42 ` Max Reitz
2013-11-15 17:21   ` Eric Blake
2013-11-18 13:31     ` Stefan Hajnoczi
2013-12-09  6:06       ` jun muzi
2013-12-09 12:17         ` Stefan Hajnoczi
2013-12-10 13:58           ` lijun
2014-01-02  8:55             ` Stefan Hajnoczi
2014-01-02 13:06               ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52865211.4020306@redhat.com \
    --to=eblake@redhat.com \
    --cc=junmuzi@gmail.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).