From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Fabian Ebner <f.ebner@proxmox.com>
Cc: pbs-devel@lists.proxmox.com
Subject: Re: [pbs-devel] [RFC proxmox] support quoted strings in property strings
Date: Thu, 17 Feb 2022 10:47:48 +0100 [thread overview]
Message-ID: <20220217094748.wz5seu4deorzzyoy@olga.proxmox.com> (raw)
In-Reply-To: <b530766a-5af2-aae1-d44e-581bbde4b803@proxmox.com>
On Thu, Feb 17, 2022 at 09:58:03AM +0100, Fabian Ebner wrote:
> Am 16.02.22 um 14:39 schrieb Wolfgang Bumiller:
> > This allows free form text to exist within property strings,
> > quoted, like:
> > key="A value with \"quotes, also commas",key2=value2
> > or also:
> > "the value for a default_key",key2=value2
> >
> > And drop ';' as a key=value separator since those are meant
> > for arrays inside property strings...
> >
>
> Isn't that backwards-incompatible?
Technically yes, but currently we aren't using it, it's not compatible
with pve and it's also not documented, so chances are nobody manually
wrote this in a config file yet.
In pve we for instance have
features: mount=ext4;ntfs;foo
in containers and
cpu: flags=+FOO;-BAR
in VMs
and it was initially meant to work the same in pbs...
I really do prefer "breaking" this ASAP.
> > +/// Iterate over the `key=value` pairs of a property string.
> > +///
> > +/// Note, that the `key` may be optional when the schema defines a "default" key.
>
> Nit: But the iterator does not use the schema. Shouldn't the comment
> here rather just describe the behavior of the iterator?
It doesn't, but it's meant specifically for property strings and the
iterator is not exposed to the public right now. Iow. it's currently a
parser-internal detail.
(A reason to keep it internal is also that the de-quoting happening is
very limited (on purpose), and exposing it might give people the idea of
adding things like `\xXY` or `\U0ABC` support to the string parser, too.
But if someone needs that, I'd rather look for an existing parse/quote
crate first before adding more custom code... ;-) )
(In fact... it may even be nicer code-wise if the default key was itself
stored in the iterator... not sure... but I have some serde
De/Serializer WIP/POC code for property strings to avoid the
serde_json::Value intermediate step for those (particularly for the
*verify* case))
next prev parent reply other threads:[~2022-02-17 9:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 13:39 Wolfgang Bumiller
2022-02-17 8:58 ` Fabian Ebner
2022-02-17 9:47 ` Wolfgang Bumiller [this message]
2022-02-17 11:13 ` [pbs-devel] applied: " Thomas Lamprecht
2022-02-18 8:02 ` [pbs-devel] " Fabian Ebner
2022-02-18 8:13 Wolfgang Bumiller
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=20220217094748.wz5seu4deorzzyoy@olga.proxmox.com \
--to=w.bumiller@proxmox.com \
--cc=f.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.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