qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Ishani Chugh <chugh.ishani@research.iiit.ac.in>
Cc: qemu-devel@nongnu.org, jsnow@redhat.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 1/3] backup: QEMU Backup Tool
Date: Wed, 30 Aug 2017 12:21:33 +0800	[thread overview]
Message-ID: <20170830042133.GG4208@lemon.lan> (raw)
In-Reply-To: <1504025019-16820-2-git-send-email-chugh.ishani@research.iiit.ac.in>

On Tue, 08/29 22:13, Ishani Chugh wrote:
> +class BackupTool(object):
> +    """BackupTool Class"""
> +    def __init__(self, config_file=os.path.expanduser('~') +
> +                 '/.config/qemu/qemu-backup-config'):
> +        if "QEMU_BACKUP_CONFIG" in os.environ:
> +            self.config_file = os.environ["QEMU_BACKUP_CONFIG"]
> +        else:
> +            self.config_file = config_file
> +            try:
> +                if not os.path.isdir(os.path.dirname(self.config_file)):
> +                    os.makedirs(os.path.dirname(self.config_file))
> +            except:
> +                print("Cannot create config directory", file=sys.stderr)
> +                sys.exit(1)
> +        self.config = configparser.ConfigParser()
> +        self.config.read(self.config_file)

I suggest adding versioning to the config file, so that a future update to this
tool can make an incompatible change without breaking older tool:

[general]
version=0.1

[guest_1]
...

[guest_2]
...

And only continue if the version is known.

Fam

  parent reply	other threads:[~2017-08-30  4:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29 16:43 [Qemu-devel] [PATCH v2 0/3] QEMU Backup Tool Ishani Chugh
2017-08-29 16:43 ` [Qemu-devel] [PATCH v2 1/3] backup: " Ishani Chugh
2017-08-30  4:15   ` Fam Zheng
2017-08-30  4:21   ` Fam Zheng [this message]
2017-08-30 14:57     ` Ishani
2017-08-30 15:05       ` Stefan Hajnoczi
2017-08-29 16:43 ` [Qemu-devel] [PATCH v2 2/3] Test for full Backup Ishani Chugh
2017-08-29 16:43 ` [Qemu-devel] [PATCH v2 3/3] Add manpage for QEMU Backup Tool Ishani Chugh
2017-08-30  4:30   ` Fam Zheng
2017-08-30  4:31 ` [Qemu-devel] [PATCH v2 0/3] " Fam Zheng
2017-08-30 10:38 ` 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=20170830042133.GG4208@lemon.lan \
    --to=famz@redhat.com \
    --cc=chugh.ishani@research.iiit.ac.in \
    --cc=jsnow@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).