qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2 1/5] Refine and export infinite loop checking


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH V2 1/5] Refine and export infinite loop checking in collect_image_info_list()
Date: Wed, 10 Jul 2013 18:49:15 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, 07/10 18:25, Fam Zheng wrote:
> > +
> > +    if (backing_file) {
> > +        /* Check if file exists. */
> > +        if (access(filename, F_OK)) {
> > +            inode = -1;
> > +        } else {
> > +            if (stat(filename, &sbuf) == -1) {
> > +                error_report("Get file %s stat failed.", filename);
> > +                goto err;
> > +            }
> > +            inode = (long)sbuf.st_ino;
> > +        }
> > +
> > +        filename = backing_file;
> > +        fmt = backing_format;
> > +        g_hash_table_insert(inodes, (gpointer)&inode, NULL);
> > +    }
> > +
> > +    while (filename && (filename[0] != '\0')) {
> > +        if (stat(filename, &sbuf) == -1) {
> Does it mean stat() on backing_file twice if it's not NULL? As you
> assigned backing_file to filename above.
I was wrong, the first stat() is on filename. Please ignore this noise.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]