[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/11] chardev: add hmp hotplug commands
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH 05/11] chardev: add hmp hotplug commands |
Date: |
Thu, 10 Jan 2013 11:53:27 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121116 Thunderbird/10.0.11 |
On 01/10/13 11:33, Paolo Bonzini wrote:
> Il 07/01/2013 14:55, Gerd Hoffmann ha scritto:
>> +void hmp_chardev_add(Monitor *mon, const QDict *qdict)
>> +{
>> + const char *args = qdict_get_str(qdict, "args");
>> + Error *err = NULL;
>> + QemuOpts *opts;
>> +
>> + opts = qemu_opts_parse(qemu_find_opts("chardev"), args, 1);
>> + if (opts == NULL) {
>> + error_setg(&err, "Parsing chardev args failed\n");
>> + } else {
>> + qemu_chr_new_from_opts(opts, NULL, &err);
>
> This ought to use qmp_chardev_add and a generic opts->ChardevBackend
> conversion.
>
> But IMHO, this kind of intermediate conversion is okay, with the
> "correct" thing deferred; being able to play with hotplug from HMP is
> worth the small wart. It's really Luiz's decision, so I'm not giving
> the reviewed-by (yet).
Once qmp_chardev_add() can handle everything supported by
qemu_chr_new_from_opts we can flip over, make qmp_chardev_add the
primary interface and qemu_chr_new_from_opts legacy (which then does the
opts->ChardevBackend conversion and calls qmp_chardev_add).
We are not there yet, even with the full series applied.
And even when we arrive there some day we don't have to touch
hmp_chardev_add when making the switch ;)
cheers,
Gerd
- Re: [Qemu-devel] [PATCH 01/11] chardev: add error reporting for qemu_chr_new_from_opts, (continued)
[Qemu-devel] [PATCH 05/11] chardev: add hmp hotplug commands, Gerd Hoffmann, 2013/01/07
[Qemu-devel] [PATCH 10/11] chardev: add socket chardev support to chardev-add (qmp), Gerd Hoffmann, 2013/01/07
[Qemu-devel] [PATCH 07/11] chardev: add tty chardev support to chardev-add (qmp), Gerd Hoffmann, 2013/01/07
[Qemu-devel] [PATCH 03/11] chardev: reduce chardev ifdef mess a bit, Gerd Hoffmann, 2013/01/07
[Qemu-devel] [PATCH 11/11] chardev: add pty chardev support to chardev-add (qmp), Gerd Hoffmann, 2013/01/07