Merge remote-tracking branch 'mjt/trivial-patches' into staging

# By Ed Maste (3) and others
# Via Michael Tokarev
* mjt/trivial-patches:
  do not check pointers after dereferencing them
  m25p80: Add Micron n25q032a
  qemu: fix out of tree cross compile
  slirp: cleanup leftovers from misc.h
  migration: Remove duplicate bandwidth_limit set
  docs: Fix typo and update file in migration
  configure: try pkg-config ncurses first
  rtc: remove rtc_set_date
  linux-user: Fix typo in comment
  configure: remove confusing file manipulation
  debugcon: fix compiler warning when open DEBUG_DEBUGCON
  debugcon: make debug message more readable
  debugcon: fix always print "addr=0x0, val=0x0" bug when use DEBUG_DEBUGCON
  Remove unnecessary break statements
  don't run pkg-config for features explicitly disabled

Message-id: 51A9CCFB.1000109@msgid.tls.msk.ru
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Anthony Liguori 2013-06-03 08:37:44 -05:00
commit 7087d3df18
15 changed files with 29 additions and 60 deletions

34
configure vendored
View File

@ -546,7 +546,7 @@ Haiku)
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
audio_possible_drivers="$audio_possible_drivers fmod"
fi
QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers $QEMU_INCLUDES"
QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES"
;;
esac
@ -2153,13 +2153,12 @@ fi
##########################################
# curses probe
if test "$mingw32" = "yes" ; then
curses_list="-lpdcurses"
else
curses_list="-lncurses:-lcurses:$($pkg_config --libs ncurses 2>/dev/null)"
fi
if test "$curses" != "no" ; then
if test "$mingw32" = "yes" ; then
curses_list="-lpdcurses"
else
curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lncurses:-lcurses"
fi
curses_found=no
cat > $TMPC << EOF
#include <curses.h>
@ -2191,14 +2190,12 @@ fi
##########################################
# curl probe
if $pkg_config libcurl --modversion >/dev/null 2>&1; then
curlconfig="$pkg_config libcurl"
else
curlconfig=curl-config
fi
if test "$curl" != "no" ; then
if $pkg_config libcurl --modversion >/dev/null 2>&1; then
curlconfig="$pkg_config libcurl"
else
curlconfig=curl-config
fi
cat > $TMPC << EOF
#include <curl/curl.h>
int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; }
@ -4107,17 +4104,8 @@ if test "$gcov" = "yes" ; then
fi
# generate list of library paths for linker script
$ld --verbose -v 2> /dev/null | grep SEARCH_DIR > ${config_host_ld}
if test -f ${config_host_ld}~ ; then
if cmp -s $config_host_ld ${config_host_ld}~ ; then
mv ${config_host_ld}~ $config_host_ld
else
rm ${config_host_ld}~
fi
fi
# use included Linux headers
if test "$linux" = "yes" ; then
mkdir -p linux-headers

View File

