From: Fam Zheng <famcool@gmail.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
Christoph Hellwig <hch@lst.de>
Subject: [Qemu-devel] [PATCH 09/12] VMDK: bugfix, change cid_update from static variable to bs field
Date: Sat, 4 Jun 2011 08:43:05 +0800 [thread overview]
Message-ID: <BANLkTikD5v+_Ruai__02LfsFSVAyLRjuug@mail.gmail.com> (raw)
Cid_update is a flag to update image cid on the first write after each
image open. Using a static may suppress the cid update of second
opened image.
Signed-off-by: Fam Zheng <famcool@gmail.com>
---
block/vmdk.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index bbab68a..dd92377 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -82,6 +82,7 @@ typedef struct VmdkExtent {
typedef struct BDRVVmdkState {
int desc_offset;
+ bool cid_updated;
int num_extents;
VmdkExtent *extents;
} BDRVVmdkState;
@@ -884,7 +885,6 @@ static int vmdk_write(BlockDriverState *bs,
int64_t sector_num,
int ext_idx = 0;
int n, index_in_cluster;
uint64_t cluster_offset;
- static int cid_update = 0;
VmdkMetaData m_data;
if (sector_num > bs->total_sectors) {
@@ -925,9 +925,9 @@ static int vmdk_write(BlockDriverState *bs,
int64_t sector_num,
buf += n * 512;
// update CID on the first write every time the virtual disk is opened
- if (!cid_update) {
+ if (!s->cid_updated) {
vmdk_write_cid(bs, time(NULL));
- cid_update++;
+ s->cid_updated = true;
}
}
return 0;
reply other threads:[~2011-06-04 0:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=BANLkTikD5v+_Ruai__02LfsFSVAyLRjuug@mail.gmail.com \
--to=famcool@gmail.com \
--cc=hch@lst.de \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/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).