qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, stefanha@redhat.com
Subject: [Qemu-devel] [RFC PATCH 1/5] qcow2.py: rename class to Qcow
Date: Thu, 18 Apr 2013 17:17:25 +0200	[thread overview]
Message-ID: <1366298249-11739-2-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1366298249-11739-1-git-send-email-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/qemu-iotests/qcow2.py | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py
index fecf5b9..40241b1 100755
--- a/tests/qemu-iotests/qcow2.py
+++ b/tests/qemu-iotests/qcow2.py
@@ -15,7 +15,7 @@ class QcowHeaderExtension:
     def create(cls, magic, data):
         return QcowHeaderExtension(magic, len(data), data)
 
-class QcowHeader:
+class Qcow:
 
     uint32_t = 'I'
     uint64_t = 'Q'
@@ -44,18 +44,18 @@ class QcowHeader:
         [ uint32_t, '%d',   'header_length' ],
     ];
 
-    fmt = '>' + ''.join(field[0] for field in fields)
+    HEADER_FMT = '>' + ''.join(field[0] for field in fields)
 
     def __init__(self, fd):
 
-        buf_size = struct.calcsize(QcowHeader.fmt)
+        buf_size = struct.calcsize(Qcow.HEADER_FMT)
 
         fd.seek(0)
         buf = fd.read(buf_size)
 
-        header = struct.unpack(QcowHeader.fmt, buf)
+        header = struct.unpack(Qcow.HEADER_FMT, buf)
         self.__dict__ = dict((field[2], header[i])
-            for i, field in enumerate(QcowHeader.fields))
+            for i, field in enumerate(Qcow.fields))
 
         self.set_defaults()
         self.cluster_size = 1 << self.cluster_bits
@@ -118,13 +118,13 @@ class QcowHeader:
         self.update_extensions(fd)
 
         fd.seek(0)
-        header = tuple(self.__dict__[f] for t, p, f in QcowHeader.fields)
-        buf = struct.pack(QcowHeader.fmt, *header)
+        header = tuple(self.__dict__[f] for t, p, f in Qcow.fields)
+        buf = struct.pack(Qcow.HEADER_FMT, *header)
         buf = buf[0:header_bytes-1]
         fd.write(buf)
 
     def dump(self):
-        for f in QcowHeader.fields:
+        for f in Qcow.fields:
             print "%-25s" % f[2], f[1] % self.__dict__[f[2]]
         print ""
 
@@ -145,7 +145,7 @@ class QcowHeader:
 
 
 def cmd_dump_header(fd):
-    h = QcowHeader(fd)
+    h = Qcow(fd)
     h.dump()
     h.dump_extensions()
 
@@ -156,7 +156,7 @@ def cmd_add_header_ext(fd, magic, data):
         print "'%s' is not a valid magic number" % magic
         sys.exit(1)
 
-    h = QcowHeader(fd)
+    h = Qcow(fd)
     h.extensions.append(QcowHeaderExtension.create(magic, data))
     h.update(fd)
 
@@ -167,7 +167,7 @@ def cmd_del_header_ext(fd, magic):
         print "'%s' is not a valid magic number" % magic
         sys.exit(1)
 
-    h = QcowHeader(fd)
+    h = Qcow(fd)
     found = False
 
     for ex in h.extensions:
@@ -190,7 +190,7 @@ def cmd_set_feature_bit(fd, group, bit):
         print "'%s' is not a valid bit number in range [0, 64)" % bit
         sys.exit(1)
 
-    h = QcowHeader(fd)
+    h = Qcow(fd)
     if group == 'incompatible':
         h.incompatible_features |= 1 << bit
     elif group == 'compatible':
-- 
1.8.2

  reply	other threads:[~2013-04-18 15:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 15:17 [Qemu-devel] [RFC PATCH 0/5] qcow2.py: dump metadata Paolo Bonzini
2013-04-18 15:17 ` Paolo Bonzini [this message]
2013-04-18 15:17 ` [Qemu-devel] [RFC PATCH 2/5] qcow2.py: add ImageFile superclass Paolo Bonzini
2013-04-18 15:17 ` [Qemu-devel] [RFC PATCH 3/5] qcow2.py: add load_image() method Paolo Bonzini
2013-04-18 15:17 ` [Qemu-devel] [RFC PATCH 4/5] qcow2.py: add method to load backing image Paolo Bonzini
2013-04-18 15:17 ` [Qemu-devel] [RFC PATCH 5/5] qcow2.py: add dump-map command Paolo Bonzini
2013-04-22 12:38 ` [Qemu-devel] [RFC PATCH 0/5] qcow2.py: dump metadata Stefan Hajnoczi

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=1366298249-11739-2-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).