mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits15cc923584,f40d753718,96555a96d7and3990d09adfbut the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
@@ -64,7 +64,7 @@ qemu_acl *qemu_acl_init(const char *aclname)
|
||||
acl->defaultDeny = 1;
|
||||
|
||||
acl->nentries = 0;
|
||||
TAILQ_INIT(&acl->entries);
|
||||
QTAILQ_INIT(&acl->entries);
|
||||
|
||||
acls = qemu_realloc(acls, sizeof(*acls) * (nacls +1));
|
||||
acls[nacls] = acl;
|
||||
@@ -78,7 +78,7 @@ int qemu_acl_party_is_allowed(qemu_acl *acl,
|
||||
{
|
||||
qemu_acl_entry *entry;
|
||||
|
||||
TAILQ_FOREACH(entry, &acl->entries, next) {
|
||||
QTAILQ_FOREACH(entry, &acl->entries, next) {
|
||||
#ifdef CONFIG_FNMATCH
|
||||
if (fnmatch(entry->match, party, 0) == 0)
|
||||
return entry->deny ? 0 : 1;
|
||||
@@ -102,8 +102,8 @@ void qemu_acl_reset(qemu_acl *acl)
|
||||
* of "open access" while the user re-initializes the
|
||||
* access control list */
|
||||
acl->defaultDeny = 1;
|
||||
TAILQ_FOREACH(entry, &acl->entries, next) {
|
||||
TAILQ_REMOVE(&acl->entries, entry, next);
|
||||
QTAILQ_FOREACH(entry, &acl->entries, next) {
|
||||
QTAILQ_REMOVE(&acl->entries, entry, next);
|
||||
free(entry->match);
|
||||
free(entry);
|
||||
}
|
||||
@@ -121,7 +121,7 @@ int qemu_acl_append(qemu_acl *acl,
|
||||
entry->match = qemu_strdup(match);
|
||||
entry->deny = deny;
|
||||
|
||||
TAILQ_INSERT_TAIL(&acl->entries, entry, next);
|
||||
QTAILQ_INSERT_TAIL(&acl->entries, entry, next);
|
||||
acl->nentries++;
|
||||
|
||||
return acl->nentries;
|
||||
@@ -147,10 +147,10 @@ int qemu_acl_insert(qemu_acl *acl,
|
||||
entry->match = qemu_strdup(match);
|
||||
entry->deny = deny;
|
||||
|
||||
TAILQ_FOREACH(tmp, &acl->entries, next) {
|
||||
QTAILQ_FOREACH(tmp, &acl->entries, next) {
|
||||
i++;
|
||||
if (i == index) {
|
||||
TAILQ_INSERT_BEFORE(tmp, entry, next);
|
||||
QTAILQ_INSERT_BEFORE(tmp, entry, next);
|
||||
acl->nentries++;
|
||||
break;
|
||||
}
|
||||
@@ -165,10 +165,10 @@ int qemu_acl_remove(qemu_acl *acl,
|
||||
qemu_acl_entry *entry;
|
||||
int i = 0;
|
||||
|
||||
TAILQ_FOREACH(entry, &acl->entries, next) {
|
||||
QTAILQ_FOREACH(entry, &acl->entries, next) {
|
||||
i++;
|
||||
if (strcmp(entry->match, match) == 0) {
|
||||
TAILQ_REMOVE(&acl->entries, entry, next);
|
||||
QTAILQ_REMOVE(&acl->entries, entry, next);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifndef __QEMU_ACL_H__
|
||||
#define __QEMU_ACL_H__
|
||||
|
||||
#include "sys-queue.h"
|
||||
#include "qemu-queue.h"
|
||||
|
||||
typedef struct qemu_acl_entry qemu_acl_entry;
|
||||
typedef struct qemu_acl qemu_acl;
|
||||
@@ -34,13 +34,13 @@ struct qemu_acl_entry {
|
||||
char *match;
|
||||
int deny;
|
||||
|
||||
TAILQ_ENTRY(qemu_acl_entry) next;
|
||||
QTAILQ_ENTRY(qemu_acl_entry) next;
|
||||
};
|
||||
|
||||
struct qemu_acl {
|
||||
char *aclname;
|
||||
unsigned int nentries;
|
||||
TAILQ_HEAD(,qemu_acl_entry) entries;
|
||||
QTAILQ_HEAD(,qemu_acl_entry) entries;
|
||||
int defaultDeny;
|
||||
};
|
||||
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
|
||||
#include "qemu-common.h"
|
||||
#include "block.h"
|
||||
#include "sys-queue.h"
|
||||
#include "qemu-queue.h"
|
||||
#include "qemu_socket.h"
|
||||
|
||||
typedef struct AioHandler AioHandler;
|
||||
|
||||
/* The list of registered AIO handlers */
|
||||
static LIST_HEAD(, AioHandler) aio_handlers;
|
||||
static QLIST_HEAD(, AioHandler) aio_handlers;
|
||||
|
||||
/* This is a simple lock used to protect the aio_handlers list. Specifically,
|
||||
* it's used to ensure that no callbacks are removed while we're walking and
|
||||
@@ -35,14 +35,14 @@ struct AioHandler
|
||||
AioFlushHandler *io_flush;
|
||||
int deleted;
|
||||
void *opaque;
|
||||
LIST_ENTRY(AioHandler) node;
|
||||
QLIST_ENTRY(AioHandler) node;
|
||||
};
|
||||
|
||||
static AioHandler *find_aio_handler(int fd)
|
||||
{
|
||||
AioHandler *node;
|
||||
|
||||
LIST_FOREACH(node, &aio_handlers, node) {
|
||||
QLIST_FOREACH(node, &aio_handlers, node) {
|
||||
if (node->fd == fd)
|
||||
if (!node->deleted)
|
||||
return node;
|
||||
@@ -72,7 +72,7 @@ int qemu_aio_set_fd_handler(int fd,
|
||||
* deleted because deleted nodes are only cleaned up after
|
||||
* releasing the walking_handlers lock.
|
||||
*/
|
||||
LIST_REMOVE(node, node);
|
||||
QLIST_REMOVE(node, node);
|
||||
qemu_free(node);
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ int qemu_aio_set_fd_handler(int fd,
|
||||
/* Alloc and insert if it's not already there */
|
||||
node = qemu_mallocz(sizeof(AioHandler));
|
||||
node->fd = fd;
|
||||
LIST_INSERT_HEAD(&aio_handlers, node, node);
|
||||
QLIST_INSERT_HEAD(&aio_handlers, node, node);
|
||||
}
|
||||
/* Update handler with latest information */
|
||||
node->io_read = io_read;
|
||||
@@ -109,7 +109,7 @@ void qemu_aio_flush(void)
|
||||
*/
|
||||
qemu_aio_wait();
|
||||
|
||||
LIST_FOREACH(node, &aio_handlers, node) {
|
||||
QLIST_FOREACH(node, &aio_handlers, node) {
|
||||
ret |= node->io_flush(node->opaque);
|
||||
}
|
||||
} while (qemu_bh_poll() || ret > 0);
|
||||
@@ -133,7 +133,7 @@ void qemu_aio_wait(void)
|
||||
FD_ZERO(&wrfds);
|
||||
|
||||
/* fill fd sets */
|
||||
LIST_FOREACH(node, &aio_handlers, node) {
|
||||
QLIST_FOREACH(node, &aio_handlers, node) {
|
||||
/* If there aren't pending AIO operations, don't invoke callbacks.
|
||||
* Otherwise, if there are no AIO requests, qemu_aio_wait() would
|
||||
* wait indefinitely.
|
||||
@@ -168,7 +168,7 @@ void qemu_aio_wait(void)
|
||||
|
||||
/* we have to walk very carefully in case
|
||||
* qemu_aio_set_fd_handler is called while we're walking */
|
||||
node = LIST_FIRST(&aio_handlers);
|
||||
node = QLIST_FIRST(&aio_handlers);
|
||||
while (node) {
|
||||
AioHandler *tmp;
|
||||
|
||||
@@ -184,10 +184,10 @@ void qemu_aio_wait(void)
|
||||
}
|
||||
|
||||
tmp = node;
|
||||
node = LIST_NEXT(node, node);
|
||||
node = QLIST_NEXT(node, node);
|
||||
|
||||
if (tmp->deleted) {
|
||||
LIST_REMOVE(tmp, node);
|
||||
QLIST_REMOVE(tmp, node);
|
||||
qemu_free(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
+19
-19
@@ -766,8 +766,8 @@ static void audio_detach_capture (HWVoiceOut *hw)
|
||||
sw->rate = NULL;
|
||||
}
|
||||
|
||||
LIST_REMOVE (sw, entries);
|
||||
LIST_REMOVE (sc, entries);
|
||||
QLIST_REMOVE (sw, entries);
|
||||
QLIST_REMOVE (sc, entries);
|
||||
qemu_free (sc);
|
||||
if (was_active) {
|
||||
/* We have removed soft voice from the capture:
|
||||
@@ -811,8 +811,8 @@ static int audio_attach_capture (HWVoiceOut *hw)
|
||||
qemu_free (sw);
|
||||
return -1;
|
||||
}
|
||||
LIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
|
||||
LIST_INSERT_HEAD (&hw->cap_head, sc, entries);
|
||||
QLIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
|
||||
QLIST_INSERT_HEAD (&hw->cap_head, sc, entries);
|
||||
#ifdef DEBUG_CAPTURE
|
||||
asprintf (&sw->name, "for %p %d,%d,%d",
|
||||
hw, sw->info.freq, sw->info.bits, sw->info.nchannels);
|
||||
@@ -1803,9 +1803,9 @@ static void audio_init (void)
|
||||
return;
|
||||
}
|
||||
|
||||
LIST_INIT (&s->hw_head_out);
|
||||
LIST_INIT (&s->hw_head_in);
|
||||
LIST_INIT (&s->cap_head);
|
||||
QLIST_INIT (&s->hw_head_out);
|
||||
QLIST_INIT (&s->hw_head_in);
|
||||
QLIST_INIT (&s->cap_head);
|
||||
atexit (audio_atexit);
|
||||
|
||||
s->ts = qemu_new_timer (vm_clock, audio_timer, s);
|
||||
@@ -1887,7 +1887,7 @@ static void audio_init (void)
|
||||
"(Audio can continue looping even after stopping the VM)\n");
|
||||
}
|
||||
|
||||
LIST_INIT (&s->card_head);
|
||||
QLIST_INIT (&s->card_head);
|
||||
register_savevm ("audio", 0, 1, audio_save, audio_load, s);
|
||||
}
|
||||
|
||||
@@ -1896,12 +1896,12 @@ void AUD_register_card (const char *name, QEMUSoundCard *card)
|
||||
audio_init ();
|
||||
card->name = qemu_strdup (name);
|
||||
memset (&card->entries, 0, sizeof (card->entries));
|
||||
LIST_INSERT_HEAD (&glob_audio_state.card_head, card, entries);
|
||||
QLIST_INSERT_HEAD (&glob_audio_state.card_head, card, entries);
|
||||
}
|
||||
|
||||
void AUD_remove_card (QEMUSoundCard *card)
|
||||
{
|
||||
LIST_REMOVE (card, entries);
|
||||
QLIST_REMOVE (card, entries);
|
||||
qemu_free (card->name);
|
||||
}
|
||||
|
||||
@@ -1933,7 +1933,7 @@ CaptureVoiceOut *AUD_add_capture (
|
||||
|
||||
cap = audio_pcm_capture_find_specific (as);
|
||||
if (cap) {
|
||||
LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
|
||||
QLIST_INSERT_HEAD (&cap->cb_head, cb, entries);
|
||||
return cap;
|
||||
}
|
||||
else {
|
||||
@@ -1948,8 +1948,8 @@ CaptureVoiceOut *AUD_add_capture (
|
||||
}
|
||||
|
||||
hw = &cap->hw;
|
||||
LIST_INIT (&hw->sw_head);
|
||||
LIST_INIT (&cap->cb_head);
|
||||
QLIST_INIT (&hw->sw_head);
|
||||
QLIST_INIT (&cap->cb_head);
|
||||
|
||||
/* XXX find a more elegant way */
|
||||
hw->samples = 4096 * 4;
|
||||
@@ -1977,8 +1977,8 @@ CaptureVoiceOut *AUD_add_capture (
|
||||
[hw->info.swap_endianness]
|
||||
[audio_bits_to_index (hw->info.bits)];
|
||||
|
||||
LIST_INSERT_HEAD (&s->cap_head, cap, entries);
|
||||
LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
|
||||
QLIST_INSERT_HEAD (&s->cap_head, cap, entries);
|
||||
QLIST_INSERT_HEAD (&cap->cb_head, cb, entries);
|
||||
|
||||
hw = NULL;
|
||||
while ((hw = audio_pcm_hw_find_any_out (hw))) {
|
||||
@@ -2004,7 +2004,7 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque)
|
||||
for (cb = cap->cb_head.lh_first; cb; cb = cb->entries.le_next) {
|
||||
if (cb->opaque == cb_opaque) {
|
||||
cb->ops.destroy (cb_opaque);
|
||||
LIST_REMOVE (cb, entries);
|
||||
QLIST_REMOVE (cb, entries);
|
||||
qemu_free (cb);
|
||||
|
||||
if (!cap->cb_head.lh_first) {
|
||||
@@ -2021,12 +2021,12 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque)
|
||||
st_rate_stop (sw->rate);
|
||||
sw->rate = NULL;
|
||||
}
|
||||
LIST_REMOVE (sw, entries);
|
||||
LIST_REMOVE (sc, entries);
|
||||
QLIST_REMOVE (sw, entries);
|
||||
QLIST_REMOVE (sc, entries);
|
||||
qemu_free (sc);
|
||||
sw = sw1;
|
||||
}
|
||||
LIST_REMOVE (cap, entries);
|
||||
QLIST_REMOVE (cap, entries);
|
||||
qemu_free (cap);
|
||||
}
|
||||
return;
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@
|
||||
#define QEMU_AUDIO_H
|
||||
|
||||
#include "config-host.h"
|
||||
#include "sys-queue.h"
|
||||
#include "qemu-queue.h"
|
||||
|
||||
typedef void (*audio_callback_fn_t) (void *opaque, int avail);
|
||||
|
||||
@@ -70,7 +70,7 @@ struct capture_ops {
|
||||
typedef struct CaptureState {
|
||||
void *opaque;
|
||||
struct capture_ops ops;
|
||||
LIST_ENTRY (CaptureState) entries;
|
||||
QLIST_ENTRY (CaptureState) entries;
|
||||
} CaptureState;
|
||||
|
||||
typedef struct SWVoiceOut SWVoiceOut;
|
||||
@@ -79,7 +79,7 @@ typedef struct SWVoiceIn SWVoiceIn;
|
||||
|
||||
typedef struct QEMUSoundCard {
|
||||
char *name;
|
||||
LIST_ENTRY (QEMUSoundCard) entries;
|
||||
QLIST_ENTRY (QEMUSoundCard) entries;
|
||||
} QEMUSoundCard;
|
||||
|
||||
typedef struct QEMUAudioTimeStamp {
|
||||
|
||||
+15
-15
@@ -80,10 +80,10 @@ typedef struct HWVoiceOut {
|
||||
struct st_sample *mix_buf;
|
||||
|
||||
int samples;
|
||||
LIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
|
||||
LIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
|
||||
QLIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
|
||||
QLIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
|
||||
struct audio_pcm_ops *pcm_ops;
|
||||
LIST_ENTRY (HWVoiceOut) entries;
|
||||
QLIST_ENTRY (HWVoiceOut) entries;
|
||||
} HWVoiceOut;
|
||||
|
||||
typedef struct HWVoiceIn {
|
||||
@@ -100,9 +100,9 @@ typedef struct HWVoiceIn {
|
||||
struct st_sample *conv_buf;
|
||||
|
||||
int samples;
|
||||
LIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
|
||||
QLIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
|
||||
struct audio_pcm_ops *pcm_ops;
|
||||
LIST_ENTRY (HWVoiceIn) entries;
|
||||
QLIST_ENTRY (HWVoiceIn) entries;
|
||||
} HWVoiceIn;
|
||||
|
||||
struct SWVoiceOut {
|
||||
@@ -119,7 +119,7 @@ struct SWVoiceOut {
|
||||
char *name;
|
||||
struct mixeng_volume vol;
|
||||
struct audio_callback callback;
|
||||
LIST_ENTRY (SWVoiceOut) entries;
|
||||
QLIST_ENTRY (SWVoiceOut) entries;
|
||||
};
|
||||
|
||||
struct SWVoiceIn {
|
||||
@@ -135,7 +135,7 @@ struct SWVoiceIn {
|
||||
char *name;
|
||||
struct mixeng_volume vol;
|
||||
struct audio_callback callback;
|
||||
LIST_ENTRY (SWVoiceIn) entries;
|
||||
QLIST_ENTRY (SWVoiceIn) entries;
|
||||
};
|
||||
|
||||
struct audio_driver {
|
||||
@@ -169,20 +169,20 @@ struct audio_pcm_ops {
|
||||
struct capture_callback {
|
||||
struct audio_capture_ops ops;
|
||||
void *opaque;
|
||||
LIST_ENTRY (capture_callback) entries;
|
||||
QLIST_ENTRY (capture_callback) entries;
|
||||
};
|
||||
|
||||
struct CaptureVoiceOut {
|
||||
HWVoiceOut hw;
|
||||
void *buf;
|
||||
LIST_HEAD (cb_listhead, capture_callback) cb_head;
|
||||
LIST_ENTRY (CaptureVoiceOut) entries;
|
||||
QLIST_HEAD (cb_listhead, capture_callback) cb_head;
|
||||
QLIST_ENTRY (CaptureVoiceOut) entries;
|
||||
};
|
||||
|
||||
struct SWVoiceCap {
|
||||
SWVoiceOut sw;
|
||||
CaptureVoiceOut *cap;
|
||||
LIST_ENTRY (SWVoiceCap) entries;
|
||||
QLIST_ENTRY (SWVoiceCap) entries;
|
||||
};
|
||||
|
||||
struct AudioState {
|
||||
@@ -190,10 +190,10 @@ struct AudioState {
|
||||
void *drv_opaque;
|
||||
|
||||
QEMUTimer *ts;
|
||||
LIST_HEAD (card_listhead, QEMUSoundCard) card_head;
|
||||
LIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
|
||||
LIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
|
||||
LIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head;
|
||||
QLIST_HEAD (card_listhead, QEMUSoundCard) card_head;
|
||||
QLIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
|
||||
QLIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
|
||||
QLIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head;
|
||||
int nb_hw_voices_out;
|
||||
int nb_hw_voices_in;
|
||||
int vm_running;
|
||||
|
||||
@@ -184,12 +184,12 @@ static void glue (audio_pcm_sw_fini_, TYPE) (SW *sw)
|
||||
|
||||
static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw)
|
||||
{
|
||||
LIST_INSERT_HEAD (&hw->sw_head, sw, entries);
|
||||
QLIST_INSERT_HEAD (&hw->sw_head, sw, entries);
|
||||
}
|
||||
|
||||
static void glue (audio_pcm_hw_del_sw_, TYPE) (SW *sw)
|
||||
{
|
||||
LIST_REMOVE (sw, entries);
|
||||
QLIST_REMOVE (sw, entries);
|
||||
}
|
||||
|
||||
static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp)
|
||||
@@ -201,7 +201,7 @@ static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp)
|
||||
#ifdef DAC
|
||||
audio_detach_capture (hw);
|
||||
#endif
|
||||
LIST_REMOVE (hw, entries);
|
||||
QLIST_REMOVE (hw, entries);
|
||||
glue (s->nb_hw_voices_, TYPE) += 1;
|
||||
glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
|
||||
glue (hw->pcm_ops->fini_, TYPE) (hw);
|
||||
@@ -267,9 +267,9 @@ static HW *glue (audio_pcm_hw_add_new_, TYPE) (struct audsettings *as)
|
||||
}
|
||||
|
||||
hw->pcm_ops = drv->pcm_ops;
|
||||
LIST_INIT (&hw->sw_head);
|
||||
QLIST_INIT (&hw->sw_head);
|
||||
#ifdef DAC
|
||||
LIST_INIT (&hw->cap_head);
|
||||
QLIST_INIT (&hw->cap_head);
|
||||
#endif
|
||||
if (glue (hw->pcm_ops->init_, TYPE) (hw, as)) {
|
||||
goto err0;
|
||||
@@ -294,7 +294,7 @@ static HW *glue (audio_pcm_hw_add_new_, TYPE) (struct audsettings *as)
|
||||
goto err1;
|
||||
}
|
||||
|
||||
LIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
|
||||
QLIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
|
||||
glue (s->nb_hw_voices_, TYPE) -= 1;
|
||||
#ifdef DAC
|
||||
audio_attach_capture (hw);
|
||||
|
||||
@@ -22,11 +22,6 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "config-host.h"
|
||||
#ifdef CONFIG_BSD
|
||||
/* include native header before sys-queue.h */
|
||||
#include <sys/queue.h>
|
||||
#endif
|
||||
|
||||
#include "qemu-common.h"
|
||||
#include "monitor.h"
|
||||
#include "block_int.h"
|
||||
@@ -36,6 +31,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/queue.h>
|
||||
#ifndef __DragonFly__
|
||||
#include <sys/disk.h>
|
||||
#endif
|
||||
|
||||
@@ -738,7 +738,7 @@ uint64_t qcow2_alloc_cluster_offset(BlockDriverState *bs,
|
||||
* the same cluster. In this case we need to wait until the previous
|
||||
* request has completed and updated the L2 table accordingly.
|
||||
*/
|
||||
LIST_FOREACH(old_alloc, &s->cluster_allocs, next_in_flight) {
|
||||
QLIST_FOREACH(old_alloc, &s->cluster_allocs, next_in_flight) {
|
||||
|
||||
uint64_t end_offset = offset + nb_clusters * s->cluster_size;
|
||||
uint64_t old_offset = old_alloc->offset;
|
||||
@@ -769,7 +769,7 @@ uint64_t qcow2_alloc_cluster_offset(BlockDriverState *bs,
|
||||
abort();
|
||||
}
|
||||
|
||||
LIST_INSERT_HEAD(&s->cluster_allocs, m, next_in_flight);
|
||||
QLIST_INSERT_HEAD(&s->cluster_allocs, m, next_in_flight);
|
||||
|
||||
/* allocate a new cluster */
|
||||
|
||||
|
||||
+8
-8
@@ -219,7 +219,7 @@ static int qcow_open(BlockDriverState *bs, const char *filename, int flags)
|
||||
if (qcow2_refcount_init(bs) < 0)
|
||||
goto fail;
|
||||
|
||||
LIST_INIT(&s->cluster_allocs);
|
||||
QLIST_INIT(&s->cluster_allocs);
|
||||
|
||||
/* read qcow2 extensions */
|
||||
if (header.backing_file_offset)
|
||||
@@ -340,7 +340,7 @@ typedef struct QCowAIOCB {
|
||||
QEMUIOVector hd_qiov;
|
||||
QEMUBH *bh;
|
||||
QCowL2Meta l2meta;
|
||||
LIST_ENTRY(QCowAIOCB) next_depend;
|
||||
QLIST_ENTRY(QCowAIOCB) next_depend;
|
||||
} QCowAIOCB;
|
||||
|
||||
static void qcow_aio_cancel(BlockDriverAIOCB *blockacb)
|
||||
@@ -503,7 +503,7 @@ static QCowAIOCB *qcow_aio_setup(BlockDriverState *bs,
|
||||
acb->n = 0;
|
||||
acb->cluster_offset = 0;
|
||||
acb->l2meta.nb_clusters = 0;
|
||||
LIST_INIT(&acb->l2meta.dependent_requests);
|
||||
QLIST_INIT(&acb->l2meta.dependent_requests);
|
||||
return acb;
|
||||
}
|
||||
|
||||
@@ -530,12 +530,12 @@ static void run_dependent_requests(QCowL2Meta *m)
|
||||
|
||||
/* Take the request off the list of running requests */
|
||||
if (m->nb_clusters != 0) {
|
||||
LIST_REMOVE(m, next_in_flight);
|
||||
QLIST_REMOVE(m, next_in_flight);
|
||||
}
|
||||
|
||||
/*
|
||||
* Restart all dependent requests.
|
||||
* Can't use LIST_FOREACH here - the next link might not be the same
|
||||
* Can't use QLIST_FOREACH here - the next link might not be the same
|
||||
* any more after the callback (request could depend on a different
|
||||
* request now)
|
||||
*/
|
||||
@@ -545,7 +545,7 @@ static void run_dependent_requests(QCowL2Meta *m)
|
||||
}
|
||||
|
||||
/* Empty the list for the next part of the request */
|
||||
LIST_INIT(&m->dependent_requests);
|
||||
QLIST_INIT(&m->dependent_requests);
|
||||
}
|
||||
|
||||
static void qcow_aio_write_cb(void *opaque, int ret)
|
||||
@@ -590,7 +590,7 @@ static void qcow_aio_write_cb(void *opaque, int ret)
|
||||
|
||||
/* Need to wait for another request? If so, we are done for now. */
|
||||
if (!acb->cluster_offset && acb->l2meta.depends_on != NULL) {
|
||||
LIST_INSERT_HEAD(&acb->l2meta.depends_on->dependent_requests,
|
||||
QLIST_INSERT_HEAD(&acb->l2meta.depends_on->dependent_requests,
|
||||
acb, next_depend);
|
||||
return;
|
||||
}
|
||||
@@ -690,7 +690,7 @@ static int preallocate(BlockDriverState *bs)
|
||||
|
||||
nb_sectors = bdrv_getlength(bs) >> 9;
|
||||
offset = 0;
|
||||
LIST_INIT(&meta.dependent_requests);
|
||||
QLIST_INIT(&meta.dependent_requests);
|
||||
|
||||
while (nb_sectors) {
|
||||
num = MIN(nb_sectors, INT_MAX >> 9);
|
||||
|
||||
+3
-3
@@ -98,7 +98,7 @@ typedef struct BDRVQcowState {
|
||||
uint8_t *cluster_cache;
|
||||
uint8_t *cluster_data;
|
||||
uint64_t cluster_cache_offset;
|
||||
LIST_HEAD(QCowClusterAlloc, QCowL2Meta) cluster_allocs;
|
||||
QLIST_HEAD(QCowClusterAlloc, QCowL2Meta) cluster_allocs;
|
||||
|
||||
uint64_t *refcount_table;
|
||||
uint64_t refcount_table_offset;
|
||||
@@ -139,9 +139,9 @@ typedef struct QCowL2Meta
|
||||
int nb_available;
|
||||
int nb_clusters;
|
||||
struct QCowL2Meta *depends_on;
|
||||
LIST_HEAD(QCowAioDependencies, QCowAIOCB) dependent_requests;
|
||||
QLIST_HEAD(QCowAioDependencies, QCowAIOCB) dependent_requests;
|
||||
|
||||
LIST_ENTRY(QCowL2Meta) next_in_flight;
|
||||
QLIST_ENTRY(QCowL2Meta) next_in_flight;
|
||||
} QCowL2Meta;
|
||||
|
||||
static inline int size_to_clusters(BDRVQcowState *s, int64_t size)
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ START_TEST(qdict_put_obj_test)
|
||||
qdict_put_obj(qdict, "", QOBJECT(qint_from_int(num)));
|
||||
|
||||
fail_unless(qdict_size(qdict) == 1);
|
||||
ent = LIST_FIRST(&qdict->table[12345 % QDICT_HASH_SIZE]);
|
||||
ent = QLIST_FIRST(&qdict->table[12345 % QDICT_HASH_SIZE]);
|
||||
qi = qobject_to_qint(ent->value);
|
||||
fail_unless(qint_get_int(qi) == num);
|
||||
|
||||
|
||||
+5
-5
@@ -28,7 +28,7 @@
|
||||
#include <inttypes.h>
|
||||
#include <signal.h>
|
||||
#include "osdep.h"
|
||||
#include "sys-queue.h"
|
||||
#include "qemu-queue.h"
|
||||
#include "targphys.h"
|
||||
|
||||
#ifndef TARGET_LONG_BITS
|
||||
@@ -124,14 +124,14 @@ struct KVMState;
|
||||
typedef struct CPUBreakpoint {
|
||||
target_ulong pc;
|
||||
int flags; /* BP_* */
|
||||
TAILQ_ENTRY(CPUBreakpoint) entry;
|
||||
QTAILQ_ENTRY(CPUBreakpoint) entry;
|
||||
} CPUBreakpoint;
|
||||
|
||||
typedef struct CPUWatchpoint {
|
||||
target_ulong vaddr;
|
||||
target_ulong len_mask;
|
||||
int flags; /* BP_* */
|
||||
TAILQ_ENTRY(CPUWatchpoint) entry;
|
||||
QTAILQ_ENTRY(CPUWatchpoint) entry;
|
||||
} CPUWatchpoint;
|
||||
|
||||
#define CPU_TEMP_BUF_NLONGS 128
|
||||
@@ -169,10 +169,10 @@ typedef struct CPUWatchpoint {
|
||||
\
|
||||
/* from this point: preserved by CPU reset */ \
|
||||
/* ice debug support */ \
|
||||
TAILQ_HEAD(breakpoints_head, CPUBreakpoint) breakpoints; \
|
||||
QTAILQ_HEAD(breakpoints_head, CPUBreakpoint) breakpoints; \
|
||||
int singlestep_enabled; \
|
||||
\
|
||||
TAILQ_HEAD(watchpoints_head, CPUWatchpoint) watchpoints; \
|
||||
QTAILQ_HEAD(watchpoints_head, CPUWatchpoint) watchpoints; \
|
||||
CPUWatchpoint *watchpoint_hit; \
|
||||
\
|
||||
struct GDBRegisterState *gdb_regs; \
|
||||
|
||||
+1
-1
@@ -202,7 +202,7 @@ static void cpu_handle_debug_exception(CPUState *env)
|
||||
CPUWatchpoint *wp;
|
||||
|
||||
if (!env->watchpoint_hit)
|
||||
TAILQ_FOREACH(wp, &env->watchpoints, entry)
|
||||
QTAILQ_FOREACH(wp, &env->watchpoints, entry)
|
||||
wp->flags &= ~BP_WATCHPOINT_HIT;
|
||||
|
||||
if (debug_excp_handler)
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
#include <sys/queue.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "qemu-queue.h"
|
||||
#include "envlist.h"
|
||||
|
||||
struct envlist_entry {
|
||||
const char *ev_var; /* actual env value */
|
||||
LIST_ENTRY(envlist_entry) ev_link;
|
||||
QLIST_ENTRY(envlist_entry) ev_link;
|
||||
};
|
||||
|
||||
struct envlist {
|
||||
LIST_HEAD(, envlist_entry) el_entries; /* actual entries */
|
||||
QLIST_HEAD(, envlist_entry) el_entries; /* actual entries */
|
||||
size_t el_count; /* number of entries */
|
||||
};
|
||||
|
||||
@@ -33,7 +32,7 @@ envlist_create(void)
|
||||
if ((envlist = malloc(sizeof (*envlist))) == NULL)
|
||||
return (NULL);
|
||||
|
||||
LIST_INIT(&envlist->el_entries);
|
||||
QLIST_INIT(&envlist->el_entries);
|
||||
envlist->el_count = 0;
|
||||
|
||||
return (envlist);
|
||||
@@ -51,7 +50,7 @@ envlist_free(envlist_t *envlist)
|
||||
|
||||
while (envlist->el_entries.lh_first != NULL) {
|
||||
entry = envlist->el_entries.lh_first;
|
||||
LIST_REMOVE(entry, ev_link);
|
||||
QLIST_REMOVE(entry, ev_link);
|
||||
|
||||
free((char *)entry->ev_var);
|
||||
free(entry);
|
||||
@@ -159,7 +158,7 @@ envlist_setenv(envlist_t *envlist, const char *env)
|
||||
}
|
||||
|
||||
if (entry != NULL) {
|
||||
LIST_REMOVE(entry, ev_link);
|
||||
QLIST_REMOVE(entry, ev_link);
|
||||
free((char *)entry->ev_var);
|
||||
free(entry);
|
||||
} else {
|
||||
@@ -172,7 +171,7 @@ envlist_setenv(envlist_t *envlist, const char *env)
|
||||
free(entry);
|
||||
return (errno);
|
||||
}
|
||||
LIST_INSERT_HEAD(&envlist->el_entries, entry, ev_link);
|
||||
QLIST_INSERT_HEAD(&envlist->el_entries, entry, ev_link);
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -205,7 +204,7 @@ envlist_unsetenv(envlist_t *envlist, const char *env)
|
||||
break;
|
||||
}
|
||||
if (entry != NULL) {
|
||||
LIST_REMOVE(entry, ev_link);
|
||||
QLIST_REMOVE(entry, ev_link);
|
||||
free((char *)entry->ev_var);
|
||||
free(entry);
|
||||
|
||||
|
||||
@@ -586,8 +586,8 @@ void cpu_exec_init(CPUState *env)
|
||||
}
|
||||
env->cpu_index = cpu_index;
|
||||
env->numa_node = 0;
|
||||
TAILQ_INIT(&env->breakpoints);
|
||||
TAILQ_INIT(&env->watchpoints);
|
||||
QTAILQ_INIT(&env->breakpoints);
|
||||
QTAILQ_INIT(&env->watchpoints);
|
||||
*penv = env;
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
cpu_list_unlock();
|
||||
@@ -1348,9 +1348,9 @@ int cpu_watchpoint_insert(CPUState *env, target_ulong addr, target_ulong len,
|
||||
|
||||
/* keep all GDB-injected watchpoints in front */
|
||||
if (flags & BP_GDB)
|
||||
TAILQ_INSERT_HEAD(&env->watchpoints, wp, entry);
|
||||
QTAILQ_INSERT_HEAD(&env->watchpoints, wp, entry);
|
||||
else
|
||||
TAILQ_INSERT_TAIL(&env->watchpoints, wp, entry);
|
||||
QTAILQ_INSERT_TAIL(&env->watchpoints, wp, entry);
|
||||
|
||||
tlb_flush_page(env, addr);
|
||||
|
||||
@@ -1366,7 +1366,7 @@ int cpu_watchpoint_remove(CPUState *env, target_ulong addr, target_ulong len,
|
||||
target_ulong len_mask = ~(len - 1);
|
||||
CPUWatchpoint *wp;
|
||||
|
||||
TAILQ_FOREACH(wp, &env->watchpoints, entry) {
|
||||
QTAILQ_FOREACH(wp, &env->watchpoints, entry) {
|
||||
if (addr == wp->vaddr && len_mask == wp->len_mask
|
||||
&& flags == (wp->flags & ~BP_WATCHPOINT_HIT)) {
|
||||
cpu_watchpoint_remove_by_ref(env, wp);
|
||||
@@ -1379,7 +1379,7 @@ int cpu_watchpoint_remove(CPUState *env, target_ulong addr, target_ulong len,
|
||||
/* Remove a specific watchpoint by reference. */
|
||||
void cpu_watchpoint_remove_by_ref(CPUState *env, CPUWatchpoint *watchpoint)
|
||||
{
|
||||
TAILQ_REMOVE(&env->watchpoints, watchpoint, entry);
|
||||
QTAILQ_REMOVE(&env->watchpoints, watchpoint, entry);
|
||||
|
||||
tlb_flush_page(env, watchpoint->vaddr);
|
||||
|
||||
@@ -1391,7 +1391,7 @@ void cpu_watchpoint_remove_all(CPUState *env, int mask)
|
||||
{
|
||||
CPUWatchpoint *wp, *next;
|
||||
|
||||
TAILQ_FOREACH_SAFE(wp, &env->watchpoints, entry, next) {
|
||||
QTAILQ_FOREACH_SAFE(wp, &env->watchpoints, entry, next) {
|
||||
if (wp->flags & mask)
|
||||
cpu_watchpoint_remove_by_ref(env, wp);
|
||||
}
|
||||
@@ -1411,9 +1411,9 @@ int cpu_breakpoint_insert(CPUState *env, target_ulong pc, int flags,
|
||||
|
||||
/* keep all GDB-injected breakpoints in front */
|
||||
if (flags & BP_GDB)
|
||||
TAILQ_INSERT_HEAD(&env->breakpoints, bp, entry);
|
||||
QTAILQ_INSERT_HEAD(&env->breakpoints, bp, entry);
|
||||
else
|
||||
TAILQ_INSERT_TAIL(&env->breakpoints, bp, entry);
|
||||
QTAILQ_INSERT_TAIL(&env->breakpoints, bp, entry);
|
||||
|
||||
breakpoint_invalidate(env, pc);
|
||||
|
||||
@@ -1431,7 +1431,7 @@ int cpu_breakpoint_remove(CPUState *env, target_ulong pc, int flags)
|
||||
#if defined(TARGET_HAS_ICE)
|
||||
CPUBreakpoint *bp;
|
||||
|
||||
TAILQ_FOREACH(bp, &env->breakpoints, entry) {
|
||||
QTAILQ_FOREACH(bp, &env->breakpoints, entry) {
|
||||
if (bp->pc == pc && bp->flags == flags) {
|
||||
cpu_breakpoint_remove_by_ref(env, bp);
|
||||
return 0;
|
||||
@@ -1447,7 +1447,7 @@ int cpu_breakpoint_remove(CPUState *env, target_ulong pc, int flags)
|
||||
void cpu_breakpoint_remove_by_ref(CPUState *env, CPUBreakpoint *breakpoint)
|
||||
{
|
||||
#if defined(TARGET_HAS_ICE)
|
||||
TAILQ_REMOVE(&env->breakpoints, breakpoint, entry);
|
||||
QTAILQ_REMOVE(&env->breakpoints, breakpoint, entry);
|
||||
|
||||
breakpoint_invalidate(env, breakpoint->pc);
|
||||
|
||||
@@ -1461,7 +1461,7 @@ void cpu_breakpoint_remove_all(CPUState *env, int mask)
|
||||
#if defined(TARGET_HAS_ICE)
|
||||
CPUBreakpoint *bp, *next;
|
||||
|
||||
TAILQ_FOREACH_SAFE(bp, &env->breakpoints, entry, next) {
|
||||
QTAILQ_FOREACH_SAFE(bp, &env->breakpoints, entry, next) {
|
||||
if (bp->flags & mask)
|
||||
cpu_breakpoint_remove_by_ref(env, bp);
|
||||
}
|
||||
@@ -1712,13 +1712,13 @@ CPUState *cpu_copy(CPUState *env)
|
||||
/* Clone all break/watchpoints.
|
||||
Note: Once we support ptrace with hw-debug register access, make sure
|
||||
BP_CPU break/watchpoints are handled correctly on clone. */
|
||||
TAILQ_INIT(&env->breakpoints);
|
||||
TAILQ_INIT(&env->watchpoints);
|
||||
QTAILQ_INIT(&env->breakpoints);
|
||||
QTAILQ_INIT(&env->watchpoints);
|
||||
#if defined(TARGET_HAS_ICE)
|
||||
TAILQ_FOREACH(bp, &env->breakpoints, entry) {
|
||||
QTAILQ_FOREACH(bp, &env->breakpoints, entry) {
|
||||
cpu_breakpoint_insert(new_env, bp->pc, bp->flags, NULL);
|
||||
}
|
||||
TAILQ_FOREACH(wp, &env->watchpoints, entry) {
|
||||
QTAILQ_FOREACH(wp, &env->watchpoints, entry) {
|
||||
cpu_watchpoint_insert(new_env, wp->vaddr, (~wp->len_mask) + 1,
|
||||
wp->flags, NULL);
|
||||
}
|
||||
@@ -2009,7 +2009,7 @@ int tlb_set_page_exec(CPUState *env, target_ulong vaddr,
|
||||
code_address = address;
|
||||
/* Make accesses to pages with watchpoints go via the
|
||||
watchpoint trap routines. */
|
||||
TAILQ_FOREACH(wp, &env->watchpoints, entry) {
|
||||
QTAILQ_FOREACH(wp, &env->watchpoints, entry) {
|
||||
if (vaddr == (wp->vaddr & TARGET_PAGE_MASK)) {
|
||||
iotlb = io_mem_watch + paddr;
|
||||
/* TODO: The memory case can be optimized by not trapping
|
||||
@@ -2663,7 +2663,7 @@ static void check_watchpoint(int offset, int len_mask, int flags)
|
||||
return;
|
||||
}
|
||||
vaddr = (env->mem_io_vaddr & TARGET_PAGE_MASK) + offset;
|
||||
TAILQ_FOREACH(wp, &env->watchpoints, entry) {
|
||||
QTAILQ_FOREACH(wp, &env->watchpoints, entry) {
|
||||
if ((vaddr == (wp->vaddr & len_mask) ||
|
||||
(vaddr & wp->len_mask) == wp->vaddr) && (wp->flags & flags)) {
|
||||
wp->flags |= BP_WATCHPOINT_HIT;
|
||||
@@ -3169,11 +3169,11 @@ static BounceBuffer bounce;
|
||||
typedef struct MapClient {
|
||||
void *opaque;
|
||||
void (*callback)(void *opaque);
|
||||
LIST_ENTRY(MapClient) link;
|
||||
QLIST_ENTRY(MapClient) link;
|
||||
} MapClient;
|
||||
|
||||
static LIST_HEAD(map_client_list, MapClient) map_client_list
|
||||
= LIST_HEAD_INITIALIZER(map_client_list);
|
||||
static QLIST_HEAD(map_client_list, MapClient) map_client_list
|
||||
= QLIST_HEAD_INITIALIZER(map_client_list);
|
||||
|
||||
void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque))
|
||||
{
|
||||
@@ -3181,7 +3181,7 @@ void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque))
|
||||
|
||||
client->opaque = opaque;
|
||||
client->callback = callback;
|
||||
LIST_INSERT_HEAD(&map_client_list, client, link);
|
||||
QLIST_INSERT_HEAD(&map_client_list, client, link);
|
||||
return client;
|
||||
}
|
||||
|
||||
@@ -3189,7 +3189,7 @@ void cpu_unregister_map_client(void *_client)
|
||||
{
|
||||
MapClient *client = (MapClient *)_client;
|
||||
|
||||
LIST_REMOVE(client, link);
|
||||
QLIST_REMOVE(client, link);
|
||||
qemu_free(client);
|
||||
}
|
||||
|
||||
@@ -3197,8 +3197,8 @@ static void cpu_notify_map_clients(void)
|
||||
{
|
||||
MapClient *client;
|
||||
|
||||
while (!LIST_EMPTY(&map_client_list)) {
|
||||
client = LIST_FIRST(&map_client_list);
|
||||
while (!QLIST_EMPTY(&map_client_list)) {
|
||||
client = QLIST_FIRST(&map_client_list);
|
||||
client->callback(client->opaque);
|
||||
cpu_unregister_map_client(client);
|
||||
}
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ void destroy_bdrvs(dev_match_fn *match_fn, void *arg)
|
||||
DriveInfo *dinfo;
|
||||
struct BlockDriverState *bs;
|
||||
|
||||
TAILQ_FOREACH(dinfo, &drives, next) {
|
||||
QTAILQ_FOREACH(dinfo, &drives, next) {
|
||||
bs = dinfo->bdrv;
|
||||
if (bs) {
|
||||
if (bs->private && match_fn(bs->private, arg)) {
|
||||
|
||||
@@ -76,7 +76,7 @@ int i2c_start_transfer(i2c_bus *bus, int address, int recv)
|
||||
DeviceState *qdev;
|
||||
i2c_slave *slave = NULL;
|
||||
|
||||
LIST_FOREACH(qdev, &bus->qbus.children, sibling) {
|
||||
QLIST_FOREACH(qdev, &bus->qbus.children, sibling) {
|
||||
slave = I2C_SLAVE_FROM_QDEV(qdev);
|
||||
if (slave->address == address)
|
||||
break;
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ void drive_hot_add(Monitor *mon, const QDict *qdict)
|
||||
switch (type) {
|
||||
case IF_SCSI:
|
||||
success = 1;
|
||||
scsibus = LIST_FIRST(&dev->qdev.child_bus);
|
||||
scsibus = QLIST_FIRST(&dev->qdev.child_bus);
|
||||
scsi_bus_legacy_add_drive(DO_UPCAST(SCSIBus, qbus, scsibus),
|
||||
dinfo, dinfo->unit);
|
||||
break;
|
||||
|
||||
@@ -101,7 +101,7 @@ DeviceState *qdev_create(BusState *bus, const char *name)
|
||||
qdev_prop_set_defaults(dev, dev->info->props);
|
||||
qdev_prop_set_defaults(dev, dev->parent_bus->info->props);
|
||||
qdev_prop_set_compat(dev);
|
||||
LIST_INSERT_HEAD(&bus->children, dev, sibling);
|
||||
QLIST_INSERT_HEAD(&bus->children, dev, sibling);
|
||||
return dev;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ void qdev_free(DeviceState *dev)
|
||||
#endif
|
||||
if (dev->info->reset)
|
||||
qemu_unregister_reset(dev->info->reset, dev);
|
||||
LIST_REMOVE(dev, sibling);
|
||||
QLIST_REMOVE(dev, sibling);
|
||||
qemu_free(dev);
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name)
|
||||
{
|
||||
BusState *bus;
|
||||
|
||||
LIST_FOREACH(bus, &dev->child_bus, sibling) {
|
||||
QLIST_FOREACH(bus, &dev->child_bus, sibling) {
|
||||
if (strcmp(name, bus->name) == 0) {
|
||||
return bus;
|
||||
}
|
||||
@@ -346,8 +346,8 @@ static BusState *qbus_find_recursive(BusState *bus, const char *name,
|
||||
return bus;
|
||||
}
|
||||
|
||||
LIST_FOREACH(dev, &bus->children, sibling) {
|
||||
LIST_FOREACH(child, &dev->child_bus, sibling) {
|
||||
QLIST_FOREACH(dev, &bus->children, sibling) {
|
||||
QLIST_FOREACH(child, &dev->child_bus, sibling) {
|
||||
ret = qbus_find_recursive(child, name, info);
|
||||
if (ret) {
|
||||
return ret;
|
||||
@@ -365,7 +365,7 @@ static void qbus_list_bus(DeviceState *dev, char *dest, int len)
|
||||
|
||||
pos += snprintf(dest+pos, len-pos,"child busses at \"%s\":",
|
||||
dev->id ? dev->id : dev->info->name);
|
||||
LIST_FOREACH(child, &dev->child_bus, sibling) {
|
||||
QLIST_FOREACH(child, &dev->child_bus, sibling) {
|
||||
pos += snprintf(dest+pos, len-pos, "%s\"%s\"", sep, child->name);
|
||||
sep = ", ";
|
||||
}
|
||||
@@ -379,7 +379,7 @@ static void qbus_list_dev(BusState *bus, char *dest, int len)
|
||||
|
||||
pos += snprintf(dest+pos, len-pos, "devices at \"%s\":",
|
||||
bus->name);
|
||||
LIST_FOREACH(dev, &bus->children, sibling) {
|
||||
QLIST_FOREACH(dev, &bus->children, sibling) {
|
||||
pos += snprintf(dest+pos, len-pos, "%s\"%s\"",
|
||||
sep, dev->info->name);
|
||||
if (dev->id)
|
||||
@@ -392,7 +392,7 @@ static BusState *qbus_find_bus(DeviceState *dev, char *elem)
|
||||
{
|
||||
BusState *child;
|
||||
|
||||
LIST_FOREACH(child, &dev->child_bus, sibling) {
|
||||
QLIST_FOREACH(child, &dev->child_bus, sibling) {
|
||||
if (strcmp(child->name, elem) == 0) {
|
||||
return child;
|
||||
}
|
||||
@@ -410,17 +410,17 @@ static DeviceState *qbus_find_dev(BusState *bus, char *elem)
|
||||
* (2) driver name
|
||||
* (3) driver alias, if present
|
||||
*/
|
||||
LIST_FOREACH(dev, &bus->children, sibling) {
|
||||
QLIST_FOREACH(dev, &bus->children, sibling) {
|
||||
if (dev->id && strcmp(dev->id, elem) == 0) {
|
||||
return dev;
|
||||
}
|
||||
}
|
||||
LIST_FOREACH(dev, &bus->children, sibling) {
|
||||
QLIST_FOREACH(dev, &bus->children, sibling) {
|
||||
if (strcmp(dev->info->name, elem) == 0) {
|
||||
return dev;
|
||||
}
|
||||
}
|
||||
LIST_FOREACH(dev, &bus->children, sibling) {
|
||||
QLIST_FOREACH(dev, &bus->children, sibling) {
|
||||
if (dev->info->alias && strcmp(dev->info->alias, elem) == 0) {
|
||||
return dev;
|
||||
}
|
||||
@@ -478,7 +478,7 @@ static BusState *qbus_find(const char *path)
|
||||
qemu_error("device has no child bus (%s)\n", path);
|
||||
return NULL;
|
||||
case 1:
|
||||
return LIST_FIRST(&dev->child_bus);
|
||||
return QLIST_FIRST(&dev->child_bus);
|
||||
default:
|
||||
qbus_list_bus(dev, msg, sizeof(msg));
|
||||
qemu_error("device has multiple child busses (%s)\n%s\n",
|
||||
@@ -532,9 +532,9 @@ BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name)
|
||||
bus->name = buf;
|
||||
}
|
||||
|
||||
LIST_INIT(&bus->children);
|
||||
QLIST_INIT(&bus->children);
|
||||
if (parent) {
|
||||
LIST_INSERT_HEAD(&parent->child_bus, bus, sibling);
|
||||
QLIST_INSERT_HEAD(&parent->child_bus, bus, sibling);
|
||||
parent->num_child_bus++;
|
||||
}
|
||||
return bus;
|
||||
@@ -575,7 +575,7 @@ static void qdev_print(Monitor *mon, DeviceState *dev, int indent)
|
||||
qdev_print_props(mon, dev, dev->parent_bus->info->props, "bus", indent);
|
||||
if (dev->parent_bus->info->print_dev)
|
||||
dev->parent_bus->info->print_dev(mon, dev, indent);
|
||||
LIST_FOREACH(child, &dev->child_bus, sibling) {
|
||||
QLIST_FOREACH(child, &dev->child_bus, sibling) {
|
||||
qbus_print(mon, child, indent);
|
||||
}
|
||||
}
|
||||
@@ -587,7 +587,7 @@ static void qbus_print(Monitor *mon, BusState *bus, int indent)
|
||||
qdev_printf("bus: %s\n", bus->name);
|
||||
indent += 2;
|
||||
qdev_printf("type %s\n", bus->info->name);
|
||||
LIST_FOREACH(dev, &bus->children, sibling) {
|
||||
QLIST_FOREACH(dev, &bus->children, sibling) {
|
||||
qdev_print(mon, dev, indent);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user