qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 10/14] qapi: add change-vnc-password


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 10/14] qapi: add change-vnc-password
Date: Thu, 25 Aug 2011 08:12:28 -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 04:07 AM, Gerd Hoffmann wrote:
On 08/24/11 20:43, Anthony Liguori wrote:
This is a new QMP only command that only changes the VNC password.

What is wrong with "set_password vnc $secret" ?

Overloading a single function to do multiple things makes the function hard to use. Consider the C interface:

void qmp_set_password(QmpSession *sess, const char *protocol,
                      const char *password, bool has_connected,
                      const char *connected)

Since both protocol and connected are strings, you can get hard to debug errors by using the string "VNC" instead of "vnc" or "Keep" instead of "keep". There's no obvious way to figure out what strings are valid for protocol programatically so if we added rdesktop or something like that, the interface would become awkward to use.

Likewise, it's non-intuitive that connected only has one valid value for VNC which means that for changing the VNC password, it's just extra typing. Compare that to:

void qmp_change_vnc_password(QmpSession *sess, const char *password)

It's impossible to use wrong. If we add a qmp_change_rdesktop_password, it's easily detectable.

Regards,

Anthony Liguori


cheers,
Gerd






reply via email to

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