Bug 454616

Summary: libvirt returns wrong console tty with xenner
Product: [Fedora] Fedora Reporter: Gerd Hoffmann <kraxel>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: belegdol, berrange, ultimatetux
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-16 04:57:53 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
complete logfile.
Fix parsing of stdout to fetch TTYs
Screenshot showing where the rawhide installation stops none

Description Gerd Hoffmann 2008-07-09 08:29:47 EDT
Description of problem:
see $summary

Version-Release number of selected component (if applicable):

How reproducible:
boot a xen guest with xenner

Actual results:
  zweiblum root ~# virsh ttyconsole testinstall

Expected results:
  zweiblum root ~# virsh ttyconsole testinstall

Additional info:
  zweiblum root ~# grep redir /var/log/libvirt/qemu/testinstall.log 
  char device redirected to /dev/pts/7
  char device redirected to /dev/pts/8

  first is monitor, second is console (aka serial line).
Comment 1 Gerd Hoffmann 2008-07-09 08:29:47 EDT
Created attachment 311366 [details]
complete logfile.
Comment 2 Daniel Berrange 2008-07-09 10:45:31 EDT
Here's the problem in qemu_driver.c:

static int qemudWaitForMonitor(virConnectPtr conn,
                               struct qemud_driver *driver,
                               struct qemud_vm *vm) {
    char buf[1024]; /* Plenty of space to get startup greeting */
    int ret = qemudReadMonitorOutput(conn,
                                     driver, vm, vm->stderr,
                                     buf, sizeof(buf),

1024 bytes is plenty for regular QEMU, but as can be seen from the attachment in
comment #1, it is no where near enough for it to work with xenner.
Comment 3 Daniel Berrange 2008-07-09 11:15:21 EDT
Created attachment 311382 [details]
Fix parsing of  stdout to fetch TTYs

When parsing for multiple TTYs, the code wasn't correctly taking account of
possibility of having leading lines of garbage before the TTY output. So it was
not skipping forward enough after finding the first TTY, and thus getting the
same TTY twice, and/or other serious confusion.

This patch fixes this problem.

So attempting to start xenner now results in

# virsh start xenner
libvir: QEMU error : internal error Out of space while reading console startup
error: Failed to start domain xenner

which is what I would expect since Xenner's output is longer than 1024 bytes.
Comment 4 Gerd Hoffmann 2008-07-17 07:30:27 EDT
Ok, can we also enlarge the buffer please?
Alternatively find another way for xenner's debug logging than writing to stderr.
Comment 5 Daniel Berrange 2008-08-22 09:31:34 EDT
*** Bug 459791 has been marked as a duplicate of this bug. ***
Comment 6 Ahmed Medhat 2008-08-22 21:30:13 EDT
Was there a found solution for this bug ? I applied the patch with no hope.

Any procedures to avoid this occurring will be appreciated.
Comment 7 Ahmed Medhat 2008-08-26 14:54:03 EDT

It turns out that the Xenner services was not running by default in Fedora 9, applying /etc/init.d/xenner to start on booting fixed this issues so far besides applying the patch https://bugzilla.redhat.com/attachment.cgi?id=311382 .

Thanks, /Ahmed Medhat/
Comment 8 Daniel Berrange 2008-09-15 04:39:21 EDT
*** Bug 462120 has been marked as a duplicate of this bug. ***
Comment 9 Gerd Hoffmann 2008-10-16 04:57:53 EDT
Should be fixed with libvirt 0.4.6 and xenner 0.46, which are both in fedora9 updates now.
Comment 10 Julian Sikorski 2008-10-16 17:30:54 EDT
Created attachment 320610 [details]
Screenshot showing where the rawhide installation stops

[root@snowball jsikorski]# rpm -q libvirt
[root@snowball jsikorski]# rpm -q xenner
[root@snowball jsikorski]# 

Not sure if the problem is really fixed. I have attempted to install rawhide today, using the following command:
virt-install --paravirt --os-type=linux --location=http://sunsite.icm.edu.pl/pub/Linux/fedora/linux/development/i386/os/ --name=pararawhide-i386 --vcpus=1 --file=/var/lib/libvirt/images/pararawhide-i386.img --accelerate --ram=512 --file-size=15
Unfortunately, all I got is this (see attachment). And yes, xenner should be running by default, or at least something should start it up.
Comment 11 Gerd Hoffmann 2008-10-17 06:02:34 EDT
Not related at all, open a new bug please.