[libvirt] libxl: cannot connect to PV console

Hey Jim, I'm on libvirt.git's trunk and I see the following: [xen@ghoul3 libvirt.git]$ sudo ./tools/virsh list Id Name State ---------------------------------------------------- 3 debian_32 running 4 fedora20_64 running [xen@ghoul3 libvirt.git]$ sudo ./tools/virsh console debian_32 Connected to domain debian_32 Escape character is ^] error: internal error: cannot find character device (null) [xen@ghoul3 libvirt.git]$ sudo ./tools/virsh console fedora20_64 Connected to domain fedora20_64 Escape character is ^] error: internal error: cannot find character device (null) And this: [xen@ghoul3 libvirt.git]$ sudo ./daemon/libvirtd -v [sudo] password for xen: 2013-12-17 13:19:35.366+0000: 22124: info : libvirt version: 1.2.1 2013-12-17 14:00:06.587+0000: 22122: error : libxlDomainOpenConsole:3885 : internal error: cannot find character device (null) 2013-12-17 14:00:15.705+0000: 22125: error : libxlDomainOpenConsole:3885 : internal error: cannot find character device (null) What I have in /var/log/libvirt/libxl does not look useful, while below it comes my xenstore-ls. What is it that is going wrong? [xen@ghoul3 libvirt.git]$ sudo xenstore-ls tool = "" xenstored = "" local = "" domain = "" 0 = "" name = "Domain-0" domid = "0" device-model = "" 0 = "" state = "running" memory = "" target = "13118716" static-max = "4294967292" freemem-slack = "317576" libxl = "" disable_udev = "1" backend = "" vbd = "" 3 = "" 51712 = "" frontend = "/local/domain/3/device/vbd/51712" params = "/dev/fedora_ghoul3/debian_32" script = "/etc/xen/scripts/block" physical-device = "fd:2" frontend-id = "3" online = "1" removable = "1" bootable = "1" state = "4" dev = "xvda" type = "phy" mode = "w" device-type = "disk" feature-flush-cache = "1" feature-discard = "0" feature-barrier = "1" feature-persistent = "1" feature-max-indirect-segments = "256" sectors = "10485760" info = "0" sector-size = "512" physical-sector-size = "512" 4 = "" 51712 = "" frontend = "/local/domain/4/device/vbd/51712" params = "/dev/fedora_ghoul3/fedora20_64" script = "/etc/xen/scripts/block" physical-device = "fd:3" frontend-id = "4" online = "1" removable = "1" bootable = "1" state = "4" dev = "xvda" type = "phy" mode = "w" device-type = "disk" feature-flush-cache = "1" feature-discard = "0" feature-barrier = "1" feature-persistent = "1" feature-max-indirect-segments = "256" sectors = "10485760" info = "0" sector-size = "512" physical-sector-size = "512" console = "" 3 = "" 0 = "" frontend = "/local/domain/3/console" frontend-id = "3" online = "1" state = "1" domain = "debian_32" protocol = "vt100" 4 = "" 0 = "" frontend = "/local/domain/4/console" frontend-id = "4" online = "1" state = "1" domain = "fedora20_64" protocol = "vt100" vif = "" 3 = "" 0 = "" frontend = "/local/domain/3/device/vif/0" frontend-id = "3" online = "1" state = "4" script = "/etc/xen/scripts/vif-bridge" mac = "00:16:3e:9f:ea:e6" bridge = "virbr0" handle = "0" type = "vif" feature-sg = "1" feature-gso-tcpv4 = "1" feature-rx-copy = "1" feature-rx-flip = "0" feature-split-event-channels = "1" hotplug-status = "connected" 4 = "" 0 = "" frontend = "/local/domain/4/device/vif/0" frontend-id = "4" online = "1" state = "4" script = "/etc/xen/scripts/vif-bridge" mac = "00:16:3e:a8:fd:05" bridge = "virbr0" handle = "0" type = "vif" feature-sg = "1" feature-gso-tcpv4 = "1" feature-rx-copy = "1" feature-rx-flip = "0" feature-split-event-channels = "1" hotplug-status = "connected" 3 = "" vm = "/vm/d3c586b2-f26d-4671-a6b3-6782fa01f49f" name = "debian_32" cpu = "" 0 = "" availability = "online" 1 = "" availability = "online" memory = "" static-max = "1048576" target = "1048577" videoram = "-1" device = "" suspend = "" event-channel = "" vbd = "" 51712 = "" backend = "/local/domain/0/backend/vbd/3/51712" backend-id = "0" state = "4" virtual-device = "51712" device-type = "disk" protocol = "x86_32-abi" ring-ref = "8" event-channel = "15" feature-persistent = "1" vif = "" 0 = "" backend = "/local/domain/0/backend/vif/3/0" backend-id = "0" state = "4" handle = "0" mac = "00:16:3e:9f:ea:e6" tx-ring-ref = "9" rx-ring-ref = "10" event-channel-tx = "16" event-channel-rx = "17" request-rx-copy = "1" feature-rx-notify = "1" feature-sg = "1" feature-gso-tcpv4 = "1" control = "" shutdown = "" platform-feature-multiprocessor-suspend = "1" platform-feature-xs_reset_watches = "1" data = "" domid = "3" store = "" port = "1" ring-ref = "1353957" console = "" backend = "/local/domain/0/backend/console/3/0" backend-id = "0" limit = "1048576" type = "xenconsoled" output = "pty" tty = "/dev/pts/2" port = "2" ring-ref = "2366273" 4 = "" vm = "/vm/d02acb9a-e99e-42ca-b2a4-9e32a65b9a0f" name = "fedora20_64" cpu = "" 0 = "" availability = "online" 1 = "" availability = "online" memory = "" static-max = "2097152" target = "2097153" videoram = "-1" device = "" suspend = "" event-channel = "" vbd = "" 51712 = "" backend = "/local/domain/0/backend/vbd/4/51712" backend-id = "0" state = "4" virtual-device = "51712" device-type = "disk" protocol = "x86_64-abi" ring-ref = "8" event-channel = "15" feature-persistent = "1" vif = "" 0 = "" backend = "/local/domain/0/backend/vif/4/0" backend-id = "0" state = "4" handle = "0" mac = "00:16:3e:a8:fd:05" tx-ring-ref = "135" rx-ring-ref = "136" event-channel-tx = "16" event-channel-rx = "17" request-rx-copy = "1" feature-rx-notify = "1" feature-sg = "1" feature-gso-tcpv4 = "1" control = "" shutdown = "" platform-feature-multiprocessor-suspend = "1" platform-feature-xs_reset_watches = "1" data = "" domid = "4" store = "" port = "1" ring-ref = "2486615" console = "" backend = "/local/domain/0/backend/console/4/0" backend-id = "0" limit = "1048576" type = "xenconsoled" output = "pty" tty = "/dev/pts/4" port = "2" ring-ref = "1364170" vm = "" 00000000-0000-0000-0000-000000000000 = "" memory = "12811" d3c586b2-f26d-4671-a6b3-6782fa01f49f = "" uuid = "d3c586b2-f26d-4671-a6b3-6782fa01f49f" name = "debian_32" image = "" ostype = "linux" kernel = "/var/run/xen/bootloader.3.d/boot_kernel.eYl1YW" ramdisk = "/var/run/xen/bootloader.3.d/boot_ramdisk.BxZLo9" cmdline = "root=UUID=9df3cd14-ed12-4cee-a252-d0cd29f75b55 ro quiet" start_time = "1387288160.47" d02acb9a-e99e-42ca-b2a4-9e32a65b9a0f = "" uuid = "d02acb9a-e99e-42ca-b2a4-9e32a65b9a0f" name = "fedora20_64" image = "" ostype = "linux" kernel = "/var/run/xen/bootloader.4.d/boot_kernel.w1Ntxo" ramdisk = "/var/run/xen/bootloader.4.d/boot_ramdisk.XU7an0" cmdline = "root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.lvm.lv=fedora/root vconsole.font=latarcyrheb-sun16 LANG=en_US.UTF-8" start_time = "1387288245.20" libxl = "" 3 = "" dm-version = "qemu_xen" 4 = "" dm-version = "qemu_xen" Regards, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

