qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 12/14] qapi: introduce change-blockdev


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 12/14] qapi: introduce change-blockdev
Date: Thu, 25 Aug 2011 08:50:35 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 08/25/2011 08:47 AM, Kevin Wolf wrote:
Am 25.08.2011 14:56, schrieb Anthony Liguori:
On 08/25/2011 07:46 AM, Kevin Wolf wrote:
Am 24.08.2011 20:43, schrieb Anthony Liguori:
A new QMP only command to change the blockdev associated with a block device.
The semantics of change right now are just plain scary.  This command introduces
sane semantics.  For more details, see the documentation in the schema file.

Changes to semantics should be mentioned in the commit message, and in
more detail than just that they are sane (the documentation in the
schema file doesn't describe differences to the old command).

Right, but the schema describes the old command.

There are a couple major differences with the new command vs old:

1) If you had a block device named 'vnc', the old command is broken.

2) For an encrypted device, the old change command returns an error but
has semantically completed the operation.  The usage is:

(qemu) change ide0 foo.img
Error: device ide0 is encrypted
(qemu) block_passwd ide0 secret

Because even though an error is returned, the change operation has
actually succeeded.  The new command has transactional semantics.  If an
error is returned, nothing has happened.  To set passwords, an
additional option is supported to specify the password.  So you would do:

(qemu) change-blockdev ide0 foo.img
Error: device ide0 is encrypted
(qemu) change-blockdev ide0 foo.img secret
(qemu)

Does it really work like this? We need to improve the HMP implementation
to ask for the password when needed instead of requiring users to put it
as plain text in their command.

I didn't add an HMP version of change-blockdev.  change is fine for HMP.

And change does prompt for password both for VNC and block. The main reason for introducing change-blockdev because the only way I could make the HMP change command work and be implemented in terms of QMP was to use the change-blockdev command.


In addition, change-blockdev will not allow you to perform unsafe
probing.  You can only change to a raw device if you specify a raw format.

Makes sense for QMP, but I would consider it a bug for HMP. So HMP code
should deal with it and allow using raw without specifying the format.

Yup, that's how change behaves.

qemu is getting worse and worse to use without a management tool. :-(

One thing that's different now is that HMP and QMP are fundamentally different interfaces. I hope this gives us the flexibility to implement better HMP commands that we would never expose in QMP and vice versa.

As long as HMP commands are implemented in terms of QMP commands, we should be very open and aggressive about improving HMP usablity.

Regards,

Anthony Liguori


Kevin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]