Compare commits
100
Commits
v2.7.0-rc2
...
v2.7.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1dc33ed90b | ||
|
|
12d2c4184c | ||
|
|
56f101ecce | ||
|
|
805b5d98c6 | ||
|
|
fff39a7ad0 | ||
|
|
2b294f6b65 | ||
|
|
336d5881a9 | ||
|
|
616018352c | ||
|
|
135a972b45 | ||
|
|
b69a553b4a | ||
|
|
e00da552a0 | ||
|
|
8c1c230a6e | ||
|
|
58a83c6149 | ||
|
|
bccdef6b1a | ||
|
|
d75aa4372f | ||
|
|
62680fad7f | ||
|
|
e0af5a0e8b | ||
|
|
67f3280c06 | ||
|
|
5f9f818ea8 | ||
|
|
5045570009 | ||
|
|
60c6b790fc | ||
|
|
aee5f8f98e | ||
|
|
02b1ad881c | ||
|
|
156af3ac98 | ||
|
|
ce83ee57f6 | ||
|
|
5844365fe8 | ||
|
|
4b887ae658 | ||
|
|
e9e0a5854b | ||
|
|
47882fa497 | ||
|
|
92b6a16087 | ||
|
|
5f0e775348 | ||
|
|
9fea273c85 | ||
|
|
9c37146782 | ||
|
|
1451a7a673 | ||
|
|
725092ede5 | ||
|
|
648774779a | ||
|
|
1f8b56e7ce | ||
|
|
1dc8a6695c | ||
|
|
8afc224ffe | ||
|
|
2d1c8d5456 | ||
|
|
66940d7491 | ||
|
|
c86c03cfd2 | ||
|
|
f3b9e787ae | ||
|
|
e5bfef86fe | ||
|
|
aba5d97664 | ||
|
|
e57218b6ed | ||
|
|
dfd6076710 | ||
|
|
94c9cb31c0 | ||
|
|
7d3e693646 | ||
|
|
03504d05f0 | ||
|
|
036990d72b | ||
|
|
7ccc44fd7d | ||
|
|
8a6a80896d | ||
|
|
e703d2f71c | ||
|
|
b7665c6027 | ||
|
|
c4f68f0b52 | ||
|
|
6bbbb0ac13 | ||
|
|
e723b87103 | ||
|
|
28b874429b | ||
|
|
d915b7bb4c | ||
|
|
bea048dcb9 | ||
|
|
474c624ddf | ||
|
|
787d134fb1 | ||
|
|
0e8b3cdfbc | ||
|
|
e110aa919a | ||
|
|
bce6261eb2 | ||
|
|
144a6db0b0 | ||
|
|
44713c9e85 | ||
|
|
d08306dc42 | ||
|
|
4b3e5c06a1 | ||
|
|
28ed5ef163 | ||
|
|
ca525ce561 | ||
|
|
ca10203cde | ||
|
|
d578cca333 | ||
|
|
141de88654 | ||
|
|
c2df878325 | ||
|
|
8fbe3d1fcf | ||
|
|
93eb8e31f3 | ||
|
|
906fb135e4 | ||
|
|
d11b268e17 | ||
|
|
9c83fc2e8e | ||
|
|
4babfaf05d | ||
|
|
caf6316de9 | ||
|
|
caebf37859 | ||
|
|
760d88d1d0 | ||
|
|
3fdd0ee393 | ||
|
|
93bf13c6df | ||
|
|
2368635d39 | ||
|
|
435405ac59 | ||
|
|
5927ed846a | ||
|
|
9d4cd7b4ed | ||
|
|
b0e8f5cadc | ||
|
|
a9c87304b7 | ||
|
|
7f2569246c | ||
|
|
2bb15bddf2 | ||
|
|
7f951b2d77 | ||
|
|
ab861f3915 | ||
|
|
a0d1cbdacf | ||
|
|
6c352ca9b4 | ||
|
|
ead315e43e |
No files matched your search
+7
-1
@@ -31,7 +31,11 @@ Do not leave whitespace dangling off the ends of lines.
|
||||
|
||||
2. Line width
|
||||
|
||||
Lines are 80 characters; not longer.
|
||||
Lines should be 80 characters; try not to make them longer.
|
||||
|
||||
Sometimes it is hard to do, especially when dealing with QEMU subsystems
|
||||
that use long function or symbol names. Even in that case, do not make
|
||||
lines much longer than 80 characters.
|
||||
|
||||
Rationale:
|
||||
- Some people like to tile their 24" screens with a 6x4 matrix of 80x24
|
||||
@@ -39,6 +43,8 @@ Rationale:
|
||||
let them keep doing it.
|
||||
- Code and especially patches is much more readable if limited to a sane
|
||||
line length. Eighty is traditional.
|
||||
- The four-space indentation makes the most common excuse ("But look
|
||||
at all that white space on the left!") moot.
|
||||
- It is the QEMU coding style.
|
||||
|
||||
3. Naming
|
||||
|
||||
@@ -158,6 +158,10 @@ painful. These are:
|
||||
* you may assume that right shift of a signed integer duplicates
|
||||
the sign bit (ie it is an arithmetic shift, not a logical shift)
|
||||
|
||||
In addition, QEMU assumes that the compiler does not use the latitude
|
||||
given in C99 and C11 to treat aspects of signed '<<' as undefined, as
|
||||
documented in the GNU Compiler Collection manual starting at version 4.0.
|
||||
|
||||
7. Error handling and reporting
|
||||
|
||||
7.1 Reporting errors to the human user
|
||||
|
||||
@@ -225,8 +225,9 @@ dtc/%:
|
||||
$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))
|
||||
|
||||
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
|
||||
# Only keep -O and -g cflags
|
||||
romsubdir-%:
|
||||
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
|
||||
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/" CFLAGS="$(filter -O% -g%,$(CFLAGS))",)
|
||||
|
||||
ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# audio/alsaaudio.c
|
||||
alsa_revents(int revents) "revents = %d"
|
||||
|
||||
+12
-5
@@ -39,6 +39,9 @@ typedef struct BDRVBlkdebugState {
|
||||
int new_state;
|
||||
int align;
|
||||
|
||||
/* For blkdebug_refresh_filename() */
|
||||
char *config_file;
|
||||
|
||||
QLIST_HEAD(, BlkdebugRule) rules[BLKDBG__MAX];
|
||||
QSIMPLEQ_HEAD(, BlkdebugRule) active_rules;
|
||||
QLIST_HEAD(, BlkdebugSuspendedReq) suspended_reqs;
|
||||
@@ -351,7 +354,6 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
BDRVBlkdebugState *s = bs->opaque;
|
||||
QemuOpts *opts;
|
||||
Error *local_err = NULL;
|
||||
const char *config;
|
||||
uint64_t align;
|
||||
int ret;
|
||||
|
||||
@@ -364,8 +366,8 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
}
|
||||
|
||||
/* Read rules from config file or command line options */
|
||||
config = qemu_opt_get(opts, "config");
|
||||
ret = read_config(s, config, options, errp);
|
||||
s->config_file = g_strdup(qemu_opt_get(opts, "config"));
|
||||
ret = read_config(s, s->config_file, options, errp);
|
||||
if (ret) {
|
||||
goto out;
|
||||
}
|
||||
@@ -398,6 +400,9 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
fail_unref:
|
||||
bdrv_unref_child(bs, bs->file);
|
||||
out:
|
||||
if (ret < 0) {
|
||||
g_free(s->config_file);
|
||||
}
|
||||
qemu_opts_del(opts);
|
||||
return ret;
|
||||
}
|
||||
@@ -515,6 +520,8 @@ static void blkdebug_close(BlockDriverState *bs)
|
||||
remove_rule(rule);
|
||||
}
|
||||
}
|
||||
|
||||
g_free(s->config_file);
|
||||
}
|
||||
|
||||
static void suspend_request(BlockDriverState *bs, BlkdebugRule *rule)
|
||||
@@ -679,6 +686,7 @@ static int blkdebug_truncate(BlockDriverState *bs, int64_t offset)
|
||||
|
||||
static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)
|
||||
{
|
||||
BDRVBlkdebugState *s = bs->opaque;
|
||||
QDict *opts;
|
||||
const QDictEntry *e;
|
||||
bool force_json = false;
|
||||
@@ -700,8 +708,7 @@ static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)
|
||||
|
||||
if (!force_json && bs->file->bs->exact_filename[0]) {
|
||||
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
|
||||
"blkdebug:%s:%s",
|
||||
qdict_get_try_str(options, "config") ?: "",
|
||||
"blkdebug:%s:%s", s->config_file ?: "",
|
||||
bs->file->bs->exact_filename);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -169,7 +169,7 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
|
||||
state->sock_fd = fd;
|
||||
s = state->s;
|
||||
|
||||
DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, fd);
|
||||
DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, (int)fd);
|
||||
switch (action) {
|
||||
case CURL_POLL_IN:
|
||||
aio_set_fd_handler(s->aio_context, fd, false,
|
||||
|
||||
+5
-3
@@ -2283,11 +2283,11 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
|
||||
int current_gen = bs->write_gen;
|
||||
|
||||
/* Wait until any previous flushes are completed */
|
||||
while (bs->flush_started_gen != bs->flushed_gen) {
|
||||
while (bs->active_flush_req != NULL) {
|
||||
qemu_co_queue_wait(&bs->flush_queue);
|
||||
}
|
||||
|
||||
bs->flush_started_gen = current_gen;
|
||||
bs->active_flush_req = &req;
|
||||
|
||||
/* Write back all layers by calling one driver function */
|
||||
if (bs->drv->bdrv_co_flush) {
|
||||
@@ -2357,7 +2357,9 @@ flush_parent:
|
||||
out:
|
||||
/* Notify any pending flushes that we have completed */
|
||||
bs->flushed_gen = current_gen;
|
||||
qemu_co_queue_restart_all(&bs->flush_queue);
|
||||
bs->active_flush_req = NULL;
|
||||
/* Return value is ignored - it's ok if wait queue is empty */
|
||||
qemu_co_queue_next(&bs->flush_queue);
|
||||
|
||||
tracked_request_end(&req);
|
||||
return ret;
|
||||
|
||||
+7
-1
@@ -221,7 +221,13 @@ static void ioq_submit(LinuxAioState *s)
|
||||
break;
|
||||
}
|
||||
if (ret < 0) {
|
||||
abort();
|
||||
/* Fail the first request, retry the rest */
|
||||
aiocb = QSIMPLEQ_FIRST(&s->io_q.pending);
|
||||
QSIMPLEQ_REMOVE_HEAD(&s->io_q.pending, next);
|
||||
s->io_q.in_queue--;
|
||||
aiocb->ret = ret;
|
||||
qemu_laio_process_completion(aiocb);
|
||||
continue;
|
||||
}
|
||||
|
||||
s->io_q.in_flight += ret;
|
||||
|
||||
+105
-54
@@ -42,6 +42,9 @@
|
||||
|
||||
typedef struct BDRVNBDState {
|
||||
NbdClientSession client;
|
||||
|
||||
/* For nbd_refresh_filename() */
|
||||
char *path, *host, *port, *export, *tlscredsid;
|
||||
} BDRVNBDState;
|
||||
|
||||
static int nbd_parse_uri(const char *filename, QDict *options)
|
||||
@@ -188,13 +191,15 @@ out:
|
||||
g_free(file);
|
||||
}
|
||||
|
||||
static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, char **export,
|
||||
Error **errp)
|
||||
static SocketAddress *nbd_config(BDRVNBDState *s, QemuOpts *opts, Error **errp)
|
||||
{
|
||||
SocketAddress *saddr;
|
||||
|
||||
if (qdict_haskey(options, "path") == qdict_haskey(options, "host")) {
|
||||
if (qdict_haskey(options, "path")) {
|
||||
s->path = g_strdup(qemu_opt_get(opts, "path"));
|
||||
s->host = g_strdup(qemu_opt_get(opts, "host"));
|
||||
|
||||
if (!s->path == !s->host) {
|
||||
if (s->path) {
|
||||
error_setg(errp, "path and host may not be used at the same time.");
|
||||
} else {
|
||||
error_setg(errp, "one of path and host must be specified.");
|
||||
@@ -204,32 +209,28 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, char **export,
|
||||
|
||||
saddr = g_new0(SocketAddress, 1);
|
||||
|
||||
if (qdict_haskey(options, "path")) {
|
||||
if (s->path) {
|
||||
UnixSocketAddress *q_unix;
|
||||
saddr->type = SOCKET_ADDRESS_KIND_UNIX;
|
||||
q_unix = saddr->u.q_unix.data = g_new0(UnixSocketAddress, 1);
|
||||
q_unix->path = g_strdup(qdict_get_str(options, "path"));
|
||||
qdict_del(options, "path");
|
||||
q_unix->path = g_strdup(s->path);
|
||||
} else {
|
||||
InetSocketAddress *inet;
|
||||
|
||||
s->port = g_strdup(qemu_opt_get(opts, "port"));
|
||||
|
||||
saddr->type = SOCKET_ADDRESS_KIND_INET;
|
||||
inet = saddr->u.inet.data = g_new0(InetSocketAddress, 1);
|
||||
inet->host = g_strdup(qdict_get_str(options, "host"));
|
||||
if (!qdict_get_try_str(options, "port")) {
|
||||
inet->host = g_strdup(s->host);
|
||||
inet->port = g_strdup(s->port);
|
||||
if (!inet->port) {
|
||||
inet->port = g_strdup_printf("%d", NBD_DEFAULT_PORT);
|
||||
} else {
|
||||
inet->port = g_strdup(qdict_get_str(options, "port"));
|
||||
}
|
||||
qdict_del(options, "host");
|
||||
qdict_del(options, "port");
|
||||
}
|
||||
|
||||
s->client.is_unix = saddr->type == SOCKET_ADDRESS_KIND_UNIX;
|
||||
|
||||
*export = g_strdup(qdict_get_try_str(options, "export"));
|
||||
if (*export) {
|
||||
qdict_del(options, "export");
|
||||
}
|
||||
s->export = g_strdup(qemu_opt_get(opts, "export"));
|
||||
|
||||
return saddr;
|
||||
}
|
||||
@@ -292,28 +293,66 @@ static QCryptoTLSCreds *nbd_get_tls_creds(const char *id, Error **errp)
|
||||
}
|
||||
|
||||
|
||||
static QemuOptsList nbd_runtime_opts = {
|
||||
.name = "nbd",
|
||||
.head = QTAILQ_HEAD_INITIALIZER(nbd_runtime_opts.head),
|
||||
.desc = {
|
||||
{
|
||||
.name = "host",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "TCP host to connect to",
|
||||
},
|
||||
{
|
||||
.name = "port",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "TCP port to connect to",
|
||||
},
|
||||
{
|
||||
.name = "path",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "Unix socket path to connect to",
|
||||
},
|
||||
{
|
||||
.name = "export",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "Name of the NBD export to open",
|
||||
},
|
||||
{
|
||||
.name = "tls-creds",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "ID of the TLS credentials to use",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
Error **errp)
|
||||
{
|
||||
BDRVNBDState *s = bs->opaque;
|
||||
char *export = NULL;
|
||||
QemuOpts *opts = NULL;
|
||||
Error *local_err = NULL;
|
||||
QIOChannelSocket *sioc = NULL;
|
||||
SocketAddress *saddr;
|
||||
const char *tlscredsid;
|
||||
SocketAddress *saddr = NULL;
|
||||
QCryptoTLSCreds *tlscreds = NULL;
|
||||
const char *hostname = NULL;
|
||||
int ret = -EINVAL;
|
||||
|
||||
opts = qemu_opts_create(&nbd_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Pop the config into our state object. Exit if invalid. */
|
||||
saddr = nbd_config(s, options, &export, errp);
|
||||
saddr = nbd_config(s, opts, errp);
|
||||
if (!saddr) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
tlscredsid = g_strdup(qdict_get_try_str(options, "tls-creds"));
|
||||
if (tlscredsid) {
|
||||
qdict_del(options, "tls-creds");
|
||||
tlscreds = nbd_get_tls_creds(tlscredsid, errp);
|
||||
s->tlscredsid = g_strdup(qemu_opt_get(opts, "tls-creds"));
|
||||
if (s->tlscredsid) {
|
||||
tlscreds = nbd_get_tls_creds(s->tlscredsid, errp);
|
||||
if (!tlscreds) {
|
||||
goto error;
|
||||
}
|
||||
@@ -335,7 +374,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
}
|
||||
|
||||
/* NBD handshake */
|
||||
ret = nbd_client_init(bs, sioc, export,
|
||||
ret = nbd_client_init(bs, sioc, s->export,
|
||||
tlscreds, hostname, errp);
|
||||
error:
|
||||
if (sioc) {
|
||||
@@ -344,8 +383,15 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
if (tlscreds) {
|
||||
object_unref(OBJECT(tlscreds));
|
||||
}
|
||||
if (ret < 0) {
|
||||
g_free(s->path);
|
||||
g_free(s->host);
|
||||
g_free(s->port);
|
||||
g_free(s->export);
|
||||
g_free(s->tlscredsid);
|
||||
}
|
||||
qapi_free_SocketAddress(saddr);
|
||||
g_free(export);
|
||||
qemu_opts_del(opts);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -362,7 +408,15 @@ static void nbd_refresh_limits(BlockDriverState *bs, Error **errp)
|
||||
|
||||
static void nbd_close(BlockDriverState *bs)
|
||||
{
|
||||
BDRVNBDState *s = bs->opaque;
|
||||
|
||||
nbd_client_close(bs);
|
||||
|
||||
g_free(s->path);
|
||||
g_free(s->host);
|
||||
g_free(s->port);
|
||||
g_free(s->export);
|
||||
g_free(s->tlscredsid);
|
||||
}
|
||||
|
||||
static int64_t nbd_getlength(BlockDriverState *bs)
|
||||
@@ -385,48 +439,45 @@ static void nbd_attach_aio_context(BlockDriverState *bs,
|
||||
|
||||
static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
|
||||
{
|
||||
BDRVNBDState *s = bs->opaque;
|
||||
QDict *opts = qdict_new();
|
||||
const char *path = qdict_get_try_str(options, "path");
|
||||
const char *host = qdict_get_try_str(options, "host");
|
||||
const char *port = qdict_get_try_str(options, "port");
|
||||
const char *export = qdict_get_try_str(options, "export");
|
||||
const char *tlscreds = qdict_get_try_str(options, "tls-creds");
|
||||
|
||||
qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("nbd")));
|
||||
|
||||
if (path && export) {
|
||||
if (s->path && s->export) {
|
||||
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
|
||||
"nbd+unix:///%s?socket=%s", export, path);
|
||||
} else if (path && !export) {
|
||||
"nbd+unix:///%s?socket=%s", s->export, s->path);
|
||||
} else if (s->path && !s->export) {
|
||||
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
|
||||
"nbd+unix://?socket=%s", path);
|
||||
} else if (!path && export && port) {
|
||||
"nbd+unix://?socket=%s", s->path);
|
||||
} else if (!s->path && s->export && s->port) {
|
||||
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
|
||||
"nbd://%s:%s/%s", host, port, export);
|
||||
} else if (!path && export && !port) {
|
||||
"nbd://%s:%s/%s", s->host, s->port, s->export);
|
||||
} else if (!s->path && s->export && !s->port) {
|
||||
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
|
||||
"nbd://%s/%s", host, export);
|
||||
} else if (!path && !export && port) {
|
||||
"nbd://%s/%s", s->host, s->export);
|
||||
} else if (!s->path && !s->export && s->port) {
|
||||
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
|
||||
"nbd://%s:%s", host, port);
|
||||
} else if (!path && !export && !port) {
|
||||
"nbd://%s:%s", s->host, s->port);
|
||||
} else if (!s->path && !s->export && !s->port) {
|
||||
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
|
||||
"nbd://%s", host);
|
||||
"nbd://%s", s->host);
|
||||
}
|
||||
|
||||
if (path) {
|
||||
qdict_put_obj(opts, "path", QOBJECT(qstring_from_str(path)));
|
||||
} else if (port) {
|
||||
qdict_put_obj(opts, "host", QOBJECT(qstring_from_str(host)));
|
||||
qdict_put_obj(opts, "port", QOBJECT(qstring_from_str(port)));
|
||||
if (s->path) {
|
||||
qdict_put_obj(opts, "path", QOBJECT(qstring_from_str(s->path)));
|
||||
} else if (s->port) {
|
||||
qdict_put_obj(opts, "host", QOBJECT(qstring_from_str(s->host)));
|
||||
qdict_put_obj(opts, "port", QOBJECT(qstring_from_str(s->port)));
|
||||
} else {
|
||||
qdict_put_obj(opts, "host", QOBJECT(qstring_from_str(host)));
|
||||
qdict_put_obj(opts, "host", QOBJECT(qstring_from_str(s->host)));
|
||||
}
|
||||
if (export) {
|
||||
qdict_put_obj(opts, "export", QOBJECT(qstring_from_str(export)));
|
||||
if (s->export) {
|
||||
qdict_put_obj(opts, "export", QOBJECT(qstring_from_str(s->export)));
|
||||
}
|
||||
if (tlscreds) {
|
||||
qdict_put_obj(opts, "tls-creds", QOBJECT(qstring_from_str(tlscreds)));
|
||||
if (s->tlscredsid) {
|
||||
qdict_put_obj(opts, "tls-creds",
|
||||
QOBJECT(qstring_from_str(s->tlscredsid)));
|
||||
}
|
||||
|
||||
bs->full_open_options = opts;
|
||||
|
||||
+55
-24
@@ -508,36 +508,73 @@ static int authenticate(BDRVSSHState *s, const char *user, Error **errp)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static QemuOptsList ssh_runtime_opts = {
|
||||
.name = "ssh",
|
||||
.head = QTAILQ_HEAD_INITIALIZER(ssh_runtime_opts.head),
|
||||
.desc = {
|
||||
{
|
||||
.name = "host",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "Host to connect to",
|
||||
},
|
||||
{
|
||||
.name = "port",
|
||||
.type = QEMU_OPT_NUMBER,
|
||||
.help = "Port to connect to",
|
||||
},
|
||||
{
|
||||
.name = "path",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "Path of the image on the host",
|
||||
},
|
||||
{
|
||||
.name = "user",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "User as which to connect",
|
||||
},
|
||||
{
|
||||
.name = "host_key_check",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "Defines how and what to check the host key against",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static int connect_to_ssh(BDRVSSHState *s, QDict *options,
|
||||
int ssh_flags, int creat_mode, Error **errp)
|
||||
{
|
||||
int r, ret;
|
||||
QemuOpts *opts = NULL;
|
||||
Error *local_err = NULL;
|
||||
const char *host, *user, *path, *host_key_check;
|
||||
int port;
|
||||
|
||||
if (!qdict_haskey(options, "host")) {
|
||||
opts = qemu_opts_create(&ssh_runtime_opts, NULL, 0, &error_abort);
|
||||
qemu_opts_absorb_qdict(opts, options, &local_err);
|
||||
if (local_err) {
|
||||
ret = -EINVAL;
|
||||
error_propagate(errp, local_err);
|
||||
goto err;
|
||||
}
|
||||
|
||||
host = qemu_opt_get(opts, "host");
|
||||
if (!host) {
|
||||
ret = -EINVAL;
|
||||
error_setg(errp, "No hostname was specified");
|
||||
goto err;
|
||||
}
|
||||
host = qdict_get_str(options, "host");
|
||||
|
||||
if (qdict_haskey(options, "port")) {
|
||||
port = qdict_get_int(options, "port");
|
||||
} else {
|
||||
port = 22;
|
||||
}
|
||||
port = qemu_opt_get_number(opts, "port", 22);
|
||||
|
||||
if (!qdict_haskey(options, "path")) {
|
||||
path = qemu_opt_get(opts, "path");
|
||||
if (!path) {
|
||||
ret = -EINVAL;
|
||||
error_setg(errp, "No path was specified");
|
||||
goto err;
|
||||
}
|
||||
path = qdict_get_str(options, "path");
|
||||
|
||||
if (qdict_haskey(options, "user")) {
|
||||
user = qdict_get_str(options, "user");
|
||||
} else {
|
||||
user = qemu_opt_get(opts, "user");
|
||||
if (!user) {
|
||||
user = g_get_user_name();
|
||||
if (!user) {
|
||||
error_setg_errno(errp, errno, "Can't get user name");
|
||||
@@ -546,9 +583,8 @@ static int connect_to_ssh(BDRVSSHState *s, QDict *options,
|
||||
}
|
||||
}
|
||||
|
||||
if (qdict_haskey(options, "host_key_check")) {
|
||||
host_key_check = qdict_get_str(options, "host_key_check");
|
||||
} else {
|
||||
host_key_check = qemu_opt_get(opts, "host_key_check");
|
||||
if (!host_key_check) {
|
||||
host_key_check = "yes";
|
||||
}
|
||||
|
||||
@@ -612,21 +648,14 @@ static int connect_to_ssh(BDRVSSHState *s, QDict *options,
|
||||
goto err;
|
||||
}
|
||||
|
||||
qemu_opts_del(opts);
|
||||
|
||||
r = libssh2_sftp_fstat(s->sftp_handle, &s->attrs);
|
||||
if (r < 0) {
|
||||
sftp_error_setg(errp, s, "failed to read file attributes");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Delete the options we've used; any not deleted will cause the
|
||||
* block layer to give an error about unused options.
|
||||
*/
|
||||
qdict_del(options, "host");
|
||||
qdict_del(options, "port");
|
||||
qdict_del(options, "user");
|
||||
qdict_del(options, "path");
|
||||
qdict_del(options, "host_key_check");
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
@@ -646,6 +675,8 @@ static int connect_to_ssh(BDRVSSHState *s, QDict *options,
|
||||
}
|
||||
s->session = NULL;
|
||||
|
||||
qemu_opts_del(opts);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# block.c
|
||||
bdrv_open_common(void *bs, const char *filename, int flags, const char *format_name) "bs %p filename \"%s\" flags %#x format_name \"%s\""
|
||||
|
||||
+3
-1
@@ -17,6 +17,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu-version.h"
|
||||
#include <machine/trap.h>
|
||||
|
||||
#include "qapi/error.h"
|
||||
@@ -667,7 +668,8 @@ void cpu_loop(CPUSPARCState *env)
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
printf("qemu-" TARGET_NAME " version " QEMU_VERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"
|
||||
printf("qemu-" TARGET_NAME " version " QEMU_VERSION QEMU_PKGVERSION
|
||||
", " QEMU_COPYRIGHT "\n"
|
||||
"usage: qemu-" TARGET_NAME " [options] program [arguments...]\n"
|
||||
"BSD CPU emulator (compiled for %s emulation)\n"
|
||||
"\n"
|
||||
|
||||
@@ -1452,7 +1452,7 @@ fi
|
||||
gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
|
||||
gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
|
||||
gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
|
||||
gcc_flags="-Wendif-labels $gcc_flags"
|
||||
gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
|
||||
gcc_flags="-Wno-initializer-overrides $gcc_flags"
|
||||
gcc_flags="-Wno-string-plus-int $gcc_flags"
|
||||
# Note that we do not add -Werror to gcc_flags here, because that would
|
||||
@@ -4699,7 +4699,16 @@ roms=
|
||||
if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
|
||||
"$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
|
||||
"$softmmu" = yes ; then
|
||||
roms="optionrom"
|
||||
# Different host OS linkers have different ideas about the name of the ELF
|
||||
# emulation. Linux and OpenBSD use 'elf_i386'; FreeBSD uses the _fbsd
|
||||
# variant; and Windows uses i386pe.
|
||||
for emu in elf_i386 elf_i386_fbsd i386pe; do
|
||||
if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then
|
||||
ld_i386_emulation="$emu"
|
||||
roms="optionrom"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then
|
||||
roms="$roms spapr-rtas"
|
||||
@@ -5539,6 +5548,7 @@ fi
|
||||
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
|
||||
echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak
|
||||
echo "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak
|
||||
echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
|
||||
echo "LIBS+=$LIBS" >> $config_host_mak
|
||||
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
|
||||
echo "PTHREAD_LIB=$PTHREAD_LIB" >> $config_host_mak
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# crypto/tlscreds.c
|
||||
qcrypto_tls_creds_load_dh(void *creds, const char *filename) "TLS creds load DH creds=%p filename=%s"
|
||||
|
||||
@@ -37,6 +37,8 @@ consists of 3 header fields and a payload:
|
||||
* Flags: 32-bit bit field:
|
||||
- Lower 2 bits are the version (currently 0x01)
|
||||
- Bit 2 is the reply flag - needs to be sent on each reply from the slave
|
||||
- Bit 3 is the need_reply flag - see VHOST_USER_PROTOCOL_F_REPLY_ACK for
|
||||
details.
|
||||
* Size - 32-bit size of the payload
|
||||
|
||||
|
||||
@@ -126,6 +128,8 @@ the ones that do:
|
||||
* VHOST_GET_VRING_BASE
|
||||
* VHOST_SET_LOG_BASE (if VHOST_USER_PROTOCOL_F_LOG_SHMFD)
|
||||
|
||||
[ Also see the section on REPLY_ACK protocol extension. ]
|
||||
|
||||
There are several messages that the master sends with file descriptors passed
|
||||
in the ancillary data:
|
||||
|
||||
@@ -254,6 +258,7 @@ Protocol features
|
||||
#define VHOST_USER_PROTOCOL_F_MQ 0
|
||||
#define VHOST_USER_PROTOCOL_F_LOG_SHMFD 1
|
||||
#define VHOST_USER_PROTOCOL_F_RARP 2
|
||||
#define VHOST_USER_PROTOCOL_F_REPLY_ACK 3
|
||||
|
||||
Message types
|
||||
-------------
|
||||
@@ -464,3 +469,24 @@ Message types
|
||||
is present in VHOST_USER_GET_PROTOCOL_FEATURES.
|
||||
The first 6 bytes of the payload contain the mac address of the guest to
|
||||
allow the vhost user backend to construct and broadcast the fake RARP.
|
||||
|
||||
VHOST_USER_PROTOCOL_F_REPLY_ACK:
|
||||
-------------------------------
|
||||
The original vhost-user specification only demands replies for certain
|
||||
commands. This differs from the vhost protocol implementation where commands
|
||||
are sent over an ioctl() call and block until the client has completed.
|
||||
|
||||
With this protocol extension negotiated, the sender (QEMU) can set the
|
||||
"need_reply" [Bit 3] flag to any command. This indicates that
|
||||
the client MUST respond with a Payload VhostUserMsg indicating success or
|
||||
failure. The payload should be set to zero on success or non-zero on failure,
|
||||
unless the message already has an explicit reply body.
|
||||
|
||||
The response payload gives QEMU a deterministic indication of the result
|
||||
of the command. Today, QEMU is expected to terminate the main vhost-user
|
||||
loop upon receiving such errors. In future, qemu could be taught to be more
|
||||
resilient for selective requests.
|
||||
|
||||
For the message types that already solicit a reply from the client, the
|
||||
presence of VHOST_USER_PROTOCOL_F_REPLY_ACK or need_reply bit being set brings
|
||||
no behavioural change. (See the 'Communication' section for details.)
|
||||
@@ -197,7 +197,7 @@ float128 float128_default_nan(float_status *status)
|
||||
| should be simply `float_exception_flags |= flags;'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
void float_raise(int8_t flags, float_status *status)
|
||||
void float_raise(uint8_t flags, float_status *status)
|
||||
{
|
||||
status->float_exception_flags |= flags;
|
||||
}
|
||||
|
||||
+138
-9
@@ -1010,6 +1010,7 @@ static void v9fs_attach(void *opaque)
|
||||
goto out;
|
||||
}
|
||||
err += offset;
|
||||
memcpy(&s->root_qid, &qid, sizeof(qid));
|
||||
trace_v9fs_attach_return(pdu->tag, pdu->id,
|
||||
qid.type, qid.version, qid.path);
|
||||
/*
|
||||
@@ -1256,6 +1257,19 @@ static int v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
|
||||
return offset;
|
||||
}
|
||||
|
||||
static bool name_is_illegal(const char *name)
|
||||
{
|
||||
return !*name || strchr(name, '/') != NULL;
|
||||
}
|
||||
|
||||
static bool not_same_qid(const V9fsQID *qid1, const V9fsQID *qid2)
|
||||
{
|
||||
return
|
||||
qid1->type != qid2->type ||
|
||||
qid1->version != qid2->version ||
|
||||
qid1->path != qid2->path;
|
||||
}
|
||||
|
||||
static void v9fs_walk(void *opaque)
|
||||
{
|
||||
int name_idx;
|
||||
@@ -1271,6 +1285,7 @@ static void v9fs_walk(void *opaque)
|
||||
V9fsFidState *newfidp = NULL;
|
||||
V9fsPDU *pdu = opaque;
|
||||
V9fsState *s = pdu->s;
|
||||
V9fsQID qid;
|
||||
|
||||
err = pdu_unmarshal(pdu, offset, "ddw", &fid, &newfid, &nwnames);
|
||||
if (err < 0) {
|
||||
@@ -1289,6 +1304,10 @@ static void v9fs_walk(void *opaque)
|
||||
if (err < 0) {
|
||||
goto out_nofid;
|
||||
}
|
||||
if (name_is_illegal(wnames[i].data)) {
|
||||
err = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
offset += err;
|
||||
}
|
||||
} else if (nwnames > P9_MAXWELEM) {
|
||||
@@ -1300,6 +1319,12 @@ static void v9fs_walk(void *opaque)
|
||||
err = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
err = fid_to_qid(pdu, fidp, &qid);
|
||||
if (err < 0) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
v9fs_path_init(&dpath);
|
||||
v9fs_path_init(&path);
|
||||
/*
|
||||
@@ -1309,16 +1334,22 @@ static void v9fs_walk(void *opaque)
|
||||
v9fs_path_copy(&dpath, &fidp->path);
|
||||
v9fs_path_copy(&path, &fidp->path);
|
||||
for (name_idx = 0; name_idx < nwnames; name_idx++) {
|
||||
err = v9fs_co_name_to_path(pdu, &dpath, wnames[name_idx].data, &path);
|
||||
if (err < 0) {
|
||||
goto out;
|
||||
if (not_same_qid(&pdu->s->root_qid, &qid) ||
|
||||
strcmp("..", wnames[name_idx].data)) {
|
||||
err = v9fs_co_name_to_path(pdu, &dpath, wnames[name_idx].data,
|
||||
&path);
|
||||
if (err < 0) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = v9fs_co_lstat(pdu, &path, &stbuf);
|
||||
if (err < 0) {
|
||||
goto out;
|
||||
}
|
||||
stat_to_qid(&stbuf, &qid);
|
||||
v9fs_path_copy(&dpath, &path);
|
||||
}
|
||||
err = v9fs_co_lstat(pdu, &path, &stbuf);
|
||||
if (err < 0) {
|
||||
goto out;
|
||||
}
|
||||
stat_to_qid(&stbuf, &qids[name_idx]);
|
||||
v9fs_path_copy(&dpath, &path);
|
||||
memcpy(&qids[name_idx], &qid, sizeof(qid));
|
||||
}
|
||||
if (fid == newfid) {
|
||||
BUG_ON(fidp->fid_type != P9_FID_NONE);
|
||||
@@ -1483,6 +1514,16 @@ static void v9fs_lcreate(void *opaque)
|
||||
}
|
||||
trace_v9fs_lcreate(pdu->tag, pdu->id, dfid, flags, mode, gid);
|
||||
|
||||
if (name_is_illegal(name.data)) {
|
||||
err = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (!strcmp(".", name.data) || !strcmp("..", name.data)) {
|
||||
err = -EEXIST;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
fidp = get_fid(pdu, dfid);
|
||||
if (fidp == NULL) {
|
||||
err = -ENOENT;
|
||||
@@ -2077,6 +2118,16 @@ static void v9fs_create(void *opaque)
|
||||
}
|
||||
trace_v9fs_create(pdu->tag, pdu->id, fid, name.data, perm, mode);
|
||||
|
||||
if (name_is_illegal(name.data)) {
|
||||
err = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (!strcmp(".", name.data) || !strcmp("..", name.data)) {
|
||||
err = -EEXIST;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
fidp = get_fid(pdu, fid);
|
||||
if (fidp == NULL) {
|
||||
err = -EINVAL;
|
||||
@@ -2242,6 +2293,16 @@ static void v9fs_symlink(void *opaque)
|
||||
}
|
||||
trace_v9fs_symlink(pdu->tag, pdu->id, dfid, name.data, symname.data, gid);
|
||||
|
||||
if (name_is_illegal(name.data)) {
|
||||
err = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (!strcmp(".", name.data) || !strcmp("..", name.data)) {
|
||||
err = -EEXIST;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
dfidp = get_fid(pdu, dfid);
|
||||
if (dfidp == NULL) {
|
||||
err = -EINVAL;
|
||||
@@ -2316,6 +2377,16 @@ static void v9fs_link(void *opaque)
|
||||
}
|
||||
trace_v9fs_link(pdu->tag, pdu->id, dfid, oldfid, name.data);
|
||||
|
||||
if (name_is_illegal(name.data)) {
|
||||
err = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (!strcmp(".", name.data) || !strcmp("..", name.data)) {
|
||||
err = -EEXIST;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
dfidp = get_fid(pdu, dfid);
|
||||
if (dfidp == NULL) {
|
||||
err = -ENOENT;
|
||||
@@ -2398,6 +2469,22 @@ static void v9fs_unlinkat(void *opaque)
|
||||
if (err < 0) {
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (name_is_illegal(name.data)) {
|
||||
err = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (!strcmp(".", name.data)) {
|
||||
err = -EINVAL;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (!strcmp("..", name.data)) {
|
||||
err = -ENOTEMPTY;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
dfidp = get_fid(pdu, dfid);
|
||||
if (dfidp == NULL) {
|
||||
err = -EINVAL;
|
||||
@@ -2504,6 +2591,17 @@ static void v9fs_rename(void *opaque)
|
||||
if (err < 0) {
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (name_is_illegal(name.data)) {
|
||||
err = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (!strcmp(".", name.data) || !strcmp("..", name.data)) {
|
||||
err = -EISDIR;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
fidp = get_fid(pdu, fid);
|
||||
if (fidp == NULL) {
|
||||
err = -ENOENT;
|
||||
@@ -2616,6 +2714,17 @@ static void v9fs_renameat(void *opaque)
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
if (name_is_illegal(old_name.data) || name_is_illegal(new_name.data)) {
|
||||
err = -ENOENT;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
if (!strcmp(".", old_name.data) || !strcmp("..", old_name.data) ||
|
||||
!strcmp(".", new_name.data) || !strcmp("..", new_name.data)) {
|
||||
err = -EISDIR;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
v9fs_path_write_lock(s);
|
||||
err = v9fs_complete_renameat(pdu, olddirfid,
|
||||
&old_name, newdirfid, &new_name);
|
||||
@@ -2826,6 +2935,16 @@ static void v9fs_mknod(void *opaque)
|
||||
}
|
||||
trace_v9fs_mknod(pdu->tag, pdu->id, fid, mode, major, minor);
|
||||
|
||||
if (name_is_illegal(name.data)) {
|
||||
err = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (!strcmp(".", name.data) || !strcmp("..", name.data)) {
|
||||
err = -EEXIST;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
fidp = get_fid(pdu, fid);
|
||||
if (fidp == NULL) {
|
||||
err = -ENOENT;
|
||||
@@ -2977,6 +3096,16 @@ static void v9fs_mkdir(void *opaque)
|
||||
}
|
||||
trace_v9fs_mkdir(pdu->tag, pdu->id, fid, name.data, mode, gid);
|
||||
|
||||
if (name_is_illegal(name.data)) {
|
||||
err = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
if (!strcmp(".", name.data) || !strcmp("..", name.data)) {
|
||||
err = -EEXIST;
|
||||
goto out_nofid;
|
||||
}
|
||||
|
||||
fidp = get_fid(pdu, fid);
|
||||
if (fidp == NULL) {
|
||||
err = -ENOENT;
|
||||
|
||||
@@ -236,6 +236,7 @@ typedef struct V9fsState
|
||||
int32_t root_fid;
|
||||
Error *migration_blocker;
|
||||
V9fsConf fsconf;
|
||||
V9fsQID root_qid;
|
||||
} V9fsState;
|
||||
|
||||
/* 9p2000.L open flags */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/9pfs/virtio-9p.c
|
||||
v9fs_rerror(uint16_t tag, uint8_t id, int err) "tag %d id %d err %d"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/acpi/memory_hotplug.c
|
||||
mhp_acpi_invalid_slot_selected(uint32_t slot) "0x%"PRIx32
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/alpha/pci.c
|
||||
alpha_pci_iack_write(void) ""
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/arm/virt-acpi-build.c
|
||||
virt_acpi_setup(void) "No fw cfg or ACPI disabled. Bailing out."
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/audio/cs4231.c
|
||||
cs4231_mem_readl_dreg(uint32_t reg, uint32_t ret) "read dreg %d: 0x%02x"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/block/virtio-blk.c
|
||||
virtio_blk_req_complete(void *req, int status) "req %p status %d"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/char/virtio-serial-bus.c
|
||||
virtio_serial_send_control_event(unsigned int port, uint16_t event, uint16_t value) "port %u, event %u, value %u"
|
||||
|
||||
@@ -85,8 +85,9 @@ static void set_guest_connected(VirtIOSerialPort *port, int guest_connected)
|
||||
{
|
||||
VirtConsole *vcon = VIRTIO_CONSOLE(port);
|
||||
DeviceState *dev = DEVICE(port);
|
||||
VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(port);
|
||||
|
||||
if (vcon->chr) {
|
||||
if (vcon->chr && !k->is_console) {
|
||||
qemu_chr_fe_set_open(vcon->chr, guest_connected);
|
||||
}
|
||||
|
||||
@@ -156,9 +157,25 @@ static void virtconsole_realize(DeviceState *dev, Error **errp)
|
||||
}
|
||||
|
||||
if (vcon->chr) {
|
||||
vcon->chr->explicit_fe_open = 1;
|
||||
qemu_chr_add_handlers(vcon->chr, chr_can_read, chr_read, chr_event,
|
||||
vcon);
|
||||
/*
|
||||
* For consoles we don't block guest data transfer just
|
||||
* because nothing is connected - we'll just let it go
|
||||
* whetherever the chardev wants - /dev/null probably.
|
||||
*
|
||||
* For serial ports we need 100% reliable data transfer
|
||||
* so we use the opened/closed signals from chardev to
|
||||
* trigger open/close of the device
|
||||
*/
|
||||
if (k->is_console) {
|
||||
vcon->chr->explicit_fe_open = 0;
|
||||
qemu_chr_add_handlers(vcon->chr, chr_can_read, chr_read,
|
||||
NULL, vcon);
|
||||
virtio_serial_open(port);
|
||||
} else {
|
||||
vcon->chr->explicit_fe_open = 1;
|
||||
qemu_chr_add_handlers(vcon->chr, chr_can_read, chr_read,
|
||||
chr_event, vcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/display/jazz_led.c
|
||||
jazz_led_read(uint64_t addr, uint8_t val) "read addr=0x%"PRIx64": 0x%x"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/dma/rc4030.c
|
||||
jazzio_read(uint64_t addr, uint32_t ret) "read reg[0x%"PRIx64"] = 0x%x"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/i386/xen/xen_platform.c
|
||||
xen_platform_log(char *s) "xen platform: %s"
|
||||
|
||||
@@ -386,6 +386,7 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret)
|
||||
if (ret < 0) {
|
||||
if (ide_handle_rw_error(s, -ret, ide_dma_cmd_to_retry(s->dma_cmd))) {
|
||||
if (s->bus->error_status) {
|
||||
s->bus->dma->aiocb = NULL;
|
||||
return;
|
||||
}
|
||||
goto eot;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/input/ps2.c
|
||||
ps2_put_keycode(void *opaque, int keycode) "%p keycode %d"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/intc/apic_common.c
|
||||
cpu_set_apic_base(uint64_t val) "%016"PRIx64
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/isa/pc87312.c
|
||||
pc87312_io_read(uint32_t addr, uint32_t val) "read addr=%x val=%x"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/misc/eccmemctl.c
|
||||
ecc_mem_writel_mer(uint32_t val) "Write memory enable %08x"
|
||||
|
||||
+1
-7
@@ -69,7 +69,6 @@ typedef struct E1000EState {
|
||||
uint16_t subsys_ven_used;
|
||||
uint16_t subsys_used;
|
||||
|
||||
uint32_t intr_state;
|
||||
bool disable_vnet;
|
||||
|
||||
E1000ECore core;
|
||||
@@ -89,8 +88,6 @@ typedef struct E1000EState {
|
||||
#define E1000E_MSIX_TABLE (0x0000)
|
||||
#define E1000E_MSIX_PBA (0x2000)
|
||||
|
||||
#define E1000E_USE_MSIX BIT(0)
|
||||
|
||||
static uint64_t
|
||||
e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size)
|
||||
{
|
||||
@@ -302,8 +299,6 @@ e1000e_init_msix(E1000EState *s)
|
||||
} else {
|
||||
if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) {
|
||||
msix_uninit(d, &s->msix, &s->msix);
|
||||
} else {
|
||||
s->intr_state |= E1000E_USE_MSIX;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -311,7 +306,7 @@ e1000e_init_msix(E1000EState *s)
|
||||
static void
|
||||
e1000e_cleanup_msix(E1000EState *s)
|
||||
{
|
||||
if (s->intr_state & E1000E_USE_MSIX) {
|
||||
if (msix_enabled(PCI_DEVICE(s))) {
|
||||
e1000e_unuse_msix_vectors(s, E1000E_MSIX_VEC_NUM);
|
||||
msix_uninit(PCI_DEVICE(s), &s->msix, &s->msix);
|
||||
}
|
||||
@@ -601,7 +596,6 @@ static const VMStateDescription e1000e_vmstate = {
|
||||
VMSTATE_MSIX(parent_obj, E1000EState),
|
||||
|
||||
VMSTATE_UINT32(ioaddr, E1000EState),
|
||||
VMSTATE_UINT32(intr_state, E1000EState),
|
||||
VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
|
||||
VMSTATE_UINT8(core.rx_desc_len, E1000EState),
|
||||
VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
|
||||
|
||||
+3
-4
@@ -65,10 +65,9 @@ void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev,
|
||||
|
||||
p->pci_dev = pci_dev;
|
||||
|
||||
p->vec = g_malloc((sizeof *p->vec) *
|
||||
(max_frags + NET_TX_PKT_PL_START_FRAG));
|
||||
p->vec = g_new(struct iovec, max_frags + NET_TX_PKT_PL_START_FRAG);
|
||||
|
||||
p->raw = g_malloc((sizeof *p->raw) * max_frags);
|
||||
p->raw = g_new(struct iovec, max_frags);
|
||||
|
||||
p->max_payload_frags = max_frags;
|
||||
p->max_raw_frags = max_frags;
|
||||
@@ -590,7 +589,7 @@ static bool net_tx_pkt_do_sw_fragmentation(struct NetTxPkt *pkt,
|
||||
|
||||
fragment_offset += fragment_len;
|
||||
|
||||
} while (more_frags);
|
||||
} while (fragment_len && more_frags);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/net/lance.c
|
||||
lance_mem_readw(uint64_t addr, uint32_t ret) "addr=%"PRIx64"val=0x%04x"
|
||||
|
||||
+1
-1
@@ -428,7 +428,7 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
|
||||
|
||||
nc->vring_enable = enable;
|
||||
|
||||
if (vhost_ops->vhost_set_vring_enable) {
|
||||
if (vhost_ops && vhost_ops->vhost_set_vring_enable) {
|
||||
return vhost_ops->vhost_set_vring_enable(&net->dev, enable);
|
||||
}
|
||||
|
||||
|
||||
@@ -1167,6 +1167,10 @@ vmxnet3_io_bar0_write(void *opaque, hwaddr addr,
|
||||
{
|
||||
VMXNET3State *s = opaque;
|
||||
|
||||
if (!s->device_active) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (VMW_IS_MULTIREG_ADDR(addr, VMXNET3_REG_TXPROD,
|
||||
VMXNET3_DEVICE_MAX_TX_QUEUES, VMXNET3_REG_ALIGN)) {
|
||||
int tx_queue_idx =
|
||||
|
||||
@@ -197,6 +197,10 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size)
|
||||
}
|
||||
|
||||
D(qemu_log("%s %zd rxbase=%x\n", __func__, size, rxbase));
|
||||
if (size > (R_MAX - R_RX_BUF0 - rxbase) * 4) {
|
||||
D(qemu_log("ethlite packet is too big, size=%x\n", size));
|
||||
return -1;
|
||||
}
|
||||
memcpy(&s->regs[rxbase + R_RX_BUF0], buf, size);
|
||||
|
||||
s->regs[rxbase + R_RX_CTRL0] |= CTRL_S;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/nvram/ds1225y.c
|
||||
nvram_read(uint32_t addr, uint32_t ret) "read addr %d: 0x%02x"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/pci/pci.c
|
||||
pci_update_mappings_del(void *d, uint32_t bus, uint32_t slot, uint32_t func, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,%#"PRIx64"+%#"PRIx64
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "hw/timer/m48t59.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/loader.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "kvm_ppc.h"
|
||||
@@ -1350,3 +1351,28 @@ PowerPCCPU *ppc_get_vcpu_by_dt_id(int cpu_dt_id)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ppc_cpu_parse_features(const char *cpu_model)
|
||||
{
|
||||
CPUClass *cc;
|
||||
ObjectClass *oc;
|
||||
const char *typename;
|
||||
gchar **model_pieces;
|
||||
|
||||
model_pieces = g_strsplit(cpu_model, ",", 2);
|
||||
if (!model_pieces[0]) {
|
||||
error_report("Invalid/empty CPU model name");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
oc = cpu_class_by_name(TYPE_POWERPC_CPU, model_pieces[0]);
|
||||
if (oc == NULL) {
|
||||
error_report("Unable to find CPU definition: %s", model_pieces[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
typename = object_class_get_name(oc);
|
||||
cc = CPU_CLASS(oc);
|
||||
cc->parse_features(typename, model_pieces[1], &error_fatal);
|
||||
g_strfreev(model_pieces);
|
||||
}
|
||||
+8
-9
@@ -1812,9 +1812,16 @@ static void ppc_spapr_init(MachineState *machine)
|
||||
machine->cpu_model = kvm_enabled() ? "host" : "POWER7";
|
||||
}
|
||||
|
||||
ppc_cpu_parse_features(machine->cpu_model);
|
||||
|
||||
if (mc->query_hotpluggable_cpus) {
|
||||
char *type = spapr_get_cpu_core_type(machine->cpu_model);
|
||||
|
||||
if (type == NULL) {
|
||||
error_report("Unable to find sPAPR CPU Core definition");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
spapr->cores = g_new0(Object *, spapr_max_cores);
|
||||
for (i = 0; i < spapr_max_cores; i++) {
|
||||
int core_id = i * smp_threads;
|
||||
@@ -1826,15 +1833,7 @@ static void ppc_spapr_init(MachineState *machine)
|
||||
qemu_register_reset(spapr_drc_reset, drc);
|
||||
|
||||
if (i < spapr_cores) {
|
||||
char *type = spapr_get_cpu_core_type(machine->cpu_model);
|
||||
Object *core;
|
||||
|
||||
if (!object_class_by_name(type)) {
|
||||
error_report("Unable to find sPAPR CPU Core definition");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
core = object_new(type);
|
||||
Object *core = object_new(type);
|
||||
object_property_set_int(core, smp_threads, "nr-threads",
|
||||
&error_fatal);
|
||||
object_property_set_int(core, core_id, CPU_CORE_PROP_CORE_ID,
|
||||
|
||||
+21
-17
@@ -93,6 +93,19 @@ char *spapr_get_cpu_core_type(const char *model)
|
||||
|
||||
core_type = g_strdup_printf("%s-%s", model_pieces[0], TYPE_SPAPR_CPU_CORE);
|
||||
g_strfreev(model_pieces);
|
||||
|
||||
/* Check whether it exists or whether we have to look up an alias name */
|
||||
if (!object_class_by_name(core_type)) {
|
||||
const char *realmodel;
|
||||
|
||||
g_free(core_type);
|
||||
realmodel = ppc_cpu_lookup_alias(model);
|
||||
if (realmodel) {
|
||||
return spapr_get_cpu_core_type(realmodel);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return core_type;
|
||||
}
|
||||
|
||||
@@ -354,41 +367,32 @@ typedef struct SPAPRCoreInfo {
|
||||
} SPAPRCoreInfo;
|
||||
|
||||
static const SPAPRCoreInfo spapr_cores[] = {
|
||||
/* 970 and aliaes */
|
||||
/* 970 */
|
||||
{ .name = "970_v2.2", .initfn = spapr_cpu_core_970_initfn },
|
||||
{ .name = "970", .initfn = spapr_cpu_core_970_initfn },
|
||||
|
||||
/* 970MP variants and aliases */
|
||||
/* 970MP variants */
|
||||
{ .name = "970MP_v1.0", .initfn = spapr_cpu_core_970MP_v10_initfn },
|
||||
{ .name = "970mp_v1.0", .initfn = spapr_cpu_core_970MP_v10_initfn },
|
||||
{ .name = "970MP_v1.1", .initfn = spapr_cpu_core_970MP_v11_initfn },
|
||||
{ .name = "970mp_v1.1", .initfn = spapr_cpu_core_970MP_v11_initfn },
|
||||
{ .name = "970mp", .initfn = spapr_cpu_core_970MP_v11_initfn },
|
||||
|
||||
/* POWER5 and aliases */
|
||||
/* POWER5+ */
|
||||
{ .name = "POWER5+_v2.1", .initfn = spapr_cpu_core_POWER5plus_initfn },
|
||||
{ .name = "POWER5+", .initfn = spapr_cpu_core_POWER5plus_initfn },
|
||||
|
||||
/* POWER7 and aliases */
|
||||
/* POWER7 */
|
||||
{ .name = "POWER7_v2.3", .initfn = spapr_cpu_core_POWER7_initfn },
|
||||
{ .name = "POWER7", .initfn = spapr_cpu_core_POWER7_initfn },
|
||||
|
||||
/* POWER7+ and aliases */
|
||||
/* POWER7+ */
|
||||
{ .name = "POWER7+_v2.1", .initfn = spapr_cpu_core_POWER7plus_initfn },
|
||||
{ .name = "POWER7+", .initfn = spapr_cpu_core_POWER7plus_initfn },
|
||||
|
||||
/* POWER8 and aliases */
|
||||
/* POWER8 */
|
||||
{ .name = "POWER8_v2.0", .initfn = spapr_cpu_core_POWER8_initfn },
|
||||
{ .name = "POWER8", .initfn = spapr_cpu_core_POWER8_initfn },
|
||||
{ .name = "power8", .initfn = spapr_cpu_core_POWER8_initfn },
|
||||
|
||||
/* POWER8E and aliases */
|
||||
/* POWER8E */
|
||||
{ .name = "POWER8E_v2.1", .initfn = spapr_cpu_core_POWER8E_initfn },
|
||||
{ .name = "POWER8E", .initfn = spapr_cpu_core_POWER8E_initfn },
|
||||
|
||||
/* POWER8NVL and aliases */
|
||||
/* POWER8NVL */
|
||||
{ .name = "POWER8NVL_v1.0", .initfn = spapr_cpu_core_POWER8NVL_initfn },
|
||||
{ .name = "POWER8NVL", .initfn = spapr_cpu_core_POWER8NVL_initfn },
|
||||
|
||||
{ .name = NULL }
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/ppc/spapr_pci.c
|
||||
spapr_pci_msi(const char *msg, uint32_t ca) "%s (cfg=%x)"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/s390x/css.c
|
||||
css_enable_facility(const char *facility) "CSS: enable %s"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/scsi/scsi-bus.c
|
||||
scsi_req_alloc(int target, int lun, int tag) "target %d lun %d tag %d"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/sd/milkymist-memcard.c
|
||||
milkymist_memcard_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/sparc/sun4m.c
|
||||
sun4m_cpu_interrupt(unsigned int level) "Set CPU IRQ %d"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/timer/slavio_timer.c
|
||||
slavio_timer_get_out(uint64_t limit, uint32_t counthigh, uint32_t count) "limit %"PRIx64" count %x%08x"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/usb/core.c
|
||||
usb_packet_state_change(int bus, const char *port, int ep, void *p, const char *o, const char *n) "bus %d, port %s, ep %d, packet %p, state %s -> %s"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/vfio/pci.c
|
||||
vfio_intx_interrupt(const char *name, char line) " (%s) Pin %c"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# hw/virtio/virtio.c
|
||||
virtqueue_fill(void *vq, const void *elem, unsigned int len, unsigned int idx) "vq %p elem %p len %u idx %u"
|
||||
|
||||
@@ -31,6 +31,7 @@ enum VhostUserProtocolFeature {
|
||||
VHOST_USER_PROTOCOL_F_MQ = 0,
|
||||
VHOST_USER_PROTOCOL_F_LOG_SHMFD = 1,
|
||||
VHOST_USER_PROTOCOL_F_RARP = 2,
|
||||
VHOST_USER_PROTOCOL_F_REPLY_ACK = 3,
|
||||
|
||||
VHOST_USER_PROTOCOL_F_MAX
|
||||
};
|
||||
@@ -84,6 +85,7 @@ typedef struct VhostUserMsg {
|
||||
|
||||
#define VHOST_USER_VERSION_MASK (0x3)
|
||||
#define VHOST_USER_REPLY_MASK (0x1<<2)
|
||||
#define VHOST_USER_NEED_REPLY_MASK (0x1 << 3)
|
||||
uint32_t flags;
|
||||
uint32_t size; /* the following payload size */
|
||||
union {
|
||||
@@ -158,6 +160,25 @@ fail:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int process_message_reply(struct vhost_dev *dev,
|
||||
VhostUserRequest request)
|
||||
{
|
||||
VhostUserMsg msg;
|
||||
|
||||
if (vhost_user_read(dev, &msg) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (msg.request != request) {
|
||||
error_report("Received unexpected msg type."
|
||||
"Expected %d received %d",
|
||||
request, msg.request);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return msg.payload.u64 ? -1 : 0;
|
||||
}
|
||||
|
||||
static bool vhost_user_one_time_request(VhostUserRequest request)
|
||||
{
|
||||
switch (request) {
|
||||
@@ -248,11 +269,18 @@ static int vhost_user_set_mem_table(struct vhost_dev *dev,
|
||||
int fds[VHOST_MEMORY_MAX_NREGIONS];
|
||||
int i, fd;
|
||||
size_t fd_num = 0;
|
||||
bool reply_supported = virtio_has_feature(dev->protocol_features,
|
||||
VHOST_USER_PROTOCOL_F_REPLY_ACK);
|
||||
|
||||
VhostUserMsg msg = {
|
||||
.request = VHOST_USER_SET_MEM_TABLE,
|
||||
.flags = VHOST_USER_VERSION,
|
||||
};
|
||||
|
||||
if (reply_supported) {
|
||||
msg.flags |= VHOST_USER_NEED_REPLY_MASK;
|
||||
}
|
||||
|
||||
for (i = 0; i < dev->mem->nregions; ++i) {
|
||||
struct vhost_memory_region *reg = dev->mem->regions + i;
|
||||
ram_addr_t offset;
|
||||
@@ -288,6 +316,10 @@ static int vhost_user_set_mem_table(struct vhost_dev *dev,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (reply_supported) {
|
||||
return process_message_reply(dev, msg.request);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -268,6 +268,7 @@ void virtqueue_discard(VirtQueue *vq, const VirtQueueElement *elem,
|
||||
unsigned int len)
|
||||
{
|
||||
vq->last_avail_idx--;
|
||||
vq->inuse--;
|
||||
virtqueue_unmap_sg(vq, elem, len);
|
||||
}
|
||||
|
||||
@@ -1648,6 +1649,21 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id)
|
||||
}
|
||||
vdev->vq[i].used_idx = vring_used_idx(&vdev->vq[i]);
|
||||
vdev->vq[i].shadow_avail_idx = vring_avail_idx(&vdev->vq[i]);
|
||||
|
||||
/*
|
||||
* Some devices migrate VirtQueueElements that have been popped
|
||||
* from the avail ring but not yet returned to the used ring.
|
||||
*/
|
||||
vdev->vq[i].inuse = vdev->vq[i].last_avail_idx -
|
||||
vdev->vq[i].used_idx;
|
||||
if (vdev->vq[i].inuse > vdev->vq[i].vring.num) {
|
||||
error_report("VQ %d size 0x%x < last_avail_idx 0x%x - "
|
||||
"used_idx 0x%x",
|
||||
i, vdev->vq[i].vring.num,
|
||||
vdev->vq[i].last_avail_idx,
|
||||
vdev->vq[i].used_idx);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2049,9 +2049,8 @@ void xen_pt_config_init(XenPCIPassthroughState *s, Error **errp)
|
||||
for (j = 0; regs->size != 0; j++, regs++) {
|
||||
xen_pt_config_reg_init(s, reg_grp_entry, regs, &err);
|
||||
if (err) {
|
||||
error_append_hint(&err, "Failed to initialize %d/%zu"
|
||||
" reg 0x%x in grp_type = 0x%x (%d/%zu)",
|
||||
j, ARRAY_SIZE(xen_pt_emu_reg_grps[i].emu_regs),
|
||||
error_append_hint(&err, "Failed to init register %d"
|
||||
" offsets 0x%x in grp_type = 0x%x (%d/%zu)", j,
|
||||
regs->offset, xen_pt_emu_reg_grps[i].grp_type,
|
||||
i, ARRAY_SIZE(xen_pt_emu_reg_grps));
|
||||
error_propagate(errp, err);
|
||||
|
||||
@@ -443,8 +443,8 @@ struct BlockDriverState {
|
||||
note this is a reference count */
|
||||
|
||||
CoQueue flush_queue; /* Serializing flush queue */
|
||||
BdrvTrackedRequest *active_flush_req; /* Flush request in flight */
|
||||
unsigned int write_gen; /* Current data generation */
|
||||
unsigned int flush_started_gen; /* Generation for which flush has started */
|
||||
unsigned int flushed_gen; /* Flushed write generation */
|
||||
|
||||
BlockDriver *drv; /* NULL means no media */
|
||||
|
||||
@@ -198,7 +198,7 @@ enum {
|
||||
typedef struct float_status {
|
||||
signed char float_detect_tininess;
|
||||
signed char float_rounding_mode;
|
||||
signed char float_exception_flags;
|
||||
uint8_t float_exception_flags;
|
||||
signed char floatx80_rounding_precision;
|
||||
/* should denormalised results go to zero and set the inexact flag? */
|
||||
flag flush_to_zero;
|
||||
@@ -274,7 +274,7 @@ static inline flag get_default_nan_mode(float_status *status)
|
||||
| Routine to raise any or all of the software IEC/IEEE floating-point
|
||||
| exception flags.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void float_raise(int8_t flags, float_status *status);
|
||||
void float_raise(uint8_t flags, float_status *status);
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| If `a' is denormal and we are in flush-to-zero mode then set the
|
||||
|
||||
@@ -48,6 +48,26 @@ static inline gint64 qemu_g_get_monotonic_time(void)
|
||||
gint g_poll_fixed(GPollFD *fds, guint nfds, gint timeout);
|
||||
#endif
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2, 30, 0)
|
||||
/* Not a 100% compatible implementation, but good enough for most
|
||||
* cases. Placeholders are only supported at the end of the
|
||||
* template. */
|
||||
static inline gchar *qemu_g_dir_make_tmp(gchar const *tmpl, GError **error)
|
||||
{
|
||||
gchar *path = g_build_filename(g_get_tmp_dir(), tmpl ?: ".XXXXXX", NULL);
|
||||
|
||||
if (mkdtemp(path) != NULL) {
|
||||
return path;
|
||||
}
|
||||
/* Error occurred, clean up. */
|
||||
g_set_error(error, G_FILE_ERROR, g_file_error_from_errno(errno),
|
||||
"mkdtemp() failed");
|
||||
g_free(path);
|
||||
return NULL;
|
||||
}
|
||||
#define g_dir_make_tmp(tmpl, error) qemu_g_dir_make_tmp(tmpl, error)
|
||||
#endif /* glib 2.30 */
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2, 31, 0)
|
||||
/* before glib-2.31, GMutex and GCond was dynamic-only (there was a separate
|
||||
* GStaticMutex, but it didn't work with condition variables).
|
||||
|
||||
@@ -106,4 +106,5 @@ enum {
|
||||
/* ppc_booke.c */
|
||||
void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags);
|
||||
|
||||
void ppc_cpu_parse_features(const char *cpu_model);
|
||||
#endif
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "ui/console.h"
|
||||
#include "hw/virtio/virtio.h"
|
||||
#include "hw/pci/pci.h"
|
||||
#include "qemu/log.h"
|
||||
|
||||
#include "standard-headers/linux/virtio_gpu.h"
|
||||
#define TYPE_VIRTIO_GPU "virtio-gpu-device"
|
||||
|
||||
+90
-35
@@ -107,6 +107,44 @@ static inline int xen_get_vmport_regs_pfn(xc_interface *xc, domid_t dom,
|
||||
|
||||
#endif
|
||||
|
||||
static inline int xen_get_default_ioreq_server_info(xc_interface *xc,
|
||||
domid_t dom,
|
||||
xen_pfn_t *ioreq_pfn,
|
||||
xen_pfn_t *bufioreq_pfn,
|
||||
evtchn_port_t
|
||||
*bufioreq_evtchn)
|
||||
{
|
||||
unsigned long param;
|
||||
int rc;
|
||||
|
||||
rc = xc_get_hvm_param(xc, dom, HVM_PARAM_IOREQ_PFN, ¶m);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "failed to get HVM_PARAM_IOREQ_PFN\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
*ioreq_pfn = param;
|
||||
|
||||
rc = xc_get_hvm_param(xc, dom, HVM_PARAM_BUFIOREQ_PFN, ¶m);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "failed to get HVM_PARAM_BUFIOREQ_PFN\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
*bufioreq_pfn = param;
|
||||
|
||||
rc = xc_get_hvm_param(xc, dom, HVM_PARAM_BUFIOREQ_EVTCHN,
|
||||
¶m);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "failed to get HVM_PARAM_BUFIOREQ_EVTCHN\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
*bufioreq_evtchn = param;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Xen before 4.5 */
|
||||
#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 450
|
||||
|
||||
@@ -154,10 +192,9 @@ static inline void xen_unmap_pcidev(xc_interface *xc, domid_t dom,
|
||||
{
|
||||
}
|
||||
|
||||
static inline int xen_create_ioreq_server(xc_interface *xc, domid_t dom,
|
||||
ioservid_t *ioservid)
|
||||
static inline void xen_create_ioreq_server(xc_interface *xc, domid_t dom,
|
||||
ioservid_t *ioservid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void xen_destroy_ioreq_server(xc_interface *xc, domid_t dom,
|
||||
@@ -171,35 +208,8 @@ static inline int xen_get_ioreq_server_info(xc_interface *xc, domid_t dom,
|
||||
xen_pfn_t *bufioreq_pfn,
|
||||
evtchn_port_t *bufioreq_evtchn)
|
||||
{
|
||||
unsigned long param;
|
||||
int rc;
|
||||
|
||||
rc = xc_get_hvm_param(xc, dom, HVM_PARAM_IOREQ_PFN, ¶m);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "failed to get HVM_PARAM_IOREQ_PFN\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
*ioreq_pfn = param;
|
||||
|
||||
rc = xc_get_hvm_param(xc, dom, HVM_PARAM_BUFIOREQ_PFN, ¶m);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "failed to get HVM_PARAM_BUFIOREQ_PFN\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
*bufioreq_pfn = param;
|
||||
|
||||
rc = xc_get_hvm_param(xc, dom, HVM_PARAM_BUFIOREQ_EVTCHN,
|
||||
¶m);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "failed to get HVM_PARAM_BUFIOREQ_EVTCHN\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
*bufioreq_evtchn = param;
|
||||
|
||||
return 0;
|
||||
return xen_get_default_ioreq_server_info(xc, dom, ioreq_pfn, bufioreq_pfn,
|
||||
bufioreq_evtchn);
|
||||
}
|
||||
|
||||
static inline int xen_set_ioreq_server_state(xc_interface *xc, domid_t dom,
|
||||
@@ -212,6 +222,8 @@ static inline int xen_set_ioreq_server_state(xc_interface *xc, domid_t dom,
|
||||
/* Xen 4.5 */
|
||||
#else
|
||||
|
||||
static bool use_default_ioreq_server;
|
||||
|
||||
static inline void xen_map_memory_section(xc_interface *xc, domid_t dom,
|
||||
ioservid_t ioservid,
|
||||
MemoryRegionSection *section)
|
||||
@@ -220,6 +232,10 @@ static inline void xen_map_memory_section(xc_interface *xc, domid_t dom,
|
||||
ram_addr_t size = int128_get64(section->size);
|
||||
hwaddr end_addr = start_addr + size - 1;
|
||||
|
||||
if (use_default_ioreq_server) {
|
||||
return;
|
||||
}
|
||||
|
||||
trace_xen_map_mmio_range(ioservid, start_addr, end_addr);
|
||||
xc_hvm_map_io_range_to_ioreq_server(xc, dom, ioservid, 1,
|
||||
start_addr, end_addr);
|
||||
@@ -233,6 +249,11 @@ static inline void xen_unmap_memory_section(xc_interface *xc, domid_t dom,
|
||||
ram_addr_t size = int128_get64(section->size);
|
||||
hwaddr end_addr = start_addr + size - 1;
|
||||
|
||||
if (use_default_ioreq_server) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
trace_xen_unmap_mmio_range(ioservid, start_addr, end_addr);
|
||||
xc_hvm_unmap_io_range_from_ioreq_server(xc, dom, ioservid, 1,
|
||||
start_addr, end_addr);
|
||||
@@ -246,6 +267,11 @@ static inline void xen_map_io_section(xc_interface *xc, domid_t dom,
|
||||
ram_addr_t size = int128_get64(section->size);
|
||||
hwaddr end_addr = start_addr + size - 1;
|
||||
|
||||
if (use_default_ioreq_server) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
trace_xen_map_portio_range(ioservid, start_addr, end_addr);
|
||||
xc_hvm_map_io_range_to_ioreq_server(xc, dom, ioservid, 0,
|
||||
start_addr, end_addr);
|
||||
@@ -259,6 +285,10 @@ static inline void xen_unmap_io_section(xc_interface *xc, domid_t dom,
|
||||
ram_addr_t size = int128_get64(section->size);
|
||||
hwaddr end_addr = start_addr + size - 1;
|
||||
|
||||
if (use_default_ioreq_server) {
|
||||
return;
|
||||
}
|
||||
|
||||
trace_xen_unmap_portio_range(ioservid, start_addr, end_addr);
|
||||
xc_hvm_unmap_io_range_from_ioreq_server(xc, dom, ioservid, 0,
|
||||
start_addr, end_addr);
|
||||
@@ -268,6 +298,10 @@ static inline void xen_map_pcidev(xc_interface *xc, domid_t dom,
|
||||
ioservid_t ioservid,
|
||||
PCIDevice *pci_dev)
|
||||
{
|
||||
if (use_default_ioreq_server) {
|
||||
return;
|
||||
}
|
||||
|
||||
trace_xen_map_pcidev(ioservid, pci_bus_num(pci_dev->bus),
|
||||
PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn));
|
||||
xc_hvm_map_pcidev_to_ioreq_server(xc, dom, ioservid,
|
||||
@@ -280,6 +314,10 @@ static inline void xen_unmap_pcidev(xc_interface *xc, domid_t dom,
|
||||
ioservid_t ioservid,
|
||||
PCIDevice *pci_dev)
|
||||
{
|
||||
if (use_default_ioreq_server) {
|
||||
return;
|
||||
}
|
||||
|
||||
trace_xen_unmap_pcidev(ioservid, pci_bus_num(pci_dev->bus),
|
||||
PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn));
|
||||
xc_hvm_unmap_pcidev_from_ioreq_server(xc, dom, ioservid,
|
||||
@@ -288,22 +326,29 @@ static inline void xen_unmap_pcidev(xc_interface *xc, domid_t dom,
|
||||
PCI_FUNC(pci_dev->devfn));
|
||||
}
|
||||
|
||||
static inline int xen_create_ioreq_server(xc_interface *xc, domid_t dom,
|
||||
ioservid_t *ioservid)
|
||||
static inline void xen_create_ioreq_server(xc_interface *xc, domid_t dom,
|
||||
ioservid_t *ioservid)
|
||||
{
|
||||
int rc = xc_hvm_create_ioreq_server(xc, dom, HVM_IOREQSRV_BUFIOREQ_ATOMIC,
|
||||
ioservid);
|
||||
|
||||
if (rc == 0) {
|
||||
trace_xen_ioreq_server_create(*ioservid);
|
||||
return;
|
||||
}
|
||||
|
||||
return rc;
|
||||
*ioservid = 0;
|
||||
use_default_ioreq_server = true;
|
||||
trace_xen_default_ioreq_server();
|
||||
}
|
||||
|
||||
static inline void xen_destroy_ioreq_server(xc_interface *xc, domid_t dom,
|
||||
ioservid_t ioservid)
|
||||
{
|
||||
if (use_default_ioreq_server) {
|
||||
return;
|
||||
}
|
||||
|
||||
trace_xen_ioreq_server_destroy(ioservid);
|
||||
xc_hvm_destroy_ioreq_server(xc, dom, ioservid);
|
||||
}
|
||||
@@ -314,6 +359,12 @@ static inline int xen_get_ioreq_server_info(xc_interface *xc, domid_t dom,
|
||||
xen_pfn_t *bufioreq_pfn,
|
||||
evtchn_port_t *bufioreq_evtchn)
|
||||
{
|
||||
if (use_default_ioreq_server) {
|
||||
return xen_get_default_ioreq_server_info(xc, dom, ioreq_pfn,
|
||||
bufioreq_pfn,
|
||||
bufioreq_evtchn);
|
||||
}
|
||||
|
||||
return xc_hvm_get_ioreq_server_info(xc, dom, ioservid,
|
||||
ioreq_pfn, bufioreq_pfn,
|
||||
bufioreq_evtchn);
|
||||
@@ -323,6 +374,10 @@ static inline int xen_set_ioreq_server_state(xc_interface *xc, domid_t dom,
|
||||
ioservid_t ioservid,
|
||||
bool enable)
|
||||
{
|
||||
if (use_default_ioreq_server) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
trace_xen_ioreq_server_state(ioservid, enable);
|
||||
return xc_hvm_set_ioreq_server_state(xc, dom, ioservid, enable);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
|
||||
#include "qemu/option.h"
|
||||
|
||||
/* Copyright string for -version arguments, About dialogs, etc */
|
||||
#define QEMU_COPYRIGHT "Copyright (c) 2003-2016 " \
|
||||
"Fabrice Bellard and the QEMU Project developers"
|
||||
|
||||
/* main function, renamed */
|
||||
#if defined(CONFIG_COCOA)
|
||||
int qemu_main(int argc, char **argv, char **envp);
|
||||
|
||||
+48
-6
@@ -18,6 +18,48 @@
|
||||
/* Compiler barrier */
|
||||
#define barrier() ({ asm volatile("" ::: "memory"); (void)0; })
|
||||
|
||||
/* The variable that receives the old value of an atomically-accessed
|
||||
* variable must be non-qualified, because atomic builtins return values
|
||||
* through a pointer-type argument as in __atomic_load(&var, &old, MODEL).
|
||||
*
|
||||
* This macro has to handle types smaller than int manually, because of
|
||||
* implicit promotion. int and larger types, as well as pointers, can be
|
||||
* converted to a non-qualified type just by applying a binary operator.
|
||||
*/
|
||||
#define typeof_strip_qual(expr) \
|
||||
typeof( \
|
||||
__builtin_choose_expr( \
|
||||
__builtin_types_compatible_p(typeof(expr), bool) || \
|
||||
__builtin_types_compatible_p(typeof(expr), const bool) || \
|
||||
__builtin_types_compatible_p(typeof(expr), volatile bool) || \
|
||||
__builtin_types_compatible_p(typeof(expr), const volatile bool), \
|
||||
(bool)1, \
|
||||
__builtin_choose_expr( \
|
||||
__builtin_types_compatible_p(typeof(expr), signed char) || \
|
||||
__builtin_types_compatible_p(typeof(expr), const signed char) || \
|
||||
__builtin_types_compatible_p(typeof(expr), volatile signed char) || \
|
||||
__builtin_types_compatible_p(typeof(expr), const volatile signed char), \
|
||||
(signed char)1, \
|
||||
__builtin_choose_expr( \
|
||||
__builtin_types_compatible_p(typeof(expr), unsigned char) || \
|
||||
__builtin_types_compatible_p(typeof(expr), const unsigned char) || \
|
||||
__builtin_types_compatible_p(typeof(expr), volatile unsigned char) || \
|
||||
__builtin_types_compatible_p(typeof(expr), const volatile unsigned char), \
|
||||
(unsigned char)1, \
|
||||
__builtin_choose_expr( \
|
||||
__builtin_types_compatible_p(typeof(expr), signed short) || \
|
||||
__builtin_types_compatible_p(typeof(expr), const signed short) || \
|
||||
__builtin_types_compatible_p(typeof(expr), volatile signed short) || \
|
||||
__builtin_types_compatible_p(typeof(expr), const volatile signed short), \
|
||||
(signed short)1, \
|
||||
__builtin_choose_expr( \
|
||||
__builtin_types_compatible_p(typeof(expr), unsigned short) || \
|
||||
__builtin_types_compatible_p(typeof(expr), const unsigned short) || \
|
||||
__builtin_types_compatible_p(typeof(expr), volatile unsigned short) || \
|
||||
__builtin_types_compatible_p(typeof(expr), const volatile unsigned short), \
|
||||
(unsigned short)1, \
|
||||
(expr)+0))))))
|
||||
|
||||
#ifdef __ATOMIC_RELAXED
|
||||
/* For C11 atomic ops */
|
||||
|
||||
@@ -54,7 +96,7 @@
|
||||
#define atomic_read(ptr) \
|
||||
({ \
|
||||
QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \
|
||||
typeof(*ptr) _val; \
|
||||
typeof_strip_qual(*ptr) _val; \
|
||||
__atomic_load(ptr, &_val, __ATOMIC_RELAXED); \
|
||||
_val; \
|
||||
})
|
||||
@@ -80,7 +122,7 @@
|
||||
#define atomic_rcu_read(ptr) \
|
||||
({ \
|
||||
QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \
|
||||
typeof(*ptr) _val; \
|
||||
typeof_strip_qual(*ptr) _val; \
|
||||
atomic_rcu_read__nocheck(ptr, &_val); \
|
||||
_val; \
|
||||
})
|
||||
@@ -103,7 +145,7 @@
|
||||
#define atomic_mb_read(ptr) \
|
||||
({ \
|
||||
QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \
|
||||
typeof(*ptr) _val; \
|
||||
typeof_strip_qual(*ptr) _val; \
|
||||
__atomic_load(ptr, &_val, __ATOMIC_RELAXED); \
|
||||
smp_rmb(); \
|
||||
_val; \
|
||||
@@ -120,7 +162,7 @@
|
||||
#define atomic_mb_read(ptr) \
|
||||
({ \
|
||||
QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \
|
||||
typeof(*ptr) _val; \
|
||||
typeof_strip_qual(*ptr) _val; \
|
||||
__atomic_load(ptr, &_val, __ATOMIC_SEQ_CST); \
|
||||
_val; \
|
||||
})
|
||||
@@ -137,7 +179,7 @@
|
||||
|
||||
#define atomic_xchg(ptr, i) ({ \
|
||||
QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \
|
||||
typeof(*ptr) _new = (i), _old; \
|
||||
typeof_strip_qual(*ptr) _new = (i), _old; \
|
||||
__atomic_exchange(ptr, &_new, &_old, __ATOMIC_SEQ_CST); \
|
||||
_old; \
|
||||
})
|
||||
@@ -146,7 +188,7 @@
|
||||
#define atomic_cmpxchg(ptr, old, new) \
|
||||
({ \
|
||||
QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \
|
||||
typeof(*ptr) _old = (old), _new = (new); \
|
||||
typeof_strip_qual(*ptr) _old = (old), _new = (new); \
|
||||
__atomic_compare_exchange(ptr, &_old, &_new, false, \
|
||||
__ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); \
|
||||
_old; \
|
||||
|
||||
@@ -42,8 +42,11 @@ int qemu_spice_set_pw_expire(time_t expires);
|
||||
int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
|
||||
const char *subject);
|
||||
|
||||
#define SPICE_NEEDS_SET_MM_TIME \
|
||||
(!defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06))
|
||||
#if !defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06)
|
||||
#define SPICE_NEEDS_SET_MM_TIME 1
|
||||
#else
|
||||
#define SPICE_NEEDS_SET_MM_TIME 0
|
||||
#endif
|
||||
|
||||
#if SPICE_SERVER_VERSION >= 0x000c02
|
||||
void qemu_spice_register_ports(void);
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# io/buffer.c
|
||||
buffer_resize(const char *buf, size_t olen, size_t len) "%s: old %zd, new %zd"
|
||||
|
||||
+1
-1
@@ -4000,7 +4000,7 @@ static void handle_arg_strace(const char *arg)
|
||||
static void handle_arg_version(const char *arg)
|
||||
{
|
||||
printf("qemu-" TARGET_NAME " version " QEMU_VERSION QEMU_PKGVERSION
|
||||
", Copyright (c) 2003-2008 Fabrice Bellard\n");
|
||||
", " QEMU_COPYRIGHT "\n");
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
+265
-110
@@ -289,6 +289,161 @@ static bitmask_transtbl fcntl_flags_tbl[] = {
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
enum {
|
||||
QEMU_IFLA_BR_UNSPEC,
|
||||
QEMU_IFLA_BR_FORWARD_DELAY,
|
||||
QEMU_IFLA_BR_HELLO_TIME,
|
||||
QEMU_IFLA_BR_MAX_AGE,
|
||||
QEMU_IFLA_BR_AGEING_TIME,
|
||||
QEMU_IFLA_BR_STP_STATE,
|
||||
QEMU_IFLA_BR_PRIORITY,
|
||||
QEMU_IFLA_BR_VLAN_FILTERING,
|
||||
QEMU_IFLA_BR_VLAN_PROTOCOL,
|
||||
QEMU_IFLA_BR_GROUP_FWD_MASK,
|
||||
QEMU_IFLA_BR_ROOT_ID,
|
||||
QEMU_IFLA_BR_BRIDGE_ID,
|
||||
QEMU_IFLA_BR_ROOT_PORT,
|
||||
QEMU_IFLA_BR_ROOT_PATH_COST,
|
||||
QEMU_IFLA_BR_TOPOLOGY_CHANGE,
|
||||
QEMU_IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
|
||||
QEMU_IFLA_BR_HELLO_TIMER,
|
||||
QEMU_IFLA_BR_TCN_TIMER,
|
||||
QEMU_IFLA_BR_TOPOLOGY_CHANGE_TIMER,
|
||||
QEMU_IFLA_BR_GC_TIMER,
|
||||
QEMU_IFLA_BR_GROUP_ADDR,
|
||||
QEMU_IFLA_BR_FDB_FLUSH,
|
||||
QEMU_IFLA_BR_MCAST_ROUTER,
|
||||
QEMU_IFLA_BR_MCAST_SNOOPING,
|
||||
QEMU_IFLA_BR_MCAST_QUERY_USE_IFADDR,
|
||||
QEMU_IFLA_BR_MCAST_QUERIER,
|
||||
QEMU_IFLA_BR_MCAST_HASH_ELASTICITY,
|
||||
QEMU_IFLA_BR_MCAST_HASH_MAX,
|
||||
QEMU_IFLA_BR_MCAST_LAST_MEMBER_CNT,
|
||||
QEMU_IFLA_BR_MCAST_STARTUP_QUERY_CNT,
|
||||
QEMU_IFLA_BR_MCAST_LAST_MEMBER_INTVL,
|
||||
QEMU_IFLA_BR_MCAST_MEMBERSHIP_INTVL,
|
||||
QEMU_IFLA_BR_MCAST_QUERIER_INTVL,
|
||||
QEMU_IFLA_BR_MCAST_QUERY_INTVL,
|
||||
QEMU_IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
|
||||
QEMU_IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
|
||||
QEMU_IFLA_BR_NF_CALL_IPTABLES,
|
||||
QEMU_IFLA_BR_NF_CALL_IP6TABLES,
|
||||
QEMU_IFLA_BR_NF_CALL_ARPTABLES,
|
||||
QEMU_IFLA_BR_VLAN_DEFAULT_PVID,
|
||||
QEMU_IFLA_BR_PAD,
|
||||
QEMU_IFLA_BR_VLAN_STATS_ENABLED,
|
||||
QEMU_IFLA_BR_MCAST_STATS_ENABLED,
|
||||
QEMU___IFLA_BR_MAX,
|
||||
};
|
||||
|
||||
enum {
|
||||
QEMU_IFLA_UNSPEC,
|
||||
QEMU_IFLA_ADDRESS,
|
||||
QEMU_IFLA_BROADCAST,
|
||||
QEMU_IFLA_IFNAME,
|
||||
QEMU_IFLA_MTU,
|
||||
QEMU_IFLA_LINK,
|
||||
QEMU_IFLA_QDISC,
|
||||
QEMU_IFLA_STATS,
|
||||
QEMU_IFLA_COST,
|
||||
QEMU_IFLA_PRIORITY,
|
||||
QEMU_IFLA_MASTER,
|
||||
QEMU_IFLA_WIRELESS,
|
||||
QEMU_IFLA_PROTINFO,
|
||||
QEMU_IFLA_TXQLEN,
|
||||
QEMU_IFLA_MAP,
|
||||
QEMU_IFLA_WEIGHT,
|
||||
QEMU_IFLA_OPERSTATE,
|
||||
QEMU_IFLA_LINKMODE,
|
||||
QEMU_IFLA_LINKINFO,
|
||||
QEMU_IFLA_NET_NS_PID,
|
||||
QEMU_IFLA_IFALIAS,
|
||||
QEMU_IFLA_NUM_VF,
|
||||
QEMU_IFLA_VFINFO_LIST,
|
||||
QEMU_IFLA_STATS64,
|
||||
QEMU_IFLA_VF_PORTS,
|
||||
QEMU_IFLA_PORT_SELF,
|
||||
QEMU_IFLA_AF_SPEC,
|
||||
QEMU_IFLA_GROUP,
|
||||
QEMU_IFLA_NET_NS_FD,
|
||||
QEMU_IFLA_EXT_MASK,
|
||||
QEMU_IFLA_PROMISCUITY,
|
||||
QEMU_IFLA_NUM_TX_QUEUES,
|
||||
QEMU_IFLA_NUM_RX_QUEUES,
|
||||
QEMU_IFLA_CARRIER,
|
||||
QEMU_IFLA_PHYS_PORT_ID,
|
||||
QEMU_IFLA_CARRIER_CHANGES,
|
||||
QEMU_IFLA_PHYS_SWITCH_ID,
|
||||
QEMU_IFLA_LINK_NETNSID,
|
||||
QEMU_IFLA_PHYS_PORT_NAME,
|
||||
QEMU_IFLA_PROTO_DOWN,
|
||||
QEMU_IFLA_GSO_MAX_SEGS,
|
||||
QEMU_IFLA_GSO_MAX_SIZE,
|
||||
QEMU_IFLA_PAD,
|
||||
QEMU_IFLA_XDP,
|
||||
QEMU___IFLA_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
QEMU_IFLA_BRPORT_UNSPEC,
|
||||
QEMU_IFLA_BRPORT_STATE,
|
||||
QEMU_IFLA_BRPORT_PRIORITY,
|
||||
QEMU_IFLA_BRPORT_COST,
|
||||
QEMU_IFLA_BRPORT_MODE,
|
||||
QEMU_IFLA_BRPORT_GUARD,
|
||||
QEMU_IFLA_BRPORT_PROTECT,
|
||||
QEMU_IFLA_BRPORT_FAST_LEAVE,
|
||||
QEMU_IFLA_BRPORT_LEARNING,
|
||||
QEMU_IFLA_BRPORT_UNICAST_FLOOD,
|
||||
QEMU_IFLA_BRPORT_PROXYARP,
|
||||
QEMU_IFLA_BRPORT_LEARNING_SYNC,
|
||||
QEMU_IFLA_BRPORT_PROXYARP_WIFI,
|
||||
QEMU_IFLA_BRPORT_ROOT_ID,
|
||||
QEMU_IFLA_BRPORT_BRIDGE_ID,
|
||||
QEMU_IFLA_BRPORT_DESIGNATED_PORT,
|
||||
QEMU_IFLA_BRPORT_DESIGNATED_COST,
|
||||
QEMU_IFLA_BRPORT_ID,
|
||||
QEMU_IFLA_BRPORT_NO,
|
||||
QEMU_IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
|
||||
QEMU_IFLA_BRPORT_CONFIG_PENDING,
|
||||
QEMU_IFLA_BRPORT_MESSAGE_AGE_TIMER,
|
||||
QEMU_IFLA_BRPORT_FORWARD_DELAY_TIMER,
|
||||
QEMU_IFLA_BRPORT_HOLD_TIMER,
|
||||
QEMU_IFLA_BRPORT_FLUSH,
|
||||
QEMU_IFLA_BRPORT_MULTICAST_ROUTER,
|
||||
QEMU_IFLA_BRPORT_PAD,
|
||||
QEMU___IFLA_BRPORT_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
QEMU_IFLA_INFO_UNSPEC,
|
||||
QEMU_IFLA_INFO_KIND,
|
||||
QEMU_IFLA_INFO_DATA,
|
||||
QEMU_IFLA_INFO_XSTATS,
|
||||
QEMU_IFLA_INFO_SLAVE_KIND,
|
||||
QEMU_IFLA_INFO_SLAVE_DATA,
|
||||
QEMU___IFLA_INFO_MAX,
|
||||
};
|
||||
|
||||
enum {
|
||||
QEMU_IFLA_INET_UNSPEC,
|
||||
QEMU_IFLA_INET_CONF,
|
||||
QEMU___IFLA_INET_MAX,
|
||||
};
|
||||
|
||||
enum {
|
||||
QEMU_IFLA_INET6_UNSPEC,
|
||||
QEMU_IFLA_INET6_FLAGS,
|
||||
QEMU_IFLA_INET6_CONF,
|
||||
QEMU_IFLA_INET6_STATS,
|
||||
QEMU_IFLA_INET6_MCAST,
|
||||
QEMU_IFLA_INET6_CACHEINFO,
|
||||
QEMU_IFLA_INET6_ICMP6STATS,
|
||||
QEMU_IFLA_INET6_TOKEN,
|
||||
QEMU_IFLA_INET6_ADDR_GEN_MODE,
|
||||
QEMU___IFLA_INET6_MAX
|
||||
};
|
||||
|
||||
typedef abi_long (*TargetFdDataFunc)(void *, size_t);
|
||||
typedef abi_long (*TargetFdAddrFunc)(void *, abi_ulong, socklen_t);
|
||||
typedef struct TargetFdTrans {
|
||||
@@ -1784,66 +1939,66 @@ static abi_long host_to_target_data_bridge_nlattr(struct nlattr *nlattr,
|
||||
|
||||
switch (nlattr->nla_type) {
|
||||
/* no data */
|
||||
case IFLA_BR_FDB_FLUSH:
|
||||
case QEMU_IFLA_BR_FDB_FLUSH:
|
||||
break;
|
||||
/* binary */
|
||||
case IFLA_BR_GROUP_ADDR:
|
||||
case QEMU_IFLA_BR_GROUP_ADDR:
|
||||
break;
|
||||
/* uint8_t */
|
||||
case IFLA_BR_VLAN_FILTERING:
|
||||
case IFLA_BR_TOPOLOGY_CHANGE:
|
||||
case IFLA_BR_TOPOLOGY_CHANGE_DETECTED:
|
||||
case IFLA_BR_MCAST_ROUTER:
|
||||
case IFLA_BR_MCAST_SNOOPING:
|
||||
case IFLA_BR_MCAST_QUERY_USE_IFADDR:
|
||||
case IFLA_BR_MCAST_QUERIER:
|
||||
case IFLA_BR_NF_CALL_IPTABLES:
|
||||
case IFLA_BR_NF_CALL_IP6TABLES:
|
||||
case IFLA_BR_NF_CALL_ARPTABLES:
|
||||
case QEMU_IFLA_BR_VLAN_FILTERING:
|
||||
case QEMU_IFLA_BR_TOPOLOGY_CHANGE:
|
||||
case QEMU_IFLA_BR_TOPOLOGY_CHANGE_DETECTED:
|
||||
case QEMU_IFLA_BR_MCAST_ROUTER:
|
||||
case QEMU_IFLA_BR_MCAST_SNOOPING:
|
||||
case QEMU_IFLA_BR_MCAST_QUERY_USE_IFADDR:
|
||||
case QEMU_IFLA_BR_MCAST_QUERIER:
|
||||
case QEMU_IFLA_BR_NF_CALL_IPTABLES:
|
||||
case QEMU_IFLA_BR_NF_CALL_IP6TABLES:
|
||||
case QEMU_IFLA_BR_NF_CALL_ARPTABLES:
|
||||
break;
|
||||
/* uint16_t */
|
||||
case IFLA_BR_PRIORITY:
|
||||
case IFLA_BR_VLAN_PROTOCOL:
|
||||
case IFLA_BR_GROUP_FWD_MASK:
|
||||
case IFLA_BR_ROOT_PORT:
|
||||
case IFLA_BR_VLAN_DEFAULT_PVID:
|
||||
case QEMU_IFLA_BR_PRIORITY:
|
||||
case QEMU_IFLA_BR_VLAN_PROTOCOL:
|
||||
case QEMU_IFLA_BR_GROUP_FWD_MASK:
|
||||
case QEMU_IFLA_BR_ROOT_PORT:
|
||||
case QEMU_IFLA_BR_VLAN_DEFAULT_PVID:
|
||||
u16 = NLA_DATA(nlattr);
|
||||
*u16 = tswap16(*u16);
|
||||
break;
|
||||
/* uint32_t */
|
||||
case IFLA_BR_FORWARD_DELAY:
|
||||
case IFLA_BR_HELLO_TIME:
|
||||
case IFLA_BR_MAX_AGE:
|
||||
case IFLA_BR_AGEING_TIME:
|
||||
case IFLA_BR_STP_STATE:
|
||||
case IFLA_BR_ROOT_PATH_COST:
|
||||
case IFLA_BR_MCAST_HASH_ELASTICITY:
|
||||
case IFLA_BR_MCAST_HASH_MAX:
|
||||
case IFLA_BR_MCAST_LAST_MEMBER_CNT:
|
||||
case IFLA_BR_MCAST_STARTUP_QUERY_CNT:
|
||||
case QEMU_IFLA_BR_FORWARD_DELAY:
|
||||
case QEMU_IFLA_BR_HELLO_TIME:
|
||||
case QEMU_IFLA_BR_MAX_AGE:
|
||||
case QEMU_IFLA_BR_AGEING_TIME:
|
||||
case QEMU_IFLA_BR_STP_STATE:
|
||||
case QEMU_IFLA_BR_ROOT_PATH_COST:
|
||||
case QEMU_IFLA_BR_MCAST_HASH_ELASTICITY:
|
||||
case QEMU_IFLA_BR_MCAST_HASH_MAX:
|
||||
case QEMU_IFLA_BR_MCAST_LAST_MEMBER_CNT:
|
||||
case QEMU_IFLA_BR_MCAST_STARTUP_QUERY_CNT:
|
||||
u32 = NLA_DATA(nlattr);
|
||||
*u32 = tswap32(*u32);
|
||||
break;
|
||||
/* uint64_t */
|
||||
case IFLA_BR_HELLO_TIMER:
|
||||
case IFLA_BR_TCN_TIMER:
|
||||
case IFLA_BR_GC_TIMER:
|
||||
case IFLA_BR_TOPOLOGY_CHANGE_TIMER:
|
||||
case IFLA_BR_MCAST_LAST_MEMBER_INTVL:
|
||||
case IFLA_BR_MCAST_MEMBERSHIP_INTVL:
|
||||
case IFLA_BR_MCAST_QUERIER_INTVL:
|
||||
case IFLA_BR_MCAST_QUERY_INTVL:
|
||||
case IFLA_BR_MCAST_QUERY_RESPONSE_INTVL:
|
||||
case IFLA_BR_MCAST_STARTUP_QUERY_INTVL:
|
||||
case QEMU_IFLA_BR_HELLO_TIMER:
|
||||
case QEMU_IFLA_BR_TCN_TIMER:
|
||||
case QEMU_IFLA_BR_GC_TIMER:
|
||||
case QEMU_IFLA_BR_TOPOLOGY_CHANGE_TIMER:
|
||||
case QEMU_IFLA_BR_MCAST_LAST_MEMBER_INTVL:
|
||||
case QEMU_IFLA_BR_MCAST_MEMBERSHIP_INTVL:
|
||||
case QEMU_IFLA_BR_MCAST_QUERIER_INTVL:
|
||||
case QEMU_IFLA_BR_MCAST_QUERY_INTVL:
|
||||
case QEMU_IFLA_BR_MCAST_QUERY_RESPONSE_INTVL:
|
||||
case QEMU_IFLA_BR_MCAST_STARTUP_QUERY_INTVL:
|
||||
u64 = NLA_DATA(nlattr);
|
||||
*u64 = tswap64(*u64);
|
||||
break;
|
||||
/* ifla_bridge_id: uin8_t[] */
|
||||
case IFLA_BR_ROOT_ID:
|
||||
case IFLA_BR_BRIDGE_ID:
|
||||
case QEMU_IFLA_BR_ROOT_ID:
|
||||
case QEMU_IFLA_BR_BRIDGE_ID:
|
||||
break;
|
||||
default:
|
||||
gemu_log("Unknown IFLA_BR type %d\n", nlattr->nla_type);
|
||||
gemu_log("Unknown QEMU_IFLA_BR type %d\n", nlattr->nla_type);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -1858,47 +2013,47 @@ static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr,
|
||||
|
||||
switch (nlattr->nla_type) {
|
||||
/* uint8_t */
|
||||
case IFLA_BRPORT_STATE:
|
||||
case IFLA_BRPORT_MODE:
|
||||
case IFLA_BRPORT_GUARD:
|
||||
case IFLA_BRPORT_PROTECT:
|
||||
case IFLA_BRPORT_FAST_LEAVE:
|
||||
case IFLA_BRPORT_LEARNING:
|
||||
case IFLA_BRPORT_UNICAST_FLOOD:
|
||||
case IFLA_BRPORT_PROXYARP:
|
||||
case IFLA_BRPORT_LEARNING_SYNC:
|
||||
case IFLA_BRPORT_PROXYARP_WIFI:
|
||||
case IFLA_BRPORT_TOPOLOGY_CHANGE_ACK:
|
||||
case IFLA_BRPORT_CONFIG_PENDING:
|
||||
case IFLA_BRPORT_MULTICAST_ROUTER:
|
||||
case QEMU_IFLA_BRPORT_STATE:
|
||||
case QEMU_IFLA_BRPORT_MODE:
|
||||
case QEMU_IFLA_BRPORT_GUARD:
|
||||
case QEMU_IFLA_BRPORT_PROTECT:
|
||||
case QEMU_IFLA_BRPORT_FAST_LEAVE:
|
||||
case QEMU_IFLA_BRPORT_LEARNING:
|
||||
case QEMU_IFLA_BRPORT_UNICAST_FLOOD:
|
||||
case QEMU_IFLA_BRPORT_PROXYARP:
|
||||
case QEMU_IFLA_BRPORT_LEARNING_SYNC:
|
||||
case QEMU_IFLA_BRPORT_PROXYARP_WIFI:
|
||||
case QEMU_IFLA_BRPORT_TOPOLOGY_CHANGE_ACK:
|
||||
case QEMU_IFLA_BRPORT_CONFIG_PENDING:
|
||||
case QEMU_IFLA_BRPORT_MULTICAST_ROUTER:
|
||||
break;
|
||||
/* uint16_t */
|
||||
case IFLA_BRPORT_PRIORITY:
|
||||
case IFLA_BRPORT_DESIGNATED_PORT:
|
||||
case IFLA_BRPORT_DESIGNATED_COST:
|
||||
case IFLA_BRPORT_ID:
|
||||
case IFLA_BRPORT_NO:
|
||||
case QEMU_IFLA_BRPORT_PRIORITY:
|
||||
case QEMU_IFLA_BRPORT_DESIGNATED_PORT:
|
||||
case QEMU_IFLA_BRPORT_DESIGNATED_COST:
|
||||
case QEMU_IFLA_BRPORT_ID:
|
||||
case QEMU_IFLA_BRPORT_NO:
|
||||
u16 = NLA_DATA(nlattr);
|
||||
*u16 = tswap16(*u16);
|
||||
break;
|
||||
/* uin32_t */
|
||||
case IFLA_BRPORT_COST:
|
||||
case QEMU_IFLA_BRPORT_COST:
|
||||
u32 = NLA_DATA(nlattr);
|
||||
*u32 = tswap32(*u32);
|
||||
break;
|
||||
/* uint64_t */
|
||||
case IFLA_BRPORT_MESSAGE_AGE_TIMER:
|
||||
case IFLA_BRPORT_FORWARD_DELAY_TIMER:
|
||||
case IFLA_BRPORT_HOLD_TIMER:
|
||||
case QEMU_IFLA_BRPORT_MESSAGE_AGE_TIMER:
|
||||
case QEMU_IFLA_BRPORT_FORWARD_DELAY_TIMER:
|
||||
case QEMU_IFLA_BRPORT_HOLD_TIMER:
|
||||
u64 = NLA_DATA(nlattr);
|
||||
*u64 = tswap64(*u64);
|
||||
break;
|
||||
/* ifla_bridge_id: uint8_t[] */
|
||||
case IFLA_BRPORT_ROOT_ID:
|
||||
case IFLA_BRPORT_BRIDGE_ID:
|
||||
case QEMU_IFLA_BRPORT_ROOT_ID:
|
||||
case QEMU_IFLA_BRPORT_BRIDGE_ID:
|
||||
break;
|
||||
default:
|
||||
gemu_log("Unknown IFLA_BRPORT type %d\n", nlattr->nla_type);
|
||||
gemu_log("Unknown QEMU_IFLA_BRPORT type %d\n", nlattr->nla_type);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -1918,20 +2073,20 @@ static abi_long host_to_target_data_linkinfo_nlattr(struct nlattr *nlattr,
|
||||
|
||||
switch (nlattr->nla_type) {
|
||||
/* string */
|
||||
case IFLA_INFO_KIND:
|
||||
case QEMU_IFLA_INFO_KIND:
|
||||
li_context->name = NLA_DATA(nlattr);
|
||||
li_context->len = nlattr->nla_len - NLA_HDRLEN;
|
||||
break;
|
||||
case IFLA_INFO_SLAVE_KIND:
|
||||
case QEMU_IFLA_INFO_SLAVE_KIND:
|
||||
li_context->slave_name = NLA_DATA(nlattr);
|
||||
li_context->slave_len = nlattr->nla_len - NLA_HDRLEN;
|
||||
break;
|
||||
/* stats */
|
||||
case IFLA_INFO_XSTATS:
|
||||
case QEMU_IFLA_INFO_XSTATS:
|
||||
/* FIXME: only used by CAN */
|
||||
break;
|
||||
/* nested */
|
||||
case IFLA_INFO_DATA:
|
||||
case QEMU_IFLA_INFO_DATA:
|
||||
if (strncmp(li_context->name, "bridge",
|
||||
li_context->len) == 0) {
|
||||
return host_to_target_for_each_nlattr(NLA_DATA(nlattr),
|
||||
@@ -1939,10 +2094,10 @@ static abi_long host_to_target_data_linkinfo_nlattr(struct nlattr *nlattr,
|
||||
NULL,
|
||||
host_to_target_data_bridge_nlattr);
|
||||
} else {
|
||||
gemu_log("Unknown IFLA_INFO_KIND %s\n", li_context->name);
|
||||
gemu_log("Unknown QEMU_IFLA_INFO_KIND %s\n", li_context->name);
|
||||
}
|
||||
break;
|
||||
case IFLA_INFO_SLAVE_DATA:
|
||||
case QEMU_IFLA_INFO_SLAVE_DATA:
|
||||
if (strncmp(li_context->slave_name, "bridge",
|
||||
li_context->slave_len) == 0) {
|
||||
return host_to_target_for_each_nlattr(NLA_DATA(nlattr),
|
||||
@@ -1950,12 +2105,12 @@ static abi_long host_to_target_data_linkinfo_nlattr(struct nlattr *nlattr,
|
||||
NULL,
|
||||
host_to_target_slave_data_bridge_nlattr);
|
||||
} else {
|
||||
gemu_log("Unknown IFLA_INFO_SLAVE_KIND %s\n",
|
||||
gemu_log("Unknown QEMU_IFLA_INFO_SLAVE_KIND %s\n",
|
||||
li_context->slave_name);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gemu_log("Unknown host IFLA_INFO type: %d\n", nlattr->nla_type);
|
||||
gemu_log("Unknown host QEMU_IFLA_INFO type: %d\n", nlattr->nla_type);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1969,7 +2124,7 @@ static abi_long host_to_target_data_inet_nlattr(struct nlattr *nlattr,
|
||||
int i;
|
||||
|
||||
switch (nlattr->nla_type) {
|
||||
case IFLA_INET_CONF:
|
||||
case QEMU_IFLA_INET_CONF:
|
||||
u32 = NLA_DATA(nlattr);
|
||||
for (i = 0; i < (nlattr->nla_len - NLA_HDRLEN) / sizeof(*u32);
|
||||
i++) {
|
||||
@@ -1992,18 +2147,18 @@ static abi_long host_to_target_data_inet6_nlattr(struct nlattr *nlattr,
|
||||
|
||||
switch (nlattr->nla_type) {
|
||||
/* binaries */
|
||||
case IFLA_INET6_TOKEN:
|
||||
case QEMU_IFLA_INET6_TOKEN:
|
||||
break;
|
||||
/* uint8_t */
|
||||
case IFLA_INET6_ADDR_GEN_MODE:
|
||||
case QEMU_IFLA_INET6_ADDR_GEN_MODE:
|
||||
break;
|
||||
/* uint32_t */
|
||||
case IFLA_INET6_FLAGS:
|
||||
case QEMU_IFLA_INET6_FLAGS:
|
||||
u32 = NLA_DATA(nlattr);
|
||||
*u32 = tswap32(*u32);
|
||||
break;
|
||||
/* uint32_t[] */
|
||||
case IFLA_INET6_CONF:
|
||||
case QEMU_IFLA_INET6_CONF:
|
||||
u32 = NLA_DATA(nlattr);
|
||||
for (i = 0; i < (nlattr->nla_len - NLA_HDRLEN) / sizeof(*u32);
|
||||
i++) {
|
||||
@@ -2011,7 +2166,7 @@ static abi_long host_to_target_data_inet6_nlattr(struct nlattr *nlattr,
|
||||
}
|
||||
break;
|
||||
/* ifla_cacheinfo */
|
||||
case IFLA_INET6_CACHEINFO:
|
||||
case QEMU_IFLA_INET6_CACHEINFO:
|
||||
ci = NLA_DATA(nlattr);
|
||||
ci->max_reasm_len = tswap32(ci->max_reasm_len);
|
||||
ci->tstamp = tswap32(ci->tstamp);
|
||||
@@ -2019,8 +2174,8 @@ static abi_long host_to_target_data_inet6_nlattr(struct nlattr *nlattr,
|
||||
ci->retrans_time = tswap32(ci->retrans_time);
|
||||
break;
|
||||
/* uint64_t[] */
|
||||
case IFLA_INET6_STATS:
|
||||
case IFLA_INET6_ICMP6STATS:
|
||||
case QEMU_IFLA_INET6_STATS:
|
||||
case QEMU_IFLA_INET6_ICMP6STATS:
|
||||
u64 = NLA_DATA(nlattr);
|
||||
for (i = 0; i < (nlattr->nla_len - NLA_HDRLEN) / sizeof(*u64);
|
||||
i++) {
|
||||
@@ -2062,37 +2217,37 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr)
|
||||
|
||||
switch (rtattr->rta_type) {
|
||||
/* binary stream */
|
||||
case IFLA_ADDRESS:
|
||||
case IFLA_BROADCAST:
|
||||
case QEMU_IFLA_ADDRESS:
|
||||
case QEMU_IFLA_BROADCAST:
|
||||
/* string */
|
||||
case IFLA_IFNAME:
|
||||
case IFLA_QDISC:
|
||||
case QEMU_IFLA_IFNAME:
|
||||
case QEMU_IFLA_QDISC:
|
||||
break;
|
||||
/* uin8_t */
|
||||
case IFLA_OPERSTATE:
|
||||
case IFLA_LINKMODE:
|
||||
case IFLA_CARRIER:
|
||||
case IFLA_PROTO_DOWN:
|
||||
case QEMU_IFLA_OPERSTATE:
|
||||
case QEMU_IFLA_LINKMODE:
|
||||
case QEMU_IFLA_CARRIER:
|
||||
case QEMU_IFLA_PROTO_DOWN:
|
||||
break;
|
||||
/* uint32_t */
|
||||
case IFLA_MTU:
|
||||
case IFLA_LINK:
|
||||
case IFLA_WEIGHT:
|
||||
case IFLA_TXQLEN:
|
||||
case IFLA_CARRIER_CHANGES:
|
||||
case IFLA_NUM_RX_QUEUES:
|
||||
case IFLA_NUM_TX_QUEUES:
|
||||
case IFLA_PROMISCUITY:
|
||||
case IFLA_EXT_MASK:
|
||||
case IFLA_LINK_NETNSID:
|
||||
case IFLA_GROUP:
|
||||
case IFLA_MASTER:
|
||||
case IFLA_NUM_VF:
|
||||
case QEMU_IFLA_MTU:
|
||||
case QEMU_IFLA_LINK:
|
||||
case QEMU_IFLA_WEIGHT:
|
||||
case QEMU_IFLA_TXQLEN:
|
||||
case QEMU_IFLA_CARRIER_CHANGES:
|
||||
case QEMU_IFLA_NUM_RX_QUEUES:
|
||||
case QEMU_IFLA_NUM_TX_QUEUES:
|
||||
case QEMU_IFLA_PROMISCUITY:
|
||||
case QEMU_IFLA_EXT_MASK:
|
||||
case QEMU_IFLA_LINK_NETNSID:
|
||||
case QEMU_IFLA_GROUP:
|
||||
case QEMU_IFLA_MASTER:
|
||||
case QEMU_IFLA_NUM_VF:
|
||||
u32 = RTA_DATA(rtattr);
|
||||
*u32 = tswap32(*u32);
|
||||
break;
|
||||
/* struct rtnl_link_stats */
|
||||
case IFLA_STATS:
|
||||
case QEMU_IFLA_STATS:
|
||||
st = RTA_DATA(rtattr);
|
||||
st->rx_packets = tswap32(st->rx_packets);
|
||||
st->tx_packets = tswap32(st->tx_packets);
|
||||
@@ -2125,7 +2280,7 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr)
|
||||
st->tx_compressed = tswap32(st->tx_compressed);
|
||||
break;
|
||||
/* struct rtnl_link_stats64 */
|
||||
case IFLA_STATS64:
|
||||
case QEMU_IFLA_STATS64:
|
||||
st64 = RTA_DATA(rtattr);
|
||||
st64->rx_packets = tswap64(st64->rx_packets);
|
||||
st64->tx_packets = tswap64(st64->tx_packets);
|
||||
@@ -2158,7 +2313,7 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr)
|
||||
st64->tx_compressed = tswap64(st64->tx_compressed);
|
||||
break;
|
||||
/* struct rtnl_link_ifmap */
|
||||
case IFLA_MAP:
|
||||
case QEMU_IFLA_MAP:
|
||||
map = RTA_DATA(rtattr);
|
||||
map->mem_start = tswap64(map->mem_start);
|
||||
map->mem_end = tswap64(map->mem_end);
|
||||
@@ -2166,17 +2321,17 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr)
|
||||
map->irq = tswap16(map->irq);
|
||||
break;
|
||||
/* nested */
|
||||
case IFLA_LINKINFO:
|
||||
case QEMU_IFLA_LINKINFO:
|
||||
memset(&li_context, 0, sizeof(li_context));
|
||||
return host_to_target_for_each_nlattr(RTA_DATA(rtattr), rtattr->rta_len,
|
||||
&li_context,
|
||||
host_to_target_data_linkinfo_nlattr);
|
||||
case IFLA_AF_SPEC:
|
||||
case QEMU_IFLA_AF_SPEC:
|
||||
return host_to_target_for_each_nlattr(RTA_DATA(rtattr), rtattr->rta_len,
|
||||
NULL,
|
||||
host_to_target_data_spec_nlattr);
|
||||
default:
|
||||
gemu_log("Unknown host IFLA type: %d\n", rtattr->rta_type);
|
||||
gemu_log("Unknown host QEMU_IFLA type: %d\n", rtattr->rta_type);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -2343,7 +2498,7 @@ static abi_long target_to_host_data_link_rtattr(struct rtattr *rtattr)
|
||||
{
|
||||
switch (rtattr->rta_type) {
|
||||
default:
|
||||
gemu_log("Unknown target IFLA type: %d\n", rtattr->rta_type);
|
||||
gemu_log("Unknown target QEMU_IFLA type: %d\n", rtattr->rta_type);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -9303,7 +9458,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
|
||||
{
|
||||
int64_t res;
|
||||
#if !defined(__NR_llseek)
|
||||
res = lseek(arg1, ((uint64_t)arg2 << 32) | arg3, arg5);
|
||||
res = lseek(arg1, ((uint64_t)arg2 << 32) | (abi_ulong)arg3, arg5);
|
||||
if (res == -1) {
|
||||
ret = get_errno(res);
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# linux-user/signal.c
|
||||
user_setup_frame(void *env, uint64_t frame_addr) "env=%p frame_addr=%"PRIx64
|
||||
|
||||
@@ -604,7 +604,8 @@ void *postcopy_get_tmp_page(MigrationIncomingState *mis)
|
||||
mis->postcopy_tmp_page = mmap(NULL, getpagesize(),
|
||||
PROT_READ | PROT_WRITE, MAP_PRIVATE |
|
||||
MAP_ANONYMOUS, -1, 0);
|
||||
if (!mis->postcopy_tmp_page) {
|
||||
if (mis->postcopy_tmp_page == MAP_FAILED) {
|
||||
mis->postcopy_tmp_page = NULL;
|
||||
error_report("%s: %s", __func__, strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -668,6 +668,7 @@ int qemu_put_qemu_file(QEMUFile *f_des, QEMUFile *f_src)
|
||||
len = f_src->buf_index;
|
||||
qemu_put_buffer(f_des, f_src->buf, f_src->buf_index);
|
||||
f_src->buf_index = 0;
|
||||
f_src->iovcnt = 0;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
+2
-2
@@ -375,8 +375,8 @@ void migrate_compress_threads_create(void)
|
||||
qemu_cond_init(&comp_done_cond);
|
||||
qemu_mutex_init(&comp_done_lock);
|
||||
for (i = 0; i < thread_count; i++) {
|
||||
/* com_param[i].file is just used as a dummy buffer to save data, set
|
||||
* it's ops to empty.
|
||||
/* comp_param[i].file is just used as a dummy buffer to save data,
|
||||
* set its ops to empty.
|
||||
*/
|
||||
comp_param[i].file = qemu_fopen_ops(NULL, &empty_ops);
|
||||
comp_param[i].done = true;
|
||||
|
||||
+3
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* QEMU live migration via Unix Domain Sockets
|
||||
* QEMU live migration via socket
|
||||
*
|
||||
* Copyright Red Hat, Inc. 2009-2016
|
||||
*
|
||||
@@ -94,10 +94,12 @@ static void socket_start_outgoing_migration(MigrationState *s,
|
||||
{
|
||||
QIOChannelSocket *sioc = qio_channel_socket_new();
|
||||
struct SocketConnectData *data = g_new0(struct SocketConnectData, 1);
|
||||
|
||||
data->s = s;
|
||||
if (saddr->type == SOCKET_ADDRESS_KIND_INET) {
|
||||
data->hostname = g_strdup(saddr->u.inet.data->host);
|
||||
}
|
||||
|
||||
qio_channel_socket_connect_async(sioc,
|
||||
saddr,
|
||||
socket_outgoing_migration,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# migration/savevm.c
|
||||
qemu_loadvm_state_section(unsigned int section_type) "%d"
|
||||
|
||||
@@ -1602,9 +1602,8 @@ void net_socket_rs_init(SocketReadState *rs,
|
||||
|
||||
/*
|
||||
* Returns
|
||||
* 0: SocketReadState is not ready
|
||||
* 1: SocketReadState is ready
|
||||
* otherwise error occurs
|
||||
* 0: success
|
||||
* -1: error occurs
|
||||
*/
|
||||
int net_fill_rstate(SocketReadState *rs, const uint8_t *buf, int size)
|
||||
{
|
||||
@@ -1652,10 +1651,11 @@ int net_fill_rstate(SocketReadState *rs, const uint8_t *buf, int size)
|
||||
if (rs->finalize) {
|
||||
rs->finalize(rs);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assert(size == 0);
|
||||
return 0;
|
||||
}
|
||||
+3
-1
@@ -131,7 +131,9 @@ static void net_slirp_cleanup(NetClientState *nc)
|
||||
SlirpState *s = DO_UPCAST(SlirpState, nc, nc);
|
||||
|
||||
slirp_cleanup(s->slirp);
|
||||
qemu_remove_exit_notifier(&s->exit_notifier);
|
||||
if (s->exit_notifier.notify) {
|
||||
qemu_remove_exit_notifier(&s->exit_notifier);
|
||||
}
|
||||
slirp_smb_cleanup(s);
|
||||
QTAILQ_REMOVE(&slirp_stacks, s, entry);
|
||||
}
|
||||
|
||||
+28
-27
@@ -489,30 +489,41 @@ static int net_socket_listen_init(NetClientState *peer,
|
||||
{
|
||||
NetClientState *nc;
|
||||
NetSocketState *s;
|
||||
SocketAddress *saddr;
|
||||
int ret;
|
||||
Error *local_error = NULL;
|
||||
struct sockaddr_in saddr;
|
||||
int fd, ret;
|
||||
|
||||
saddr = socket_parse(host_str, &local_error);
|
||||
if (saddr == NULL) {
|
||||
error_report_err(local_error);
|
||||
if (parse_host_port(&saddr, host_str) < 0)
|
||||
return -1;
|
||||
|
||||
fd = qemu_socket(PF_INET, SOCK_STREAM, 0);
|
||||
if (fd < 0) {
|
||||
perror("socket");
|
||||
return -1;
|
||||
}
|
||||
qemu_set_nonblock(fd);
|
||||
|
||||
ret = socket_listen(saddr, &local_error);
|
||||
socket_set_fast_reuse(fd);
|
||||
|
||||
ret = bind(fd, (struct sockaddr *)&saddr, sizeof(saddr));
|
||||
if (ret < 0) {
|
||||
error_report_err(local_error);
|
||||
perror("bind");
|
||||
closesocket(fd);
|
||||
return -1;
|
||||
}
|
||||
ret = listen(fd, 0);
|
||||
if (ret < 0) {
|
||||
perror("listen");
|
||||
closesocket(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
nc = qemu_new_net_client(&net_socket_info, peer, model, name);
|
||||
s = DO_UPCAST(NetSocketState, nc, nc);
|
||||
s->fd = -1;
|
||||
s->listen_fd = ret;
|
||||
s->listen_fd = fd;
|
||||
s->nc.link_down = true;
|
||||
|
||||
qemu_set_fd_handler(s->listen_fd, net_socket_accept, NULL, s);
|
||||
qapi_free_SocketAddress(saddr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -523,15 +534,10 @@ static int net_socket_connect_init(NetClientState *peer,
|
||||
{
|
||||
NetSocketState *s;
|
||||
int fd, connected, ret;
|
||||
char *addr_str;
|
||||
SocketAddress *saddr;
|
||||
Error *local_error = NULL;
|
||||
struct sockaddr_in saddr;
|
||||
|
||||
saddr = socket_parse(host_str, &local_error);
|
||||
if (saddr == NULL) {
|
||||
error_report_err(local_error);
|
||||
if (parse_host_port(&saddr, host_str) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
fd = qemu_socket(PF_INET, SOCK_STREAM, 0);
|
||||
if (fd < 0) {
|
||||
@@ -539,9 +545,10 @@ static int net_socket_connect_init(NetClientState *peer,
|
||||
return -1;
|
||||
}
|
||||
qemu_set_nonblock(fd);
|
||||
|
||||
connected = 0;
|
||||
for(;;) {
|
||||
ret = socket_connect(saddr, &local_error, NULL, NULL);
|
||||
ret = connect(fd, (struct sockaddr *)&saddr, sizeof(saddr));
|
||||
if (ret < 0) {
|
||||
if (errno == EINTR || errno == EWOULDBLOCK) {
|
||||
/* continue */
|
||||
@@ -550,7 +557,7 @@ static int net_socket_connect_init(NetClientState *peer,
|
||||
errno == EINVAL) {
|
||||
break;
|
||||
} else {
|
||||
error_report_err(local_error);
|
||||
perror("connect");
|
||||
closesocket(fd);
|
||||
return -1;
|
||||
}
|
||||
@@ -562,15 +569,9 @@ static int net_socket_connect_init(NetClientState *peer,
|
||||
s = net_socket_fd_init(peer, model, name, fd, connected);
|
||||
if (!s)
|
||||
return -1;
|
||||
|
||||
addr_str = socket_address_to_string(saddr, &local_error);
|
||||
if (addr_str == NULL)
|
||||
return -1;
|
||||
|
||||
snprintf(s->nc.info_str, sizeof(s->nc.info_str),
|
||||
"socket: connect to %s", addr_str);
|
||||
qapi_free_SocketAddress(saddr);
|
||||
g_free(addr_str);
|
||||
"socket: connect to %s:%d",
|
||||
inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# net/vhost-user.c
|
||||
vhost_user_event(const char *chr, int event) "chr: %s got event: %d"
|
||||
Binary file not shown.
@@ -9,8 +9,14 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/optionrom)
|
||||
|
||||
.PHONY : all clean build-all
|
||||
|
||||
# Compiling with no optimization creates ROMs that are too large
|
||||
ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0)
|
||||
override CFLAGS += -O2
|
||||
endif
|
||||
|
||||
# Drop -fstack-protector and the like
|
||||
QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS)) $(CFLAGS_NOPIE) -ffreestanding
|
||||
QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector)
|
||||
QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -m16)
|
||||
ifeq ($(filter -m16, $(QEMU_CFLAGS)),)
|
||||
# Attempt to work around compilers that lack -m16 (GCC <= 4.8, clang <= ??)
|
||||
@@ -24,8 +30,6 @@ QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -no-integrated-as)
|
||||
QEMU_CFLAGS += -m32 -include $(SRC_PATH)/pc-bios/optionrom/code16gcc.h
|
||||
endif
|
||||
|
||||
# Drop gcov and glib flags
|
||||
CFLAGS := $(filter -O% -g%, $(CFLAGS))
|
||||
QEMU_INCLUDES += -I$(SRC_PATH)
|
||||
|
||||
Wa = -Wa,
|
||||
@@ -41,18 +45,8 @@ build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin
|
||||
%.o: %.S
|
||||
$(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@," AS $(TARGET_DIR)$@")
|
||||
|
||||
ifdef CONFIG_WIN32
|
||||
LD_EMULATION = i386pe
|
||||
else
|
||||
ifdef CONFIG_BSD
|
||||
LD_EMULATION = elf_i386_fbsd
|
||||
else
|
||||
LD_EMULATION = elf_i386
|
||||
endif
|
||||
endif
|
||||
|
||||
%.img: %.o
|
||||
$(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_EMULATION) -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@")
|
||||
$(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_I386_EMULATION) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $<," Building $(TARGET_DIR)$@")
|
||||
|
||||
%.raw: %.img
|
||||
$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@," Building $(TARGET_DIR)$@")
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
SECTIONS
|
||||
{
|
||||
. = 0;
|
||||
.text : { *(.text) *(.text.$) }
|
||||
}
|
||||
ENTRY(_start)
|
||||
@@ -25,7 +25,7 @@ asm(
|
||||
".global _start\n"
|
||||
"_start:\n"
|
||||
" .short 0xaa55\n"
|
||||
" .byte 0\n" /* size in 512 units, filled in by signrom.py */
|
||||
" .byte 3\n" /* desired size in 512 units; signrom.py adds padding */
|
||||
" .byte 0xcb\n" /* far return without prefix */
|
||||
" .org 0x18\n"
|
||||
" .short 0\n"
|
||||
@@ -157,7 +157,11 @@ static inline uint32_t be32_to_cpu(uint32_t x)
|
||||
return bswap32(x);
|
||||
}
|
||||
|
||||
static void bios_cfg_read_entry(void *buf, uint16_t entry, uint32_t len)
|
||||
/* clang is happy to inline this function, and bloats the
|
||||
* ROM.
|
||||
*/
|
||||
static __attribute__((__noinline__))
|
||||
void bios_cfg_read_entry(void *buf, uint16_t entry, uint32_t len)
|
||||
{
|
||||
FWCfgDmaAccess access;
|
||||
uint32_t control = (entry << 16) | BIOS_CFG_DMA_CTL_SELECT
|
||||
|
||||
@@ -10,8 +10,10 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw)
|
||||
.PHONY : all clean build-all
|
||||
|
||||
OBJECTS = start.o main.o bootmap.o sclp-ascii.o virtio.o virtio-scsi.o
|
||||
CFLAGS += -fPIE -fno-stack-protector -ffreestanding -march=z900
|
||||
CFLAGS += -fno-delete-null-pointer-checks -msoft-float
|
||||
QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS))
|
||||
QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float
|
||||
QEMU_CFLAGS += -march=z900 -fPIE -fno-strict-aliasing
|
||||
QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector)
|
||||
LDFLAGS += -Wl,-pie -nostdlib
|
||||
|
||||
build-all: s390-ccw.img
|
||||
|
||||
+3
-1
@@ -3176,7 +3176,9 @@ static int tcp_chr_wait_connected(CharDriverState *chr, Error **errp)
|
||||
TCPCharDriver *s = chr->opaque;
|
||||
QIOChannelSocket *sioc;
|
||||
|
||||
while (!s->connected) {
|
||||
/* It can't wait on s->connected, since it is set asynchronously
|
||||
* in TLS and telnet cases, only wait for an accepted socket */
|
||||
while (!s->ioc) {
|
||||
if (s->is_listen) {
|
||||
fprintf(stderr, "QEMU waiting for connection on: %s\n",
|
||||
chr->filename);
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@
|
||||
#include <getopt.h>
|
||||
|
||||
#define QEMU_IMG_VERSION "qemu-img version " QEMU_VERSION QEMU_PKGVERSION \
|
||||
", Copyright (c) 2004-2008 Fabrice Bellard\n"
|
||||
", " QEMU_COPYRIGHT "\n"
|
||||
|
||||
typedef struct img_cmd_t {
|
||||
const char *name;
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ static void qemu_clock_init(QEMUClockType type)
|
||||
assert(main_loop_tlg.tl[type] == NULL);
|
||||
|
||||
clock->type = type;
|
||||
clock->enabled = true;
|
||||
clock->enabled = (type == QEMU_CLOCK_VIRTUAL ? false : true);
|
||||
clock->last = INT64_MIN;
|
||||
QLIST_INIT(&clock->timerlists);
|
||||
notifier_list_init(&clock->reset_notifiers);
|
||||
|
||||
@@ -4802,8 +4802,6 @@ The consoles are visible in the qom tree, under
|
||||
/backend/console[$index]. They have a device link and head property, so
|
||||
it is possible to map which console belongs to which device and display.
|
||||
|
||||
Note: this command is experimental, and not a stable API.
|
||||
|
||||
Example (1):
|
||||
|
||||
Press left mouse button.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# qom/object.c
|
||||
object_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"
|
||||
|
||||
+55
-55
@@ -22,7 +22,7 @@ my $tst_only;
|
||||
my $emacs = 0;
|
||||
my $terse = 0;
|
||||
my $file = 0;
|
||||
my $check = 0;
|
||||
my $no_warnings = 0;
|
||||
my $summary = 1;
|
||||
my $mailback = 0;
|
||||
my $summary_file = 0;
|
||||
@@ -45,7 +45,7 @@ Options:
|
||||
--emacs emacs compile window format
|
||||
--terse one line per report
|
||||
-f, --file treat FILE as regular source file
|
||||
--subjective, --strict enable more subjective tests
|
||||
--strict fail if only warnings are found
|
||||
--root=PATH PATH to the kernel tree root
|
||||
--no-summary suppress the per-file summary
|
||||
--mailback only produce a report in case of warnings/errors
|
||||
@@ -71,8 +71,7 @@ GetOptions(
|
||||
'emacs!' => \$emacs,
|
||||
'terse!' => \$terse,
|
||||
'f|file!' => \$file,
|
||||
'subjective!' => \$check,
|
||||
'strict!' => \$check,
|
||||
'strict!' => \$no_warnings,
|
||||
'root=s' => \$root,
|
||||
'summary!' => \$summary,
|
||||
'mailback!' => \$mailback,
|
||||
@@ -1072,12 +1071,6 @@ sub WARN {
|
||||
our $cnt_warn++;
|
||||
}
|
||||
}
|
||||
sub CHK {
|
||||
if ($check && report("CHECK: $_[0]\n")) {
|
||||
our $clean = 0;
|
||||
our $cnt_chk++;
|
||||
}
|
||||
}
|
||||
|
||||
sub process {
|
||||
my $filename = shift;
|
||||
@@ -1289,11 +1282,11 @@ sub process {
|
||||
# This is a signoff, if ugly, so do not double report.
|
||||
$signoff++;
|
||||
if (!($line =~ /^\s*Signed-off-by:/)) {
|
||||
WARN("Signed-off-by: is the preferred form\n" .
|
||||
ERROR("The correct form is \"Signed-off-by\"\n" .
|
||||
$herecurr);
|
||||
}
|
||||
if ($line =~ /^\s*signed-off-by:\S/i) {
|
||||
WARN("space required after Signed-off-by:\n" .
|
||||
ERROR("space required after Signed-off-by:\n" .
|
||||
$herecurr);
|
||||
}
|
||||
}
|
||||
@@ -1319,6 +1312,9 @@ sub process {
|
||||
# ignore non-hunk lines and lines being removed
|
||||
next if (!$hunk_line || $line =~ /^-/);
|
||||
|
||||
# ignore files that are being periodically imported from Linux
|
||||
next if ($realfile =~ /^(linux-headers|include\/standard-headers)\//);
|
||||
|
||||
#trailing whitespace
|
||||
if ($line =~ /^\+.*\015/) {
|
||||
my $herevet = "$here\n" . cat_vet($rawline) . "\n";
|
||||
@@ -1331,30 +1327,40 @@ sub process {
|
||||
}
|
||||
|
||||
# check we are in a valid source file if not then ignore this hunk
|
||||
next if ($realfile !~ /\.(h|c|cpp|s|S|pl|sh)$/);
|
||||
next if ($realfile !~ /\.(h|c|cpp|s|S|pl|py|sh)$/);
|
||||
|
||||
#80 column limit
|
||||
#90 column limit
|
||||
if ($line =~ /^\+/ &&
|
||||
!($line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) &&
|
||||
$length > 80)
|
||||
{
|
||||
WARN("line over 80 characters\n" . $herecurr);
|
||||
if ($length > 90) {
|
||||
ERROR("line over 90 characters\n" . $herecurr);
|
||||
} else {
|
||||
WARN("line over 80 characters\n" . $herecurr);
|
||||
}
|
||||
}
|
||||
|
||||
# check for spaces before a quoted newline
|
||||
if ($rawline =~ /^.*\".*\s\\n/) {
|
||||
WARN("unnecessary whitespace before a quoted newline\n" . $herecurr);
|
||||
ERROR("unnecessary whitespace before a quoted newline\n" . $herecurr);
|
||||
}
|
||||
|
||||
# check for adding lines without a newline.
|
||||
if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
|
||||
WARN("adding a line without newline at end of file\n" . $herecurr);
|
||||
ERROR("adding a line without newline at end of file\n" . $herecurr);
|
||||
}
|
||||
|
||||
# check we are in a valid source file C or perl if not then ignore this hunk
|
||||
next if ($realfile !~ /\.(h|c|cpp|pl)$/);
|
||||
# check for RCS/CVS revision markers
|
||||
if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|\b)/) {
|
||||
ERROR("CVS style keyword markers, these will _not_ be updated\n". $herecurr);
|
||||
}
|
||||
|
||||
# tabs are only allowed in assembly source code, and in
|
||||
# some scripts we imported from other projects.
|
||||
next if ($realfile =~ /\.(s|S)$/);
|
||||
next if ($realfile =~ /(checkpatch|get_maintainer|texi2pod)\.pl$/);
|
||||
|
||||
# in QEMU, no tabs are allowed
|
||||
if ($rawline =~ /^\+.*\t/) {
|
||||
my $herevet = "$here\n" . cat_vet($rawline) . "\n";
|
||||
ERROR("code indent should never use tabs\n" . $herevet);
|
||||
@@ -1364,11 +1370,6 @@ sub process {
|
||||
# check we are in a valid C source file if not then ignore this hunk
|
||||
next if ($realfile !~ /\.(h|c|cpp)$/);
|
||||
|
||||
# check for RCS/CVS revision markers
|
||||
if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
|
||||
WARN("CVS style keyword markers, these will _not_ be updated\n". $herecurr);
|
||||
}
|
||||
|
||||
# Check for potential 'bare' types
|
||||
my ($stat, $cond, $line_nr_next, $remain_next, $off_next,
|
||||
$realline_next);
|
||||
@@ -1498,7 +1499,7 @@ sub process {
|
||||
{
|
||||
my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]);
|
||||
if ($nindent > $indent) {
|
||||
WARN("trailing semicolon indicates no statements, indent implies otherwise\n" .
|
||||
ERROR("trailing semicolon indicates no statements, indent implies otherwise\n" .
|
||||
"$here\n$ctx\n$rawlines[$ctx_ln - 1]\n");
|
||||
}
|
||||
}
|
||||
@@ -1586,7 +1587,7 @@ sub process {
|
||||
|
||||
if ($check && (($sindent % 4) != 0 ||
|
||||
($sindent <= $indent && $s ne ''))) {
|
||||
WARN("suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n");
|
||||
ERROR("suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1764,7 +1765,7 @@ sub process {
|
||||
} elsif ($ctx =~ /$Type$/) {
|
||||
|
||||
} else {
|
||||
WARN("space prohibited between function name and open parenthesis '('\n" . $herecurr);
|
||||
ERROR("space prohibited between function name and open parenthesis '('\n" . $herecurr);
|
||||
}
|
||||
}
|
||||
# Check operator spacing.
|
||||
@@ -2003,7 +2004,7 @@ sub process {
|
||||
if ($line =~ /^.\s*return\s*(E[A-Z]*)\s*;/) {
|
||||
my $name = $1;
|
||||
if ($name ne 'EOF' && $name ne 'ERROR') {
|
||||
WARN("return of an errno should typically be -ve (return -$1)\n" . $herecurr);
|
||||
ERROR("return of an errno should typically be -ve (return -$1)\n" . $herecurr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2075,7 +2076,7 @@ sub process {
|
||||
(?:\&\&|\|\||\)|\])
|
||||
)/x)
|
||||
{
|
||||
WARN("boolean test with hexadecimal, perhaps just 1 \& or \|?\n" . $herecurr);
|
||||
ERROR("boolean test with hexadecimal, perhaps just 1 \& or \|?\n" . $herecurr);
|
||||
}
|
||||
|
||||
# if and else should not have general statements after it
|
||||
@@ -2131,7 +2132,7 @@ sub process {
|
||||
|
||||
#no spaces allowed after \ in define
|
||||
if ($line=~/\#\s*define.*\\\s$/) {
|
||||
WARN("Whitepspace after \\ makes next lines useless\n" . $herecurr);
|
||||
ERROR("Whitespace after \\ makes next lines useless\n" . $herecurr);
|
||||
}
|
||||
|
||||
# multi-statement macros should be enclosed in a do while loop, grab the
|
||||
@@ -2283,7 +2284,7 @@ sub process {
|
||||
}
|
||||
}
|
||||
if ($seen != ($#chunks + 1)) {
|
||||
WARN("braces {} are necessary for all arms of this statement\n" . $herectx);
|
||||
ERROR("braces {} are necessary for all arms of this statement\n" . $herectx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2351,19 +2352,19 @@ sub process {
|
||||
$herectx .= raw_line($linenr, $n) . "\n";;
|
||||
}
|
||||
|
||||
WARN("braces {} are necessary even for single statement blocks\n" . $herectx);
|
||||
ERROR("braces {} are necessary even for single statement blocks\n" . $herectx);
|
||||
}
|
||||
}
|
||||
|
||||
# no volatiles please
|
||||
my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};
|
||||
if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {
|
||||
WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);
|
||||
ERROR("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);
|
||||
}
|
||||
|
||||
# warn about #if 0
|
||||
if ($line =~ /^.\s*\#\s*if\s+0\b/) {
|
||||
WARN("if this code is redundant consider removing it\n" .
|
||||
ERROR("if this code is redundant consider removing it\n" .
|
||||
$herecurr);
|
||||
}
|
||||
|
||||
@@ -2371,7 +2372,7 @@ sub process {
|
||||
if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
|
||||
my $expr = $1;
|
||||
if ($line =~ /\bg_free\(\Q$expr\E\);/) {
|
||||
WARN("g_free(NULL) is safe this check is probably not required\n" . $hereprev);
|
||||
ERROR("g_free(NULL) is safe this check is probably not required\n" . $hereprev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2389,19 +2390,19 @@ sub process {
|
||||
# check for memory barriers without a comment.
|
||||
if ($line =~ /\b(smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) {
|
||||
if (!ctx_has_comment($first_line, $linenr)) {
|
||||
WARN("memory barrier without comment\n" . $herecurr);
|
||||
ERROR("memory barrier without comment\n" . $herecurr);
|
||||
}
|
||||
}
|
||||
# check of hardware specific defines
|
||||
# we have e.g. CONFIG_LINUX and CONFIG_WIN32 for common cases
|
||||
# where they might be necessary.
|
||||
if ($line =~ m@^.\s*\#\s*if.*\b__@) {
|
||||
WARN("architecture specific defines should be avoided\n" . $herecurr);
|
||||
ERROR("architecture specific defines should be avoided\n" . $herecurr);
|
||||
}
|
||||
|
||||
# Check that the storage class is at the beginning of a declaration
|
||||
if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) {
|
||||
WARN("storage class should be at the beginning of the declaration\n" . $herecurr)
|
||||
ERROR("storage class should be at the beginning of the declaration\n" . $herecurr)
|
||||
}
|
||||
|
||||
# check the location of the inline attribute, that it is between
|
||||
@@ -2413,7 +2414,7 @@ sub process {
|
||||
|
||||
# check for sizeof(&)
|
||||
if ($line =~ /\bsizeof\s*\(\s*\&/) {
|
||||
WARN("sizeof(& should be avoided\n" . $herecurr);
|
||||
ERROR("sizeof(& should be avoided\n" . $herecurr);
|
||||
}
|
||||
|
||||
# check for new externs in .c files.
|
||||
@@ -2430,40 +2431,40 @@ sub process {
|
||||
if ($s =~ /^\s*;/ &&
|
||||
$function_name ne 'uninitialized_var')
|
||||
{
|
||||
WARN("externs should be avoided in .c files\n" . $herecurr);
|
||||
ERROR("externs should be avoided in .c files\n" . $herecurr);
|
||||
}
|
||||
|
||||
if ($paren_space =~ /\n/) {
|
||||
WARN("arguments for function declarations should follow identifier\n" . $herecurr);
|
||||
ERROR("arguments for function declarations should follow identifier\n" . $herecurr);
|
||||
}
|
||||
|
||||
} elsif ($realfile =~ /\.c$/ && defined $stat &&
|
||||
$stat =~ /^.\s*extern\s+/)
|
||||
{
|
||||
WARN("externs should be avoided in .c files\n" . $herecurr);
|
||||
ERROR("externs should be avoided in .c files\n" . $herecurr);
|
||||
}
|
||||
|
||||
# check for pointless casting of g_malloc return
|
||||
if ($line =~ /\*\s*\)\s*g_(try)?(m|re)alloc(0?)(_n)?\b/) {
|
||||
if ($2 == 'm') {
|
||||
WARN("unnecessary cast may hide bugs, use g_$1new$3 instead\n" . $herecurr);
|
||||
ERROR("unnecessary cast may hide bugs, use g_$1new$3 instead\n" . $herecurr);
|
||||
} else {
|
||||
WARN("unnecessary cast may hide bugs, use g_$1renew$3 instead\n" . $herecurr);
|
||||
ERROR("unnecessary cast may hide bugs, use g_$1renew$3 instead\n" . $herecurr);
|
||||
}
|
||||
}
|
||||
|
||||
# check for gcc specific __FUNCTION__
|
||||
if ($line =~ /__FUNCTION__/) {
|
||||
WARN("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr);
|
||||
ERROR("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr);
|
||||
}
|
||||
|
||||
# recommend qemu_strto* over strto* for numeric conversions
|
||||
if ($line =~ /\b(strto[^kd].*?)\s*\(/) {
|
||||
WARN("consider using qemu_$1 in preference to $1\n" . $herecurr);
|
||||
ERROR("consider using qemu_$1 in preference to $1\n" . $herecurr);
|
||||
}
|
||||
# check for module_init(), use category-specific init macros explicitly please
|
||||
if ($line =~ /^module_init\s*\(/) {
|
||||
WARN("please use block_init(), type_init() etc. instead of module_init()\n" . $herecurr);
|
||||
ERROR("please use block_init(), type_init() etc. instead of module_init()\n" . $herecurr);
|
||||
}
|
||||
# check for various ops structs, ensure they are const.
|
||||
my $struct_ops = qr{AIOCBInfo|
|
||||
@@ -2488,7 +2489,7 @@ sub process {
|
||||
VMStateInfo}x;
|
||||
if ($line !~ /\bconst\b/ &&
|
||||
$line =~ /\b($struct_ops)\b/) {
|
||||
WARN("struct $1 should normally be const\n" .
|
||||
ERROR("struct $1 should normally be const\n" .
|
||||
$herecurr);
|
||||
}
|
||||
|
||||
@@ -2498,14 +2499,14 @@ sub process {
|
||||
$string = substr($rawline, $-[1], $+[1] - $-[1]);
|
||||
$string =~ s/%%/__/g;
|
||||
if ($string =~ /(?<!%)%L[udi]/) {
|
||||
WARN("\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr);
|
||||
ERROR("\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr);
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
# QEMU specific tests
|
||||
if ($rawline =~ /\b(?:Qemu|QEmu)\b/) {
|
||||
WARN("use QEMU instead of Qemu or QEmu\n" . $herecurr);
|
||||
ERROR("use QEMU instead of Qemu or QEmu\n" . $herecurr);
|
||||
}
|
||||
|
||||
# Qemu error function tests
|
||||
@@ -2522,7 +2523,7 @@ sub process {
|
||||
error_report}x;
|
||||
|
||||
if ($rawline =~ /\b(?:$qemu_error_funcs)\s*\(.*\".*\\n/) {
|
||||
WARN("Error messages should not contain newlines\n" . $herecurr);
|
||||
ERROR("Error messages should not contain newlines\n" . $herecurr);
|
||||
}
|
||||
|
||||
# Continue checking for error messages that contains newlines. This
|
||||
@@ -2543,7 +2544,7 @@ sub process {
|
||||
}
|
||||
|
||||
if ($rawlines[$i] =~ /\b(?:$qemu_error_funcs)\s*\(/) {
|
||||
WARN("Error messages should not contain newlines\n" . $herecurr);
|
||||
ERROR("Error messages should not contain newlines\n" . $herecurr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2591,7 +2592,6 @@ sub process {
|
||||
if ($summary && !($clean == 1 && $quiet == 1)) {
|
||||
print "$filename " if ($summary_file);
|
||||
print "total: $cnt_error errors, $cnt_warn warnings, " .
|
||||
(($check)? "$cnt_chk checks, " : "") .
|
||||
"$cnt_lines lines checked\n";
|
||||
print "\n" if ($quiet == 0);
|
||||
}
|
||||
@@ -2614,5 +2614,5 @@ sub process {
|
||||
print "CHECKPATCH in MAINTAINERS.\n";
|
||||
}
|
||||
|
||||
return $clean;
|
||||
return ($no_warnings ? $clean : $cnt_error == 0);
|
||||
}
|
||||
+11
-16
@@ -23,26 +23,21 @@ if magic != '\x55\xaa':
|
||||
|
||||
size_byte = ord(fin.read(1))
|
||||
fin.seek(0)
|
||||
data = fin.read()
|
||||
|
||||
if size_byte == 0:
|
||||
# If the caller left the size field blank then we will fill it in,
|
||||
# also rounding the whole input to a multiple of 512 bytes.
|
||||
data = fin.read()
|
||||
# +1 because we need a byte to store the checksum.
|
||||
size = len(data) + 1
|
||||
# Round up to next multiple of 512.
|
||||
size += 511
|
||||
size -= size % 512
|
||||
if size >= 65536:
|
||||
sys.exit("%s: option ROM size too large" % sys.argv[1])
|
||||
size = size_byte * 512
|
||||
if len(data) > size:
|
||||
sys.stderr.write('error: ROM is too large (%d > %d)\n' % (len(data), size))
|
||||
sys.exit(1)
|
||||
elif len(data) < size:
|
||||
# Add padding if necessary, rounding the whole input to a multiple of
|
||||
# 512 bytes according to the third byte of the input.
|
||||
# size-1 because a final byte is added below to store the checksum.
|
||||
data = data.ljust(size-1, '\0')
|
||||
data = data[:2] + chr(size/512) + data[3:]
|
||||
else:
|
||||
# Otherwise the input file specifies the size so use it.
|
||||
# -1 because we overwrite the last byte of the file with the checksum.
|
||||
size = size_byte * 512 - 1
|
||||
data = fin.read(size)
|
||||
if ord(data[-1:]) != 0:
|
||||
sys.stderr.write('WARNING: ROM includes nonzero checksum\n')
|
||||
data = data[:size-1]
|
||||
|
||||
fout.write(data)
|
||||
|
||||
|
||||
+5
-5
@@ -773,10 +773,10 @@ void slirp_pollfds_poll(GArray *pollfds, int select_error)
|
||||
|
||||
static void arp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len)
|
||||
{
|
||||
struct arphdr *ah = (struct arphdr *)(pkt + ETH_HLEN);
|
||||
uint8_t arp_reply[max(ETH_HLEN + sizeof(struct arphdr), 64)];
|
||||
struct slirp_arphdr *ah = (struct slirp_arphdr *)(pkt + ETH_HLEN);
|
||||
uint8_t arp_reply[max(ETH_HLEN + sizeof(struct slirp_arphdr), 64)];
|
||||
struct ethhdr *reh = (struct ethhdr *)arp_reply;
|
||||
struct arphdr *rah = (struct arphdr *)(arp_reply + ETH_HLEN);
|
||||
struct slirp_arphdr *rah = (struct slirp_arphdr *)(arp_reply + ETH_HLEN);
|
||||
int ar_op;
|
||||
struct ex_list *ex_ptr;
|
||||
|
||||
@@ -890,9 +890,9 @@ static int if_encap4(Slirp *slirp, struct mbuf *ifm, struct ethhdr *eh,
|
||||
return 1;
|
||||
}
|
||||
if (!arp_table_search(slirp, iph->ip_dst.s_addr, ethaddr)) {
|
||||
uint8_t arp_req[ETH_HLEN + sizeof(struct arphdr)];
|
||||
uint8_t arp_req[ETH_HLEN + sizeof(struct slirp_arphdr)];
|
||||
struct ethhdr *reh = (struct ethhdr *)arp_req;
|
||||
struct arphdr *rah = (struct arphdr *)(arp_req + ETH_HLEN);
|
||||
struct slirp_arphdr *rah = (struct slirp_arphdr *)(arp_req + ETH_HLEN);
|
||||
|
||||
if (!ifm->resolution_requested) {
|
||||
/* If the client addr is not known, send an ARP request */
|
||||
|
||||
+2
-2
@@ -105,7 +105,7 @@ struct ethhdr {
|
||||
unsigned short h_proto; /* packet type ID field */
|
||||
};
|
||||
|
||||
struct arphdr {
|
||||
struct slirp_arphdr {
|
||||
unsigned short ar_hrd; /* format of hardware address */
|
||||
unsigned short ar_pro; /* format of protocol address */
|
||||
unsigned char ar_hln; /* length of hardware address */
|
||||
@@ -124,7 +124,7 @@ struct arphdr {
|
||||
#define ARP_TABLE_SIZE 16
|
||||
|
||||
typedef struct ArpTable {
|
||||
struct arphdr table[ARP_TABLE_SIZE];
|
||||
struct slirp_arphdr table[ARP_TABLE_SIZE];
|
||||
int next_victim;
|
||||
} ArpTable;
|
||||
|
||||
|
||||
@@ -1051,7 +1051,7 @@ uint64_t HELPER(neon_qrshl_u64)(CPUARMState *env, uint64_t val, uint64_t shiftop
|
||||
if (tmp >= (ssize_t)sizeof(src1) * 8) { \
|
||||
if (src1) { \
|
||||
SET_QC(); \
|
||||
dest = (1 << (sizeof(src1) * 8 - 1)); \
|
||||
dest = (typeof(dest))(1 << (sizeof(src1) * 8 - 1)); \
|
||||
if (src1 > 0) { \
|
||||
dest--; \
|
||||
} \
|
||||
|
||||
@@ -329,6 +329,13 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
|
||||
*/
|
||||
cpuid_1_edx = kvm_arch_get_supported_cpuid(s, 1, 0, R_EDX);
|
||||
ret |= cpuid_1_edx & CPUID_EXT2_AMD_ALIASES;
|
||||
} else if (function == KVM_CPUID_FEATURES && reg == R_EAX) {
|
||||
/* kvm_pv_unhalt is reported by GET_SUPPORTED_CPUID, but it can't
|
||||
* be enabled without the in-kernel irqchip
|
||||
*/
|
||||
if (!kvm_irqchip_in_kernel()) {
|
||||
ret &= ~(1U << KVM_FEATURE_PV_UNHALT);
|
||||
}
|
||||
}
|
||||
|
||||
/* fallback for older kernels */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See docs/trace-events.txt for syntax documentation.
|
||||
# See docs/tracing.txt for syntax documentation.
|
||||
|
||||
# target-i386/kvm.c
|
||||
kvm_x86_fixup_msi_error(uint32_t gsi) "VT-d failed to remap interrupt for GSI %" PRIu32
|
||||
|
||||
@@ -220,6 +220,11 @@ int cpu_get_dump_info(ArchDumpInfo *info,
|
||||
} else {
|
||||
info->d_endian = ELFDATA2LSB;
|
||||
}
|
||||
/* 64KB is the max page size for pseries kernel */
|
||||
if (strncmp(object_get_typename(qdev_get_machine()),
|
||||
"pseries-", 8) == 0) {
|
||||
info->page_size = (1U << 16);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1201,6 +1201,7 @@ extern const struct VMStateDescription vmstate_ppc_cpu;
|
||||
/*****************************************************************************/
|
||||
PowerPCCPU *cpu_ppc_init(const char *cpu_model);
|
||||
void ppc_translate_init(void);
|
||||
const char *ppc_cpu_lookup_alias(const char *alias);
|
||||
void gen_update_current_nip(void *opaque);
|
||||
/* you can call this signal handler from your SIGBUS and SIGSEGV
|
||||
signal handlers to inform the virtual CPU of exceptions. non zero
|
||||
|
||||
+11
-8
@@ -2394,6 +2394,13 @@ static int kvm_ppc_register_host_cpu_type(void)
|
||||
type_info.parent = object_class_get_name(OBJECT_CLASS(pvr_pcc));
|
||||
type_register(&type_info);
|
||||
|
||||
/* Register generic family CPU class for a family */
|
||||
pvr_pcc = ppc_cpu_get_family_class(pvr_pcc);
|
||||
dc = DEVICE_CLASS(pvr_pcc);
|
||||
type_info.parent = object_class_get_name(OBJECT_CLASS(pvr_pcc));
|
||||
type_info.name = g_strdup_printf("%s-"TYPE_POWERPC_CPU, dc->desc);
|
||||
type_register(&type_info);
|
||||
|
||||
#if defined(TARGET_PPC64)
|
||||
type_info.name = g_strdup_printf("%s-"TYPE_SPAPR_CPU_CORE, "host");
|
||||
type_info.parent = TYPE_SPAPR_CPU_CORE,
|
||||
@@ -2402,16 +2409,12 @@ static int kvm_ppc_register_host_cpu_type(void)
|
||||
type_info.class_init = NULL;
|
||||
type_register(&type_info);
|
||||
g_free((void *)type_info.name);
|
||||
type_info.instance_size = 0;
|
||||
type_info.instance_init = NULL;
|
||||
#endif
|
||||
|
||||
/* Register generic family CPU class for a family */
|
||||
pvr_pcc = ppc_cpu_get_family_class(pvr_pcc);
|
||||
dc = DEVICE_CLASS(pvr_pcc);
|
||||
type_info.parent = object_class_get_name(OBJECT_CLASS(pvr_pcc));
|
||||
type_info.name = g_strdup_printf("%s-"TYPE_POWERPC_CPU, dc->desc);
|
||||
/* Register generic spapr CPU family class for current host CPU type */
|
||||
type_info.name = g_strdup_printf("%s-"TYPE_SPAPR_CPU_CORE, dc->desc);
|
||||
type_register(&type_info);
|
||||
g_free((void *)type_info.name);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loaded 100 of 116 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user