Dario Faggioli wrote:
Hey Jim,
I'm on libvirt.git's trunk and I see the following: [xen@ghoul3 libvirt.git]$ sudo ./tools/virsh list Id Name State ---------------------------------------------------- 3 debian_32 running 4 fedora20_64 running
[xen@ghoul3 libvirt.git]$ sudo ./tools/virsh console debian_32 Connected to domain debian_32 Escape character is ^] error: internal error: cannot find character device (null)
[xen@ghoul3 libvirt.git]$ sudo ./tools/virsh console fedora20_64 Connected to domain fedora20_64 Escape character is ^] error: internal error: cannot find character device (null)
Looking at libxlDomainOpenConsole() in src/libxl/libxl_driver.c, it currently only supports a serial console. Do you have one defined in these domains? E.g. <devices> ... <serial type='pty'> <target port='0'/> </serial> ... </devices> Regards, Jim

On mar, 2013-12-17 at 11:12 -0700, Jim Fehlig wrote:
Looking at libxlDomainOpenConsole() in src/libxl/libxl_driver.c, it currently only supports a serial console. Do you have one defined in these domains?
Well, I did not create anything like that explicitly for sure.. All I did is using virt-install.
E.g.
<devices> ... <serial type='pty'> <target port='0'/> </serial> ... </devices>
Let me check. [xen@ghoul3 libvirt.git]$ sudo ./run tools/virsh dumpxml debian_32 <domain type='xen'> <name>debian_32</name> <uuid>d3c586b2-f26d-4671-a6b3-6782fa01f49f</uuid> <memory unit='KiB'>1048576</memory> <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>2</vcpu> <bootloader>/usr/bin/pygrub</bootloader> <os> <type arch='x86_64' machine='xenpv'>linux</type> </os> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <disk type='block' device='disk'> <source dev='/dev/fedora_ghoul3/debian_32'/> <target dev='xvda' bus='xen'/> </disk> <interface type='bridge'> <mac address='00:16:3e:9f:ea:e6'/> <source bridge='virbr0'/> </interface> </devices> </domain> No, I apparently don't have anything like that. So, whose bug is this? libvirt or virt-install? As an aside, I'm sure as hell I've seen this working at some point... weird. :-/ Thanks and Regards, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