@ -41,7 +41,7 @@ All these four migration protocols use the same infrastructure to
save/restore state devices. This infrastructure is shared with the
savevm/loadvm functionality.
=== State Live Migration ==
=== State Live Migration ===
This is used for RAM and block devices. It is not yet ported to vmstate.
<Fill more information here>
@ -83,7 +83,7 @@ pointer that is passed to all functions.
The important functions for us are put_buffer()/get_buffer() that
allow to write/read a buffer into the QEMUFile.
=== How to save the state of one device ==
=== How to save the state of one device ===
The state of a device is saved using intermediate buffers. There are
some helper functions to assist this saving.
@ -97,7 +97,7 @@ associated with a series of fields saved. The save_state always saves
the state as the newer version. But load_state sometimes is able to
load state from an older version.
=== Legacy way ===
=== Legacy way ===
This way is going to disappear as soon as all current users are ported to VMSTATE.
@ -133,7 +133,7 @@ to interpret that definition to be able to load/save the state. As
the state is declared only once, it can't go out of sync in the
save/load functions.
An example (from hw/pckbd.c)
An example (from hw/input/pckbd.c)
static const VMStateDescription vmstate_kbd = {
.name = "pckbd",
@ -158,9 +158,9 @@ We registered this with:
Note: talk about how vmstate <-> qdev interact, and what the instance ids mean.
You can search for VMSTATE_* macros for lots of types used in QEMU in
hw/hw.h.
include/hw/hw.h.
=== More about versions ==
=== More about versions ===
You can see that there are several version fields:
@ -227,7 +227,7 @@ using a specific functionality, ....
It is impossible to create a way to make migration from any version to
any other version to work. But we can do better than only allowing
migration from older versions no newer ones. For that fields that are
migration from older versions to newer ones. For that fields that are
only needed sometimes, we add the idea of subsections. A subsection
is "like" a device vmstate, but with a particularity, it has a Boolean
function that tells if that values are needed to be sent or not. If
@ -247,7 +247,8 @@ static bool ide_drive_pio_state_needed(void *opaque)
{
IDEState *s = opaque;
return (s->status & DRQ_STAT) != 0;
return ((s->status & DRQ_STAT) != 0)
|| (s->bus->error_status & BM_STATUS_PIO_RETRY);
}
const VMStateDescription vmstate_ide_drive_pio_state = {

View File

@ -123,6 +123,7 @@ static const FlashPartInfo known_devices[] = {
{ INFO("mx25l25655e", 0xc22619, 0, 64 << 10, 512, 0) },
/* Micron */
{ INFO("n25q032a", 0x20bb16, 0, 64 << 10, 64, ER_4K) },
{ INFO("n25q128a11", 0x20bb18, 0, 64 << 10, 256, 0) },
{ INFO("n25q128a13", 0x20ba18, 0, 64 << 10, 256, 0) },
{ INFO("n25q256a", 0x20ba19, 0, 64 << 10, 512, ER_4K) },

View File

@ -55,7 +55,7 @@ static void debugcon_ioport_write(void *opaque, hwaddr addr, uint64_t val,
unsigned char ch = val;
#ifdef DEBUG_DEBUGCON
printf("debugcon: write addr=0x%04x val=0x%02x\n", addr, val);
printf(" [debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02" PRIx64 "]\n", addr, val);
#endif
qemu_chr_fe_write(s->chr, &ch, 1);
@ -67,7 +67,7 @@ static uint64_t debugcon_ioport_read(void *opaque, hwaddr addr, unsigned width)
DebugconState *s = opaque;
#ifdef DEBUG_DEBUGCON
printf("debugcon: read addr=0x%04x\n", addr);
printf("debugcon: read addr=0x%04" HWADDR_PRIx "\n", addr);
#endif
return s->readback;

View File

@ -2600,7 +2600,6 @@ static void cirrus_vga_ioport_write(void *opaque, hwaddr addr, uint64_t val,
#endif
cirrus_vga_write_sr(c, val);
break;
break;
case 0x3c6:
cirrus_write_hidden_dac(c, val);
break;

View File

@ -1030,7 +1030,6 @@ static uint64_t exynos4210_mct_read(void *opaque, hwaddr offset,
case G_INT_ENB:
value = s->g_timer.reg.int_enb;
break;
break;
case G_WSTAT:
value = s->g_timer.reg.wstat;
break;

View File

@ -9,6 +9,5 @@
ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq);
void rtc_set_memory(ISADevice *dev, int addr, int val);
int rtc_get_memory(ISADevice *dev, int addr);
void rtc_set_date(ISADevice *dev, const struct tm *tm);
#endif /* !MC146818RTC_H */

View File

@ -8236,7 +8236,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef TARGET_NR_madvise
case TARGET_NR_madvise:
/* A straight passthrough may not be safe because qemu sometimes
turns private flie-backed mappings into anonymous mappings.
turns private file-backed mappings into anonymous mappings.
This will break MADV_DONTNEED.
This is a hint, so ignoring and returning success is ok. */
ret = get_errno(0);

View File

@ -349,7 +349,6 @@ static MigrationState *migrate_init(const MigrationParams *params)
sizeof(enabled_capabilities));
memset(s, 0, sizeof(*s));
s->bandwidth_limit = bandwidth_limit;
s->params = *params;
memcpy(s->enabled_capabilities, enabled_capabilities,
sizeof(enabled_capabilities));

View File

@ -280,7 +280,7 @@ void monitor_flush(Monitor *mon)
buf = qstring_get_str(mon->outbuf);
len = qstring_get_length(mon->outbuf);
if (mon && len && !mon->mux_out) {
if (len && !mon->mux_out) {
rc = qemu_chr_fe_write(mon->chr, (const uint8_t *) buf, len);
if (rc == len) {
/* all flushed */

View File

@ -322,13 +322,13 @@ QEMUFile *qemu_popen_cmd(const char *command, const char *mode)
FILE *stdio_file;
QEMUFileStdio *s;
stdio_file = popen(command, mode);
if (stdio_file == NULL) {
if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) {
fprintf(stderr, "qemu_popen: Argument validity check failed\n");
return NULL;
}
if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) {
fprintf(stderr, "qemu_popen: Argument validity check failed\n");
stdio_file = popen(command, mode);
if (stdio_file == NULL) {
return NULL;
}

View File

@ -20,8 +20,6 @@ struct ex_list {
char *strdup(const char *);
#endif
void do_wait(int);
#define EMU_NONE 0x0
/* TCP emulations */
@ -51,21 +49,9 @@ struct emu_t {
struct emu_t *next;
};
extern int x_port, x_server, x_display;
int show_x(char *, struct socket *);
void redir_x(uint32_t, int, int, int);
void slirp_insque(void *, void *);
void slirp_remque(void *);
int add_exec(struct ex_list **, int, char *, struct in_addr, int);
int slirp_openpty(int *, int *);
int fork_exec(struct socket *so, const char *ex, int do_pty);
void snooze_hup(int);
void snooze(void);
void relay(int);
void add_emu(char *);
void fd_nonblock(int);
void fd_block(int);
int rsh_exec(struct socket *, struct socket *, char *, char *, char *);
#endif

View File

@ -9916,7 +9916,6 @@ static inline void gen_intermediate_code_internal(CPUARMState *env,
invalidate this TB. */
dc->pc += 2;
goto done_generating;
break;
}
}
}

View File

@ -515,7 +515,6 @@ uint32_t HELPER(ex)(CPUS390XState *env, uint32_t cc, uint64_t v1,
break;
default:
goto abort;
break;
}
} else if ((insn & 0xff00) == 0x0a00) {
/* supervisor call */

View File

@ -1933,7 +1933,6 @@ static inline void gen_intermediate_code_internal(CPUUniCore32State *env,
invalidate this TB. */
dc->pc += 2; /* FIXME */
goto done_generating;
break;
}
}
}