[libvirt] [PATCHv2 1/2] qemu: output error when try to hotplug unsupport console
lhuang
lhuang at redhat.com
Wed Jan 21 02:57:07 UTC 2015
On 01/21/2015 02:59 AM, John Ferlan wrote:
> Looks like this one may have been "lost" in the holidays...
Aha, thanks a lot for 'save' this patch, I almost forget this patch ;)
> On 12/09/2014 01:48 AM, Luyao Huang wrote:
>> https://bugzilla.redhat.com/show_bug.cgi?id=1164627
>>
>> When try to use attach-device to hotplug a qemu
>> unsupport sonsole, command will return success,
>> and add a console in vm's xml.But this doesn't work
>> in qemu, qemu doesn't support these console.Add
>> a error output when try to hotplug a unsupport console
>> in qemuBuildConsoleChrDeviceStr.
> Needs some grammar fixups...
>
> When using 'virsh attach-device' to hotplug an unsupported console type
> into a qemu guest, the attachment will erroneously allows the
> attachment. This patch will check to ensure that only the support target
> types are used for a running guest. NB, Although a guest can be defined
> with an improper target, startup will cause failure.
Thanks a lot for improving the description.
>> Signed-off-by: Luyao Huang <lhuang at redhat.com>
>> ---
>> src/qemu/qemu_command.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>> index 1399ce4..7dced5f 100644
>> --- a/src/qemu/qemu_command.c
>> +++ b/src/qemu/qemu_command.c
>> @@ -10069,13 +10069,17 @@ qemuBuildConsoleChrDeviceStr(char **deviceStr,
>> break;
>>
>> case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL:
>> + break;
>> case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE:
>> case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN:
>> case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML:
>> case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LXC:
>> case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_OPENVZ:
>> case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST:
>> - break;
>> + virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
>> + _("unsupported console target type %s"),
>> + NULLSTR(virDomainChrConsoleTargetTypeToString(chr->targetType)));
>> + return ret;
> This should be a goto cleanup;
>
> I can clean this up; however, will it be necessary given patch 2/2?
Thanks and about Patch 2/2 is not fix this bug (although patch 2/2 will
also fix hot-plug a qemu unsupported chr device). I have a discussion
with Jan and Pavel in v1 of this patch (please see
https://www.redhat.com/archives/libvir-list/2014-December/msg00157.html
and
https://www.redhat.com/archives/libvir-list/2014-November/msg00988.html), so
write patch 2/2 for avoiding cold-plug a qemu unsupported device to a
qemu vm.
>
> John
>
>> }
>>
>> ret = 0;
>>
Luyao
More information about the libvir-list
mailing list