Jim Fehlig writes ("Re: libxl: cannot connect to PV console"):
Dario Faggioli wrote:
Hey Jim,
I'm on libvirt.git's trunk and I see the following: [xen@ghoul3 libvirt.git]$ sudo ./tools/virsh list Id Name State ---------------------------------------------------- 3 debian_32 running 4 fedora20_64 running
[xen@ghoul3 libvirt.git]$ sudo ./tools/virsh console debian_32 Connected to domain debian_32 Escape character is ^] error: internal error: cannot find character device (null)
[xen@ghoul3 libvirt.git]$ sudo ./tools/virsh console fedora20_64 Connected to domain fedora20_64 Escape character is ^] error: internal error: cannot find character device (null)
Looking at libxlDomainOpenConsole() in src/libxl/libxl_driver.c, it currently only supports a serial console. Do you have one defined in these domains? E.g.
If this is the root cause, it's a pretty bad error message. Should I or Dario take a look at the libvirt code to see if we can improve it ? Ian.

On mer, 2013-12-18 at 14:45 +0000, Ian Jackson wrote:
Jim Fehlig writes ("Re: libxl: cannot connect to PV console"):
Dario Faggioli wrote:
[xen@ghoul3 libvirt.git]$ sudo ./tools/virsh console fedora20_64 Connected to domain fedora20_64 Escape character is ^] error: internal error: cannot find character device (null)
Looking at libxlDomainOpenConsole() in src/libxl/libxl_driver.c, it currently only supports a serial console. Do you have one defined in these domains? E.g.
If this is the root cause, it's a pretty bad error message.
Indeed.
Should I or Dario take a look at the libvirt code to see if we can improve it ?
Looks like it's this piece of code, in src/libxl/libxl_driver.c: libxlDomainOpenConsole(..) ... if (vm->def->nserials) chr = vm->def->serials[0]; if (!chr) { virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot find character device %s"), NULLSTR(dev_name)); goto cleanup; } ... } I guess I can send a patch to turn that message into something like "cannot find any serial console define for the domain", either always or in the specific case where vm->def->serials[0] is NULL, as I feel like the "character device (null)" part is the worst and most misleading. At the same time, I'd be interested in figuring out why this does not work / stopped working. I'll investigate more. Regards, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
participants (3)
-
Dario Faggioli
-
Ian Jackson
-
Jim Fehlig