aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Turner <digit@android.com>2010-09-09 21:23:36 +0200
committerDavid 'Digit' Turner <digit@android.com>2010-09-13 00:30:34 -0700
commitfd4c0076b7470f5962ff462bae9cd9f208e059b7 (patch)
tree5893d21330ab4b032b7840305659323c2919ecfa
parenta12820ef4aff2e2f6d3db9b704abee2c54d08f40 (diff)
downloadexternal_qemu-fd4c0076b7470f5962ff462bae9cd9f208e059b7.zip
external_qemu-fd4c0076b7470f5962ff462bae9cd9f208e059b7.tar.gz
external_qemu-fd4c0076b7470f5962ff462bae9cd9f208e059b7.tar.bz2
upstream: minor QObject updates.
-rw-r--r--qemu-error.c209
-rw-r--r--qemu-error.h41
-rw-r--r--qerror.c139
-rw-r--r--qerror.h81
-rw-r--r--qfloat.c8
-rw-r--r--qint.c7
-rw-r--r--qint.h12
-rw-r--r--qjson.c3
-rw-r--r--qlist.c7
-rw-r--r--qlist.h7
-rw-r--r--qobject.h4
-rw-r--r--qstring.c7
-rw-r--r--qstring.h12
-rw-r--r--targphys.h5
14 files changed, 486 insertions, 56 deletions
diff --git a/qemu-error.c b/qemu-error.c
new file mode 100644
index 0000000..5a35e7c
--- /dev/null
+++ b/qemu-error.c
@@ -0,0 +1,209 @@
+/*
+ * Error reporting
+ *
+ * Copyright (C) 2010 Red Hat Inc.
+ *
+ * Authors:
+ * Markus Armbruster <armbru@redhat.com>,
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include <stdio.h>
+#include "monitor.h"
+#include "sysemu.h"
+
+/*
+ * Print to current monitor if we have one, else to stderr.
+ * TODO should return int, so callers can calculate width, but that
+ * requires surgery to monitor_vprintf(). Left for another day.
+ */
+void error_vprintf(const char *fmt, va_list ap)
+{
+ if (cur_mon) {
+ monitor_vprintf(cur_mon, fmt, ap);
+ } else {
+ vfprintf(stderr, fmt, ap);
+ }
+}
+
+/*
+ * Print to current monitor if we have one, else to stderr.
+ * TODO just like error_vprintf()
+ */
+void error_printf(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ error_vprintf(fmt, ap);
+ va_end(ap);
+}
+
+void error_printf_unless_qmp(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (!monitor_cur_is_qmp()) {
+ va_start(ap, fmt);
+ error_vprintf(fmt, ap);
+ va_end(ap);
+ }
+}
+
+static Location std_loc = {
+ .kind = LOC_NONE
+};
+static Location *cur_loc = &std_loc;
+
+/*
+ * Push location saved in LOC onto the location stack, return it.
+ * The top of that stack is the current location.
+ * Needs a matching loc_pop().
+ */
+Location *loc_push_restore(Location *loc)
+{
+ assert(!loc->prev);
+ loc->prev = cur_loc;
+ cur_loc = loc;
+ return loc;
+}
+
+/*
+ * Initialize *LOC to "nowhere", push it onto the location stack.
+ * The top of that stack is the current location.
+ * Needs a matching loc_pop().
+ * Return LOC.
+ */
+Location *loc_push_none(Location *loc)
+{
+ loc->kind = LOC_NONE;
+ loc->prev = NULL;
+ return loc_push_restore(loc);
+}
+
+/*
+ * Pop the location stack.
+ * LOC must be the current location, i.e. the top of the stack.
+ */
+Location *loc_pop(Location *loc)
+{
+ assert(cur_loc == loc && loc->prev);
+ cur_loc = loc->prev;
+ loc->prev = NULL;
+ return loc;
+}
+
+/*
+ * Save the current location in LOC, return LOC.
+ */
+Location *loc_save(Location *loc)
+{
+ *loc = *cur_loc;
+ loc->prev = NULL;
+ return loc;
+}
+
+/*
+ * Change the current location to the one saved in LOC.
+ */
+void loc_restore(Location *loc)
+{
+ Location *prev = cur_loc->prev;
+ assert(!loc->prev);
+ *cur_loc = *loc;
+ cur_loc->prev = prev;
+}
+
+/*
+ * Change the current location to "nowhere in particular".
+ */
+void loc_set_none(void)
+{
+ cur_loc->kind = LOC_NONE;
+}
+
+/*
+ * Change the current location to argument ARGV[IDX..IDX+CNT-1].
+ */
+void loc_set_cmdline(char **argv, int idx, int cnt)
+{
+ cur_loc->kind = LOC_CMDLINE;
+ cur_loc->num = cnt;
+ cur_loc->ptr = argv + idx;
+}
+
+/*
+ * Change the current location to file FNAME, line LNO.
+ */
+void loc_set_file(const char *fname, int lno)
+{
+ assert (fname || cur_loc->kind == LOC_FILE);
+ cur_loc->kind = LOC_FILE;
+ cur_loc->num = lno;
+ if (fname) {
+ cur_loc->ptr = fname;
+ }
+}
+
+static const char *progname;
+
+/*
+ * Set the program name for error_print_loc().
+ */
+void error_set_progname(const char *argv0)
+{
+ const char *p = strrchr(argv0, '/');
+ progname = p ? p + 1 : argv0;
+}
+
+/*
+ * Print current location to current monitor if we have one, else to stderr.
+ */
+void error_print_loc(void)
+{
+ const char *sep = "";
+ int i;
+ const char *const *argp;
+
+ if (!cur_mon && progname) {
+ fprintf(stderr, "%s:", progname);
+ sep = " ";
+ }
+ switch (cur_loc->kind) {
+ case LOC_CMDLINE:
+ argp = cur_loc->ptr;
+ for (i = 0; i < cur_loc->num; i++) {
+ error_printf("%s%s", sep, argp[i]);
+ sep = " ";
+ }
+ error_printf(": ");
+ break;
+ case LOC_FILE:
+ error_printf("%s:", (const char *)cur_loc->ptr);
+ if (cur_loc->num) {
+ error_printf("%d:", cur_loc->num);
+ }
+ error_printf(" ");
+ break;
+ default:
+ error_printf("%s", sep);
+ }
+}
+
+/*
+ * Print an error message to current monitor if we have one, else to stderr.
+ * Prepend the current location and append a newline.
+ * It's wrong to call this in a QMP monitor. Use qerror_report() there.
+ */
+void error_report(const char *fmt, ...)
+{
+ va_list ap;
+
+ error_print_loc();
+ va_start(ap, fmt);
+ error_vprintf(fmt, ap);
+ va_end(ap);
+ error_printf("\n");
+}
diff --git a/qemu-error.h b/qemu-error.h
new file mode 100644
index 0000000..a45609f
--- /dev/null
+++ b/qemu-error.h
@@ -0,0 +1,41 @@
+/*
+ * Error reporting
+ *
+ * Copyright (C) 2010 Red Hat Inc.
+ *
+ * Authors:
+ * Markus Armbruster <armbru@redhat.com>,
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#ifndef QEMU_ERROR_H
+#define QEMU_ERROR_H
+
+typedef struct Location {
+ /* all members are private to qemu-error.c */
+ enum { LOC_NONE, LOC_CMDLINE, LOC_FILE } kind;
+ int num;
+ const void *ptr;
+ struct Location *prev;
+} Location;
+
+Location *loc_push_restore(Location *loc);
+Location *loc_push_none(Location *loc);
+Location *loc_pop(Location *loc);
+Location *loc_save(Location *loc);
+void loc_restore(Location *loc);
+void loc_set_none(void);
+void loc_set_cmdline(char **argv, int idx, int cnt);
+void loc_set_file(const char *fname, int lno);
+
+void error_vprintf(const char *fmt, va_list ap);
+void error_printf(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
+void error_printf_unless_qmp(const char *fmt, ...)
+ __attribute__ ((format(printf, 1, 2)));
+void error_print_loc(void);
+void error_set_progname(const char *argv0);
+void error_report(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
+
+#endif
diff --git a/qerror.c b/qerror.c
index 2f657f4..0af3ab3 100644
--- a/qerror.c
+++ b/qerror.c
@@ -1,5 +1,5 @@
/*
- * QError: QEMU Error data-type.
+ * QError Module
*
* Copyright (C) 2009 Red Hat Inc.
*
@@ -9,10 +9,10 @@
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*/
+
+#include "monitor.h"
#include "qjson.h"
#include "qerror.h"
-#include "qstring.h"
-#include "sysemu.h"
#include "qemu-common.h"
static void qerror_destroy_obj(QObject *obj);
@@ -38,59 +38,99 @@ static const QType qerror_type = {
* for example:
*
* "running out of foo: %(foo)%%"
+ *
+ * Please keep the entries in alphabetical order.
+ * Use "sed -n '/^static.*qerror_table\[\]/,/^};/s/QERR_/&/gp' qerror.c | sort -c"
+ * to check.
*/
static const QErrorStringTable qerror_table[] = {
{
+ .error_fmt = QERR_BAD_BUS_FOR_DEVICE,
+ .desc = "Device '%(device)' can't go on a %(bad_bus_type) bus",
+ },
+ {
+ .error_fmt = QERR_BUS_NOT_FOUND,
+ .desc = "Bus '%(bus)' not found",
+ },
+ {
+ .error_fmt = QERR_BUS_NO_HOTPLUG,
+ .desc = "Bus '%(bus)' does not support hotplugging",
+ },
+ {
.error_fmt = QERR_COMMAND_NOT_FOUND,
.desc = "The command %(name) has not been found",
},
{
.error_fmt = QERR_DEVICE_ENCRYPTED,
- .desc = "The %(device) is encrypted",
+ .desc = "Device '%(device)' is encrypted",
+ },
+ {
+ .error_fmt = QERR_DEVICE_INIT_FAILED,
+ .desc = "Device '%(device)' could not be initialized",
+ },
+ {
+ .error_fmt = QERR_DEVICE_IN_USE,
+ .desc = "Device '%(device)' is in use",
},
{
.error_fmt = QERR_DEVICE_LOCKED,
- .desc = "Device %(device) is locked",
+ .desc = "Device '%(device)' is locked",
+ },
+ {
+ .error_fmt = QERR_DEVICE_MULTIPLE_BUSSES,
+ .desc = "Device '%(device)' has multiple child busses",
},
{
.error_fmt = QERR_DEVICE_NOT_ACTIVE,
- .desc = "The %(device) device has not been activated by the guest",
+ .desc = "Device '%(device)' has not been activated",
+ },
+ {
+ .error_fmt = QERR_DEVICE_NOT_ENCRYPTED,
+ .desc = "Device '%(device)' is not encrypted",
},
{
.error_fmt = QERR_DEVICE_NOT_FOUND,
- .desc = "The %(device) device has not been found",
+ .desc = "Device '%(device)' not found",
},
{
.error_fmt = QERR_DEVICE_NOT_REMOVABLE,
- .desc = "Device %(device) is not removable",
+ .desc = "Device '%(device)' is not removable",
+ },
+ {
+ .error_fmt = QERR_DEVICE_NO_BUS,
+ .desc = "Device '%(device)' has no child bus",
+ },
+ {
+ .error_fmt = QERR_DUPLICATE_ID,
+ .desc = "Duplicate ID '%(id)' for %(object)",
},
{
.error_fmt = QERR_FD_NOT_FOUND,
- .desc = "Failed to find file descriptor named %(name)",
+ .desc = "File descriptor named '%(name)' not found",
},
{
.error_fmt = QERR_FD_NOT_SUPPLIED,
.desc = "No file descriptor supplied via SCM_RIGHTS",
},
{
- .error_fmt = QERR_OPEN_FILE_FAILED,
- .desc = "Could not open '%(filename)'",
- },
- {
.error_fmt = QERR_INVALID_BLOCK_FORMAT,
- .desc = "Invalid block format %(name)",
+ .desc = "Invalid block format '%(name)'",
},
{
.error_fmt = QERR_INVALID_PARAMETER,
- .desc = "Invalid parameter %(name)",
+ .desc = "Invalid parameter '%(name)'",
},
{
.error_fmt = QERR_INVALID_PARAMETER_TYPE,
.desc = "Invalid parameter type, expected: %(expected)",
},
{
+ .error_fmt = QERR_INVALID_PARAMETER_VALUE,
+ .desc = "Parameter '%(name)' expects %(expected)",
+ },
+ {
.error_fmt = QERR_INVALID_PASSWORD,
- .desc = "The entered password is invalid",
+ .desc = "Password incorrect",
},
{
.error_fmt = QERR_JSON_PARSING,
@@ -101,12 +141,48 @@ static const QErrorStringTable qerror_table[] = {
.desc = "Using KVM without %(capability), %(feature) unavailable",
},
{
+ .error_fmt = QERR_MIGRATION_EXPECTED,
+ .desc = "An incoming migration is expected before this command can be executed",
+ },
+ {
.error_fmt = QERR_MISSING_PARAMETER,
- .desc = "Parameter %(name) is missing",
+ .desc = "Parameter '%(name)' is missing",
+ },
+ {
+ .error_fmt = QERR_NO_BUS_FOR_DEVICE,
+ .desc = "No '%(bus)' bus found for device '%(device)'",
+ },
+ {
+ .error_fmt = QERR_OPEN_FILE_FAILED,
+ .desc = "Could not open '%(filename)'",
+ },
+ {
+ .error_fmt = QERR_PROPERTY_NOT_FOUND,
+ .desc = "Property '%(device).%(property)' not found",
+ },
+ {
+ .error_fmt = QERR_PROPERTY_VALUE_BAD,
+ .desc = "Property '%(device).%(property)' doesn't take value '%(value)'",
+ },
+ {
+ .error_fmt = QERR_PROPERTY_VALUE_IN_USE,
+ .desc = "Property '%(device).%(property)' can't take value '%(value)', it's in use",
+ },
+ {
+ .error_fmt = QERR_PROPERTY_VALUE_NOT_FOUND,
+ .desc = "Property '%(device).%(property)' can't find value '%(value)'",
},
{
.error_fmt = QERR_QMP_BAD_INPUT_OBJECT,
- .desc = "Bad QMP input object",
+ .desc = "Expected '%(expected)' in QMP input",
+ },
+ {
+ .error_fmt = QERR_QMP_BAD_INPUT_OBJECT_MEMBER,
+ .desc = "QMP input object member '%(member)' expects '%(expected)'",
+ },
+ {
+ .error_fmt = QERR_QMP_EXTRA_MEMBER,
+ .desc = "QMP input object member '%(member)' is unexpected",
},
{
.error_fmt = QERR_SET_PASSWD_FAILED,
@@ -224,6 +300,7 @@ QError *qerror_from_info(const char *file, int linenr, const char *func,
QError *qerr;
qerr = qerror_new();
+ loc_save(&qerr->loc);
qerr->linenr = linenr;
qerr->file = file;
qerr->func = func;
@@ -318,16 +395,36 @@ QString *qerror_human(const QError *qerror)
* qerror_print(): Print QError data
*
* This function will print the member 'desc' of the specified QError object,
- * it uses qemu_error() for this, so that the output is routed to the right
+ * it uses error_report() for this, so that the output is routed to the right
* place (ie. stderr or Monitor's device).
*/
-void qerror_print(const QError *qerror)
+void qerror_print(QError *qerror)
{
QString *qstring = qerror_human(qerror);
- qemu_error("%s\n", qstring_get_str(qstring));
+ loc_push_restore(&qerror->loc);
+ error_report("%s", qstring_get_str(qstring));
+ loc_pop(&qerror->loc);
QDECREF(qstring);
}
+void qerror_report_internal(const char *file, int linenr, const char *func,
+ const char *fmt, ...)
+{
+ va_list va;
+ QError *qerror;
+
+ va_start(va, fmt);
+ qerror = qerror_from_info(file, linenr, func, fmt, &va);
+ va_end(va);
+
+ if (monitor_cur_is_qmp()) {
+ monitor_set_error(cur_mon, qerror);
+ } else {
+ qerror_print(qerror);
+ QDECREF(qerror);
+ }
+}
+
/**
* qobject_to_qerror(): Convert a QObject into a QError
*/
diff --git a/qerror.h b/qerror.h
index ee59615..62802ea 100644
--- a/qerror.h
+++ b/qerror.h
@@ -1,5 +1,5 @@
/*
- * QError header file.
+ * QError Module
*
* Copyright (C) 2009 Red Hat Inc.
*
@@ -14,6 +14,7 @@
#include "qdict.h"
#include "qstring.h"
+#include "qemu-error.h"
#include <stdarg.h>
typedef struct QErrorStringTable {
@@ -24,6 +25,7 @@ typedef struct QErrorStringTable {
typedef struct QError {
QObject_HEAD;
QDict *error;
+ Location loc;
int linenr;
const char *file;
const char *func;
@@ -34,39 +36,70 @@ QError *qerror_new(void);
QError *qerror_from_info(const char *file, int linenr, const char *func,
const char *fmt, va_list *va);
QString *qerror_human(const QError *qerror);
-void qerror_print(const QError *qerror);
+void qerror_print(QError *qerror);
+void qerror_report_internal(const char *file, int linenr, const char *func,
+ const char *fmt, ...)
+ __attribute__ ((format(printf, 4, 5)));
+#define qerror_report(fmt, ...) \
+ qerror_report_internal(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__)
QError *qobject_to_qerror(const QObject *obj);
/*
* QError class list
+ * Please keep the definitions in alphabetical order.
+ * Use "grep '^#define QERR_' qerror.h | sort -c" to check.
*/
+#define QERR_BAD_BUS_FOR_DEVICE \
+ "{ 'class': 'BadBusForDevice', 'data': { 'device': %s, 'bad_bus_type': %s } }"
+
+#define QERR_BUS_NOT_FOUND \
+ "{ 'class': 'BusNotFound', 'data': { 'bus': %s } }"
+
+#define QERR_BUS_NO_HOTPLUG \
+ "{ 'class': 'BusNoHotplug', 'data': { 'bus': %s } }"
+
#define QERR_COMMAND_NOT_FOUND \
"{ 'class': 'CommandNotFound', 'data': { 'name': %s } }"
#define QERR_DEVICE_ENCRYPTED \
"{ 'class': 'DeviceEncrypted', 'data': { 'device': %s } }"
-#define QERR_DEVICE_LOCKED \
+#define QERR_DEVICE_INIT_FAILED \
+ "{ 'class': 'DeviceInitFailed', 'data': { 'device': %s } }"
+
+#define QERR_DEVICE_IN_USE \
+ "{ 'class': 'DeviceInUse', 'data': { 'device': %s } }"
+
+#define QERR_DEVICE_LOCKED \
"{ 'class': 'DeviceLocked', 'data': { 'device': %s } }"
+#define QERR_DEVICE_MULTIPLE_BUSSES \
+ "{ 'class': 'DeviceMultipleBusses', 'data': { 'device': %s } }"
+
#define QERR_DEVICE_NOT_ACTIVE \
"{ 'class': 'DeviceNotActive', 'data': { 'device': %s } }"
+#define QERR_DEVICE_NOT_ENCRYPTED \
+ "{ 'class': 'DeviceNotEncrypted', 'data': { 'device': %s } }"
+
#define QERR_DEVICE_NOT_FOUND \
"{ 'class': 'DeviceNotFound', 'data': { 'device': %s } }"
#define QERR_DEVICE_NOT_REMOVABLE \
"{ 'class': 'DeviceNotRemovable', 'data': { 'device': %s } }"
+#define QERR_DEVICE_NO_BUS \
+ "{ 'class': 'DeviceNoBus', 'data': { 'device': %s } }"
+
+#define QERR_DUPLICATE_ID \
+ "{ 'class': 'DuplicateId', 'data': { 'id': %s, 'object': %s } }"
+
#define QERR_FD_NOT_FOUND \
"{ 'class': 'FdNotFound', 'data': { 'name': %s } }"
#define QERR_FD_NOT_SUPPLIED \
"{ 'class': 'FdNotSupplied', 'data': {} }"
-#define QERR_OPEN_FILE_FAILED \
- "{ 'class': 'OpenFileFailed', 'data': { 'filename': %s } }"
-
#define QERR_INVALID_BLOCK_FORMAT \
"{ 'class': 'InvalidBlockFormat', 'data': { 'name': %s } }"
@@ -76,6 +109,9 @@ QError *qobject_to_qerror(const QObject *obj);
#define QERR_INVALID_PARAMETER_TYPE \
"{ 'class': 'InvalidParameterType', 'data': { 'name': %s,'expected': %s } }"
+#define QERR_INVALID_PARAMETER_VALUE \
+ "{ 'class': 'InvalidParameterValue', 'data': { 'name': %s, 'expected': %s } }"
+
#define QERR_INVALID_PASSWORD \
"{ 'class': 'InvalidPassword', 'data': {} }"
@@ -85,21 +121,48 @@ QError *qobject_to_qerror(const QObject *obj);
#define QERR_KVM_MISSING_CAP \
"{ 'class': 'KVMMissingCap', 'data': { 'capability': %s, 'feature': %s } }"
+#define QERR_MIGRATION_EXPECTED \
+ "{ 'class': 'MigrationExpected', 'data': {} }"
+
#define QERR_MISSING_PARAMETER \
"{ 'class': 'MissingParameter', 'data': { 'name': %s } }"
+#define QERR_NO_BUS_FOR_DEVICE \
+ "{ 'class': 'NoBusForDevice', 'data': { 'device': %s, 'bus': %s } }"
+
+#define QERR_OPEN_FILE_FAILED \
+ "{ 'class': 'OpenFileFailed', 'data': { 'filename': %s } }"
+
+#define QERR_PROPERTY_NOT_FOUND \
+ "{ 'class': 'PropertyNotFound', 'data': { 'device': %s, 'property': %s } }"
+
+#define QERR_PROPERTY_VALUE_BAD \
+ "{ 'class': 'PropertyValueBad', 'data': { 'device': %s, 'property': %s, 'value': %s } }"
+
+#define QERR_PROPERTY_VALUE_IN_USE \
+ "{ 'class': 'PropertyValueInUse', 'data': { 'device': %s, 'property': %s, 'value': %s } }"
+
+#define QERR_PROPERTY_VALUE_NOT_FOUND \
+ "{ 'class': 'PropertyValueNotFound', 'data': { 'device': %s, 'property': %s, 'value': %s } }"
+
#define QERR_QMP_BAD_INPUT_OBJECT \
"{ 'class': 'QMPBadInputObject', 'data': { 'expected': %s } }"
+#define QERR_QMP_BAD_INPUT_OBJECT_MEMBER \
+ "{ 'class': 'QMPBadInputObjectMember', 'data': { 'member': %s, 'expected': %s } }"
+
+#define QERR_QMP_EXTRA_MEMBER \
+ "{ 'class': 'QMPExtraInputObjectMember', 'data': { 'member': %s } }"
+
#define QERR_SET_PASSWD_FAILED \
"{ 'class': 'SetPasswdFailed', 'data': {} }"
-#define QERR_UNDEFINED_ERROR \
- "{ 'class': 'UndefinedError', 'data': {} }"
-
#define QERR_TOO_MANY_FILES \
"{ 'class': 'TooManyFiles', 'data': {} }"
+#define QERR_UNDEFINED_ERROR \
+ "{ 'class': 'UndefinedError', 'data': {} }"
+
#define QERR_VNC_SERVER_FAILED \
"{ 'class': 'VNCServerFailed', 'data': { 'target': %s } }"
diff --git a/qfloat.c b/qfloat.c
index 05215f5..f8c8a2e 100644
--- a/qfloat.c
+++ b/qfloat.c
@@ -1,14 +1,6 @@
/*
* QFloat Module
*
- * Copyright (C) 2009 Red Hat Inc.
- *
- * Authors:
- * Luiz Capitulino <lcapitulino@redhat.com>
- *
- * This work is licensed under the terms of the GNU GPL, version 2. See
- * the COPYING file in the top-level directory.
- *
* Copyright IBM, Corp. 2009
*
* Authors:
diff --git a/qint.c b/qint.c
index 447e847..fb3823a 100644
--- a/qint.c
+++ b/qint.c
@@ -1,14 +1,15 @@
/*
- * QInt data type.
+ * QInt Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
- * This work is licensed under the terms of the GNU GPL, version 2. See
- * the COPYING file in the top-level directory.
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING.LIB file in the top-level directory.
*/
+
#include "qint.h"
#include "qobject.h"
#include "qemu-common.h"
diff --git a/qint.h b/qint.h
index 672b321..6b1a15c 100644
--- a/qint.h
+++ b/qint.h
@@ -1,3 +1,15 @@
+/*
+ * QInt Module
+ *
+ * Copyright (C) 2009 Red Hat Inc.
+ *
+ * Authors:
+ * Luiz Capitulino <lcapitulino@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING.LIB file in the top-level directory.
+ */
+
#ifndef QINT_H
#define QINT_H
diff --git a/qjson.c b/qjson.c
index 483c667..e4ee433 100644
--- a/qjson.c
+++ b/qjson.c
@@ -158,6 +158,9 @@ static void to_json(const QObject *obj, QString *str)
case '\b':
qstring_append(str, "\\b");
break;
+ case '\f':
+ qstring_append(str, "\\f");
+ break;
case '\n':
qstring_append(str, "\\n");
break;
diff --git a/qlist.c b/qlist.c
index 5fccb7d..5730fb8 100644
--- a/qlist.c
+++ b/qlist.c
@@ -1,14 +1,15 @@
/*
- * QList data type.
+ * QList Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
- * This work is licensed under the terms of the GNU GPL, version 2. See
- * the COPYING file in the top-level directory.
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING.LIB file in the top-level directory.
*/
+
#include "qlist.h"
#include "qobject.h"
#include "qemu-queue.h"
diff --git a/qlist.h b/qlist.h
index a3261e1..dbe7b92 100644
--- a/qlist.h
+++ b/qlist.h
@@ -1,14 +1,15 @@
/*
- * QList data type header.
+ * QList Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
- * This work is licensed under the terms of the GNU GPL, version 2. See
- * the COPYING file in the top-level directory.
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING.LIB file in the top-level directory.
*/
+
#ifndef QLIST_H
#define QLIST_H
diff --git a/qobject.h b/qobject.h
index 07de211..d42386d 100644
--- a/qobject.h
+++ b/qobject.h
@@ -8,8 +8,8 @@
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
- * This work is licensed under the terms of the GNU GPL, version 2. See
- * the COPYING file in the top-level directory.
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING.LIB file in the top-level directory.
*
* QObject Reference Counts Terminology
* ------------------------------------
diff --git a/qstring.c b/qstring.c
index 740a106..4e2ba08 100644
--- a/qstring.c
+++ b/qstring.c
@@ -1,14 +1,15 @@
/*
- * QString data type.
+ * QString Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
- * This work is licensed under the terms of the GNU GPL, version 2. See
- * the COPYING file in the top-level directory.
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING.LIB file in the top-level directory.
*/
+
#include "qobject.h"
#include "qstring.h"
#include "qemu-common.h"
diff --git a/qstring.h b/qstring.h
index 6aaa7d5..84ccd96 100644
--- a/qstring.h
+++ b/qstring.h
@@ -1,3 +1,15 @@
+/*
+ * QString Module
+ *
+ * Copyright (C) 2009 Red Hat Inc.
+ *
+ * Authors:
+ * Luiz Capitulino <lcapitulino@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING.LIB file in the top-level directory.
+ */
+
#ifndef QSTRING_H
#define QSTRING_H
diff --git a/targphys.h b/targphys.h
index 99ab23c..95648d6 100644
--- a/targphys.h
+++ b/targphys.h
@@ -5,10 +5,7 @@
#ifdef TARGET_PHYS_ADDR_BITS
/* target_phys_addr_t is the type of a physical address (its size can
- be different from 'target_ulong'). We have sizeof(target_phys_addr)
- = max(sizeof(unsigned long),
- sizeof(size_of_target_physical_address)) because we must pass a
- host pointer to memory operations in some cases */
+ be different from 'target_ulong'). */
#if TARGET_PHYS_ADDR_BITS == 32
typedef uint32_t target_phys_addr_t;