[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images?
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images? |
Date: |
Wed, 6 Jun 2018 09:07:10 +0100 |
User-agent: |
Mutt/1.9.5 (2018-04-13) |
* Michael S. Tsirkin (address@hidden) wrote:
> On Tue, Jun 05, 2018 at 03:09:17PM -0500, Eric Blake wrote:
> > On 06/05/2018 02:58 PM, Richard W.M. Jones wrote:
> > > > Binary blobs can always be base64 encoded for representation within
> > > > a valid JSON UTF-8 string (and we already have several QMP
> > > > interfaces that utilize base64 encoding to pass through what is
> > > > otherwise invalid UTF-8). It does inflate things slightly compared
> > > > to a format that allows a raw length coupled with raw data, but that
> > > > is not necessarily a problem.
> > >
> > > Of course how we represent them externally and/or while
> > > using QMP / qemu-img to store and retrieve them is up for grabs.
> > > Doesn't JSON allow binary to be encoded? (Knowing how poorly
> > > done JSON is, I wouldn't be surprised if not)
> >
> > JSON itself does not have a binary primitive; to pass arbitrary data through
> > JSON you have to first encode that data into something like base64 that can
> > then be represented as a UTF-8 string. For reference, look at
> > qapi/crypto.json and the definition of QCryptoSecretFormat.
>
> But there isn't a way to figure out that a string is base64, which
> means each application needs to know whether it's a string or
> a binary.
>
> How about specifying the encoding in the value?
>
> string value:
> [A-Za-z][^=\0]=S[^\0]*
>
> base64 value:
> [A-Za-z][^=\0]=B[A-Za-z0-9+/]*
>
> or the key:
> S[A-Za-z][^=\0]=[^\0]*
>
> base64 value:
> B[A-Za-z][^=\0]=[A-Za-z0-9+/]*
Why reinvent the wheel yet again?
The world has enough encodings out there, and we're trying to add
something that's a trivial data store for a frankly trivial use.
While I hate json, it's at least standard.
Dave
> ?
>
> --
> MST
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- Re: [Qemu-devel] storing machine data in qcow images?, Dr. David Alan Gilbert, 2018/06/05
- Re: [Qemu-devel] storing machine data in qcow images?, Eduardo Habkost, 2018/06/05
- Re: [Qemu-devel] storing machine data in qcow images?, Michael S. Tsirkin, 2018/06/05
- Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images?, Eric Blake, 2018/06/05
- Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images?, Richard W.M. Jones, 2018/06/05
- Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images?, Eric Blake, 2018/06/05
- Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images?, Michael S. Tsirkin, 2018/06/05
- Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images?, Eric Blake, 2018/06/05
- Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images?, Michael S. Tsirkin, 2018/06/05
- Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images?,
Dr. David Alan Gilbert <=
- Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images?, Gerd Hoffmann, 2018/06/06
- Re: [Qemu-devel] [Qemu-block] storing machine data in qcow images?, Michael S. Tsirkin, 2018/06/05
Re: [Qemu-devel] storing machine data in qcow images?, Gerd Hoffmann, 2018/06/06
Re: [Qemu-devel] storing machine data in qcow images?, Dr. David Alan Gilbert, 2018/06/06
Re: [Qemu-devel] storing machine data in qcow images?, Max Reitz, 2018/06/06