From nobody Sun May 5 12:10:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 154834111200296.8697311695164; Thu, 24 Jan 2019 06:45:12 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 89BBBA0902; Thu, 24 Jan 2019 14:45:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 31F016E3E6; Thu, 24 Jan 2019 14:45:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B3EC13F5D9; Thu, 24 Jan 2019 14:45:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0OETLIE023344 for ; Thu, 24 Jan 2019 09:29:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6F8D05D738; Thu, 24 Jan 2019 14:29:21 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66EA95D6A9 for ; Thu, 24 Jan 2019 14:29:17 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A6DBDDB43 for ; Thu, 24 Jan 2019 14:29:14 +0000 (UTC) Received: from [10.94.3.220] (helo=dim-vz7.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gmg0G-0008Sq-2u for libvir-list@redhat.com; Thu, 24 Jan 2019 17:29:12 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 24 Jan 2019 17:28:59 +0300 Message-Id: <1548340140-561457-2-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1548340140-561457-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1548340140-561457-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Greylist: Sender passed SPF test, ACL 242 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 24 Jan 2019 14:29:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 24 Jan 2019 14:29:15 +0000 (UTC) for IP:'185.231.240.75' DOMAIN:'relay.sw.ru' HELO:'relay.sw.ru' FROM:'nshirokovskiy@virtuozzo.com' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] conf: add debugcon-isa chardev guest interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 24 Jan 2019 14:45:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This interface can be used for example by firmware to print debug messages. Here is domain xml example:
Signed-off-by: Nikolay Shirokovskiy --- docs/formatdomain.html.in | 11 ++++++ docs/schemas/domaincommon.rng | 8 +++++ src/conf/domain_conf.c | 6 +++- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 3 ++ tests/qemuxml2argvdata/channel-debugcon-isa.xml | 34 +++++++++++++++++++ tests/qemuxml2xmloutdata/channel-debugcon-isa.xml | 41 +++++++++++++++++++= ++++ tests/qemuxml2xmltest.c | 1 + 8 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/channel-debugcon-isa.xml create mode 100644 tests/qemuxml2xmloutdata/channel-debugcon-isa.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 7f07bb7..b760a9a 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -7305,6 +7305,12 @@ qemu-kvm -net nic,model=3D? /dev/null <channel type=3D'spicevmc'> <target type=3D'virtio' name=3D'com.redhat.spice.0'/> </channel> + + <channel type=3D'file'> + <source path=3D'/var/log/libvirt/qemu/VM.firmware.log'/> + <target type=3D'debugcon-isa'/> + <address type=3D'isa' iobase=3D'0x402'/> + </channel> </devices> ... =20 @@ -7369,6 +7375,11 @@ qemu-kvm -net nic,model=3D? /dev/null optional address element can tie the channel to a particular type=3D'virtio-serial' controller. Since 0.8.8 +
debugcon-isa
+
+ Debug console on isa bus. Address on bus is given by optional + address element. + Since 5.1.0
=20
Host interface
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index aa50eac..595f073 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4150,6 +4150,13 @@ + + + + debugcon-isa + + + @@ -4159,6 +4166,7 @@ + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f3d541b..af41e4e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -458,7 +458,8 @@ VIR_ENUM_IMPL(virDomainChrChannelTarget, "none", "guestfwd", "virtio", - "xen") + "xen", + "debugcon-isa") =20 VIR_ENUM_IMPL(virDomainChrConsoleTarget, VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST, @@ -17230,6 +17231,9 @@ virDomainChrEquals(virDomainChrDefPtr src, sizeof(*src->target.addr)) =3D=3D 0; break; =20 + case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_DEBUGCON_ISA: + break; + case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST: /* shouldn't happen */ diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 7776a3a..7319494 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1106,6 +1106,7 @@ typedef enum { VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD, VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO, VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN, + VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_DEBUGCON_ISA, =20 VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST } virDomainChrChannelTargetType; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 2fb7d32..e96b1a0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10787,6 +10787,9 @@ qemuBuildChannelChrDeviceStr(char **deviceStr, goto cleanup; break; =20 + case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_DEBUGCON_ISA: + break; + case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN: case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST: diff --git a/tests/qemuxml2argvdata/channel-debugcon-isa.xml b/tests/qemuxm= l2argvdata/channel-debugcon-isa.xml new file mode 100644 index 0000000..d2d4904 --- /dev/null +++ b/tests/qemuxml2argvdata/channel-debugcon-isa.xml @@ -0,0 +1,34 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + +
+ + + + + + + +
+ + + + + + diff --git a/tests/qemuxml2xmloutdata/channel-debugcon-isa.xml b/tests/qemu= xml2xmloutdata/channel-debugcon-isa.xml new file mode 100644 index 0000000..bff97f5 --- /dev/null +++ b/tests/qemuxml2xmloutdata/channel-debugcon-isa.xml @@ -0,0 +1,41 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + +
+ + +
+ + + + + +
+ + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 82e2c0e..dde2332 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -464,6 +464,7 @@ mymain(void) DO_TEST("channel-guestfwd", NONE); DO_TEST("channel-virtio", NONE); DO_TEST("channel-virtio-state", NONE); + DO_TEST("channel-debugcon-isa", NONE); =20 DO_TEST_FULL("channel-unix-source-path", WHEN_INACTIVE, GIC_NONE, NONE= ); =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 12:10:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548341103666494.06867993613866; Thu, 24 Jan 2019 06:45:03 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6539BC05B1E7; Thu, 24 Jan 2019 14:45:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A423620C4; Thu, 24 Jan 2019 14:45:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8A773180339F; Thu, 24 Jan 2019 14:44:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0OETHom023301 for ; Thu, 24 Jan 2019 09:29:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 78E313797; Thu, 24 Jan 2019 14:29:17 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70FF45DF28 for ; Thu, 24 Jan 2019 14:29:17 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B222DDDB47 for ; Thu, 24 Jan 2019 14:29:14 +0000 (UTC) Received: from [10.94.3.220] (helo=dim-vz7.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gmg0G-0008Sq-64 for libvir-list@redhat.com; Thu, 24 Jan 2019 17:29:12 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Thu, 24 Jan 2019 17:29:00 +0300 Message-Id: <1548340140-561457-3-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1548340140-561457-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1548340140-561457-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Greylist: Sender passed SPF test, ACL 242 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 24 Jan 2019 14:29:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 24 Jan 2019 14:29:15 +0000 (UTC) for IP:'185.231.240.75' DOMAIN:'relay.sw.ru' HELO:'relay.sw.ru' FROM:'nshirokovskiy@virtuozzo.com' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: implement debugcon-isa chardev X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 24 Jan 2019 14:45:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Nikolay Shirokovskiy --- src/libvirt_private.syms | 2 ++ src/qemu/qemu_command.c | 10 ++++++++ src/qemu/qemu_domain.c | 20 ++++++++++++++++ tests/qemuxml2argvdata/channel-debugcon-isa.args | 29 ++++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 1 + 5 files changed, 62 insertions(+) create mode 100644 tests/qemuxml2argvdata/channel-debugcon-isa.args diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index c3d6306..37cb43a 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -203,6 +203,8 @@ virDomainBootTypeFromString; virDomainBootTypeToString; virDomainCapabilitiesPolicyTypeToString; virDomainCapsFeatureTypeToString; +virDomainChrChannelTargetTypeFromString; +virDomainChrChannelTargetTypeToString; virDomainChrConsoleTargetTypeFromString; virDomainChrConsoleTargetTypeToString; virDomainChrDefForeach; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e96b1a0..7c28944 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9485,6 +9485,7 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logMana= ger, break; =20 case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO: + case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_DEBUGCON_ISA: if (!(devstr =3D qemuBuildChrChardevStr(logManager, secManager, cmd, cfg, def, channel->source, @@ -10788,6 +10789,15 @@ qemuBuildChannelChrDeviceStr(char **deviceStr, break; =20 case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_DEBUGCON_ISA: + if (chr->info.addr.isa.iobase) { + if (virAsprintf(deviceStr, "isa-debugcon,iobase=3D0x%x,chardev= =3Dchar%s", + chr->info.addr.isa.iobase, chr->info.alias) < = 0) + goto cleanup; + } else { + if (virAsprintf(deviceStr, "isa-debugcon,chardev=3Dchar%s", + chr->info.alias) < 0) + goto cleanup; + } break; =20 case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN: diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 32a43f2..5f53784 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4451,7 +4451,19 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef= *chr) =20 case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: + break; + case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: + if (chr->targetType =3D=3D VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_DEBU= GCON_ISA && + chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + chr->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Target type 'debugcon-isa' requires " + " address type 'isa'")); + return -1; + } + break; + case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: /* Nothing to do */ break; @@ -4516,6 +4528,14 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, } } =20 + if (dev->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && + dev->targetType =3D=3D VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_DEBUGCON= _ISA && + !ARCH_IS_X86(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("debugcon-isa is not supported")); + return -1; + } + return 0; } =20 diff --git a/tests/qemuxml2argvdata/channel-debugcon-isa.args b/tests/qemux= ml2argvdata/channel-debugcon-isa.args new file mode 100644 index 0000000..6b57e60 --- /dev/null +++ b/tests/qemuxml2argvdata/channel-debugcon-isa.args @@ -0,0 +1,29 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ +-device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0,\ +bootindex=3D1 \ +-chardev pipe,id=3Dcharchannel0,path=3D/tmp/debugcon-isa \ +-device isa-debugcon,iobase=3D0x402,chardev=3Dcharchannel0 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ba6fd4d..ddcbe41 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1499,6 +1499,7 @@ mymain(void) DO_TEST("channel-virtio-auto", NONE); DO_TEST("channel-virtio-autoassign", NONE); DO_TEST("channel-virtio-autoadd", NONE); + DO_TEST("channel-debugcon-isa", NONE); DO_TEST("console-virtio", NONE); DO_TEST("console-virtio-many", QEMU_CAPS_DEVICE_ISA_SERIAL); --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list