qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] Fix a race condition and non-leaf imagesgrowing in


From: Igor Lvovsky
Subject: [Qemu-devel] [PATCH] Fix a race condition and non-leaf imagesgrowing in VMDK chains.
Date: Thu, 7 Jun 2007 00:33:33 -0700

        Hi guys,
Somebody look at this patch?
I'll appreciate comments?
        
                Regards,
                        Igor Lvovsky
        
                



-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Igor Lvovsky
Sent: Sunday, May 20, 2007 2:40 PM
To: Thiemo Seufer
Cc: address@hidden
Subject: RE: [Qemu-devel] [PATCH] Fix a race condition and non-leaf 
imagesgrowing in VMDK chains.

        Hi Thiemo,
Thank you for comments.
You probably right about the "child" -> "is_parent" renaming,
But the "parent_open" variable (I know, the name is not the best. you can 
rename it) is not a duplicate of the "is_parent".

The only one reason for existence of "parent_open" it's set/reset the 
"is_parent".
I think we can't use the "is_parent" instead, because we need to know at every 
moment if it's a "parent" or "leaf" image.
I mean, if we'll use "is_parent" instead of "parent_open":


+  s->is_parent = 1;
+  if (bdrv_open(s->hd->backing_hd, parent_img_name, BDRV_O_RDONLY) < 0)
         goto failure;
+  s->is_parent = 0;

We'll reset it after the file opening. It's mean, later during the 
"get_cluster_offset()" we'll not be able to know if it's a "parent" or
"leaf" image.

So, I attach a new patch with you comments.

                        Regards,
                                Igor Lvovsky



-----Original Message-----
From: Thiemo Seufer [mailto:address@hidden 
Sent: Sunday, May 20, 2007 12:42 AM
To: Igor Lvovsky
Cc: address@hidden
Subject: Re: [Qemu-devel] [PATCH] Fix a race condition and non-leaf images 
growing in VMDK chains.

Thiemo Seufer wrote:
> Igor Lvovsky wrote:
> > 
> >     Hi,
> > The bug was in my last patch.
> > This is a new one.
> > I'll very appreciate any comments.
> 
> Appended is a variant which gets rid of the confusing "child" variable
> which means "is_parent", and the duplicate of it (parent_open).
> 
> There was also an uninitialized variable "tmp" which was stored as
> offset in m_data.
> 
> I quite possibly missed some bits which broke the patch, please test if
> it still works for you.

Next try, this time with the latest version of the patch.


Thiemo

Attachment: block-vmdk-patch.diff
Description: block-vmdk-patch.diff


reply via email to

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