All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: seeteena <s1seetee@linux.vnet.ibm.com>
Cc: Eric Blake <eblake@redhat.com>,
	qemu-devel@nongnu.org, lma@suse.com,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v1] hmp: 'info snapshots' not showing the id
Date: Tue, 02 Jan 2018 09:24:28 +0100	[thread overview]
Message-ID: <87mv1w6537.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <bd60d7e7-8d33-3f87-b6be-89918c1e7ef6@linux.vnet.ibm.com> (seeteena's message of "Tue, 2 Jan 2018 12:12:49 +0530")

seeteena <s1seetee@linux.vnet.ibm.com> writes:

> On 12/22/2017 01:07 PM, Markus Armbruster wrote:
>> Eric Blake <eblake@redhat.com> writes:
>>
>>> On 12/19/2017 08:20 AM, Max Reitz wrote:
>>>
>>>> So there are three things:
>>>>
>>>> (1) We probably should not allow snapshot names that could be IDs.
>>>> Easiest way to solve this: Names have to start with a non-digit.
>>> Yes, that would be a nice change.  It is not strictly backwards
>>> compatible (so we'd still have to cope with images that didn't follow
>>> the rule, whether created by older qemu or by non-qemu implementations
>>> of qcow2), but would alleviate a lot of confusion.
>> I recommend to restrict ID strings to letters, digits, '-', '.', '_',
>> starting with a letter.  Use id_wellformed() to check.
> char *id_generate(IdSubSystems id) autogenates ID in the format eg- 
> "#block146" with starting with '#' always.
> restricting ID strings to use id_wellformed() means we need to force
> ID to start with letter.
>
> #define ID_SPECIAL_CHAR '#' needs to change to (some letter)
> #define ID_SPECIAL_CHAR 'A'

Ensuring auto-generated IDs cannot clash with IDs chosen by the user is
a good idea.  We generally fail to do that in QEMU.

An obvious way to do it is to require the user's IDs to start with a
letter, and auto-generated IDs to start with another suitable character.
In theory, starting with '#' is problematic, because it needs to be
quoted in shell at the beginning of words.  Only matters if
auto-generated IDs make sense in command lines, which I guess they
currently don't.  I'd prefer a 'shell-safe' character all the same.

>> If backward compatibility is an issue, deprecate offending IDs (with a
>> suitable warning), and kill them off after the customary grace period.
>>
>> IDs embedded in image files and such you may have to keep working
>> somehow indefinitely.

  reply	other threads:[~2018-01-02  8:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 14:09 [Qemu-devel] [PATCH v1] hmp: 'info snapshots' not showing the id Seeteena Thoufeek
2017-12-12 16:41 ` Dr. David Alan Gilbert
2017-12-13  4:50   ` seeteena
2017-12-15  9:18     ` Max Reitz
2017-12-18  9:24       ` seeteena
2017-12-19 14:20         ` Max Reitz
2017-12-20  4:34           ` seeteena
2017-12-20 13:18           ` Dr. David Alan Gilbert
2017-12-21 23:14           ` Eric Blake
2017-12-22  7:37             ` Markus Armbruster
2018-01-02  6:42               ` seeteena
2018-01-02  8:24                 ` Markus Armbruster [this message]
2018-01-04 16:24                   ` seeteena

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=87mv1w6537.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=lma@suse.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=s1seetee@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.