"qxl.vram64_size_mb",
"qxl-vga.vram64_size_mb", /* 215 */
+ "chardev-logfile",
);
{ "machine", "dea-key-wrap", QEMU_CAPS_DEA_KEY_WRAP },
{ "chardev", "append", QEMU_CAPS_CHARDEV_FILE_APPEND },
{ "spice", "gl", QEMU_CAPS_SPICE_GL },
+ { "chardev", "logfile", QEMU_CAPS_CHARDEV_LOGFILE },
};
static int
/* 215 */
QEMU_CAPS_QXL_VGA_VRAM64, /* -device qxl-vga.vram64_size_mb */
+ QEMU_CAPS_CHARDEV_LOGFILE, /* -chardev logfile=xxxx */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
goto error;
}
+ if (dev->logfile) {
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_LOGFILE)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("logfile not supported in this QEMU binary"));
+ goto error;
+ }
+ virBufferAsprintf(&buf, ",logfile=%s", dev->logfile);
+ if (dev->logappend != VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&buf, ",logappend=%s",
+ virTristateSwitchTypeToString(dev->logappend));
+ }
+ }
+
if (virBufferCheckError(&buf) < 0)
goto error;
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
+ if (dev->logfile) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("logfile not supported in this QEMU binary"));
+ goto error;
+ }
+
if (prefix)
virBufferAdd(&buf, prefix, strlen(prefix));
--- /dev/null
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 214 \
+-smp 1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-chardev file,id=charserial0,path=/tmp/serial.log,\
+logfile=/var/lib/libvirt/qemu/demo-serial.log,logappend=off \
+-device isa-serial,chardev=charserial0,id=serial0
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <serial type='file'>
+ <source path='/tmp/serial.log'/>
+ <log file='/var/lib/libvirt/qemu/demo-serial.log' append='off'/>
+ <target port='0'/>
+ </serial>
+ <console type='file'>
+ <source path='/tmp/serial.log'/>
+ <target type='serial' port='0'/>
+ </console>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
DO_TEST("serial-pty", NONE);
DO_TEST("serial-dev", NONE);
DO_TEST("serial-file", NONE);
+ DO_TEST("serial-file-log", QEMU_CAPS_CHARDEV, QEMU_CAPS_CHARDEV_FILE_APPEND,
+ QEMU_CAPS_CHARDEV_LOGFILE);
DO_TEST("serial-unix", NONE);
DO_TEST("serial-tcp", NONE);
DO_TEST("serial-udp", NONE);