• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiónd35381c87483d49a56e0065dd95d49c79e146809 (tree)
Tiempo2009-03-22 08:04:14
Autoraliguori <aliguori@c046...>
Commiteraliguori

Log Message

Add release tag for 0.10.1 release

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/tags/release_0_10_1@6881 c046a42c-6fe2-441c-8c8c-71466251a162

Cambiar Resumen

Diferencia incremental

--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,30 @@
1+version 0.10.1:
2+
3+ - virtio-net: allow masking of notifications on empty queue (Alex Williamson)
4+ - e1000: fix rx descriptor low threshold logic (Alex Willaimson)
5+ - x86 tcg: add NULL checks to lsl instruction (Jan Kiszka)
6+ - kvm vga: fix screen corruption with -std-vga and Windows (Avi Kivity)
7+ - kvm vga: fix screen corruption with Ubuntu installations (Glauber Costa)
8+ - virtio-net: check right return size on sg list (Alex Williamson)
9+ - Make qemu_announce_self handle holes (live migration after hotplug)
10+ (Marcelo Tosatti)
11+ - Revert r6804-r6808 (qcow2 allocation info). This series of changes added
12+ a high cost to startup for large qcow2 images (Anthony Liguori)
13+ - qemu-img: fix help message (Aurelien Jarno)
14+ - Fix build for non-default installs of SDL (Anthony Liguori)
15+ - Fix race condition in env->interrupt_request. When using TCG and a dynticks
16+ host timer, this condition could cause TCG to get stuck in an infinite
17+ loop (Aurelien Jarno)
18+ - Fix reading encrypted hard disk passwords during early startup (Jan Kiszka)
19+ - Fix encrypted disk reporting in 'info block' (Jan Kiszka)
20+ - Fix console size with tiny displays (MusicPal) (Jan Kiszka)
21+ - Improve error handling in bdrv_open2 (Jan Kiszka)
22+ - Avoid leaking data in mux'ed character devices (Jan Kiszka)
23+ - Fix initial character device reset (no banner in monitor) (Jan Kiszka)
24+ - Fix cpuid KVM crash on i386 host (Lubomir Rintel)
25+ - Fix SLES10sp2 installation by adding ISTAT1 register to LSI SCSI emulation
26+ (Ryan Harper)
27+
128 version 0.10.0:
229
330 - TCG support (No longer requires GCC 3.x)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
1-0.10.0
1+0.10.1
--- a/block-qcow2.c
+++ b/block-qcow2.c
@@ -143,10 +143,6 @@ typedef struct BDRVQcowState {
143143 uint32_t crypt_method_header;
144144 AES_KEY aes_encrypt_key;
145145 AES_KEY aes_decrypt_key;
146-
147- int64_t highest_alloc; /* highest cluester allocated (in clusters) */
148- int64_t nc_free; /* num of free clusters below highest_alloc */
149-
150146 uint64_t snapshots_offset;
151147 int snapshots_size;
152148 int nb_snapshots;
@@ -174,8 +170,6 @@ static void free_clusters(BlockDriverState *bs,
174170 #ifdef DEBUG_ALLOC
175171 static void check_refcounts(BlockDriverState *bs);
176172 #endif
177-static void scan_refcount(BlockDriverState *bs, int64_t *high, int64_t *free);
178-
179173
180174 static int qcow_probe(const uint8_t *buf, int buf_size, const char *filename)
181175 {
@@ -276,8 +270,6 @@ static int qcow_open(BlockDriverState *bs, const char *filename, int flags)
276270 if (refcount_init(bs) < 0)
277271 goto fail;
278272
279- scan_refcount(bs, &s->highest_alloc, &s->nc_free);
280-
281273 /* read the backing file name */
282274 if (header.backing_file_offset != 0) {
283275 len = header.backing_file_size;
@@ -1646,8 +1638,6 @@ static int qcow_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
16461638 bdi->cluster_size = s->cluster_size;
16471639 bdi->vm_state_offset = (int64_t)s->l1_vm_state_index <<
16481640 (s->cluster_bits + s->l2_bits);
1649- bdi->highest_alloc = s->highest_alloc << s->cluster_bits;
1650- bdi->num_free_bytes = s->nc_free << s->cluster_bits;
16511641 return 0;
16521642 }
16531643
@@ -2166,39 +2156,6 @@ static int load_refcount_block(BlockDriverState *bs,
21662156 return 0;
21672157 }
21682158
2169-static void scan_refcount(BlockDriverState *bs, int64_t *high, int64_t *free)
2170-{
2171- BDRVQcowState *s = bs->opaque;
2172- int64_t refcnt_index, cluster_index, cluster_end, h = 0, f = 0;
2173- int64_t tail = 0; /* do not count last consecutive free entries */
2174-
2175- for (refcnt_index=0; refcnt_index < s->refcount_table_size; refcnt_index++){
2176- if (s->refcount_table[refcnt_index] == 0) {
2177- f += 1 << (s->cluster_bits - REFCOUNT_SHIFT);
2178- tail += 1 << (s->cluster_bits - REFCOUNT_SHIFT);
2179- continue;
2180- }
2181- cluster_index = refcnt_index << (s->cluster_bits - REFCOUNT_SHIFT);
2182- cluster_end = (refcnt_index + 1) << (s->cluster_bits - REFCOUNT_SHIFT);
2183- for ( ; cluster_index < cluster_end; cluster_index++) {
2184- if (get_refcount(bs, cluster_index) == 0) {
2185- f++;
2186- tail++;
2187- }
2188- else {
2189- h = cluster_index;
2190- tail = 0;
2191- }
2192- }
2193- }
2194-
2195- f -= tail;
2196- if (free)
2197- *free = f;
2198- if (high)
2199- *high = (h+1);
2200-}
2201-
22022159 static int get_refcount(BlockDriverState *bs, int64_t cluster_index)
22032160 {
22042161 BDRVQcowState *s = bs->opaque;
@@ -2239,12 +2196,6 @@ retry:
22392196 size,
22402197 (s->free_cluster_index - nb_clusters) << s->cluster_bits);
22412198 #endif
2242-
2243- if (s->highest_alloc < s->free_cluster_index) {
2244- s->nc_free += (s->free_cluster_index - s->highest_alloc);
2245- s->highest_alloc = s->free_cluster_index;
2246- }
2247-
22482199 return (s->free_cluster_index - nb_clusters) << s->cluster_bits;
22492200 }
22502201
@@ -2418,12 +2369,6 @@ static int update_cluster_refcount(BlockDriverState *bs,
24182369 block_index = cluster_index &
24192370 ((1 << (s->cluster_bits - REFCOUNT_SHIFT)) - 1);
24202371 refcount = be16_to_cpu(s->refcount_block_cache[block_index]);
2421-
2422- if (refcount == 1 && addend == -1)
2423- s->nc_free += 1;
2424- else if (refcount == 0 && addend == 1)
2425- s->nc_free -= 1;
2426-
24272372 refcount += addend;
24282373 if (refcount < 0 || refcount > 0xffff)
24292374 return -EINVAL;
--- a/block.c
+++ b/block.c
@@ -311,8 +311,6 @@ int bdrv_file_open(BlockDriverState **pbs, const char *filename, int flags)
311311 int ret;
312312
313313 bs = bdrv_new("");
314- if (!bs)
315- return -ENOMEM;
316314 ret = bdrv_open2(bs, filename, flags | BDRV_O_FILE, NULL);
317315 if (ret < 0) {
318316 bdrv_delete(bs);
@@ -338,6 +336,7 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
338336 bs->read_only = 0;
339337 bs->is_temporary = 0;
340338 bs->encrypted = 0;
339+ bs->valid_key = 0;
341340
342341 if (flags & BDRV_O_SNAPSHOT) {
343342 BlockDriverState *bs1;
@@ -349,12 +348,10 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
349348
350349 /* if there is a backing file, use it */
351350 bs1 = bdrv_new("");
352- if (!bs1) {
353- return -ENOMEM;
354- }
355- if (bdrv_open(bs1, filename, 0) < 0) {
351+ ret = bdrv_open(bs1, filename, 0);
352+ if (ret < 0) {
356353 bdrv_delete(bs1);
357- return -1;
354+ return ret;
358355 }
359356 total_size = bdrv_getlength(bs1) >> SECTOR_BITS;
360357
@@ -372,9 +369,10 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
372369 else
373370 realpath(filename, backing_filename);
374371
375- if (bdrv_create(&bdrv_qcow2, tmp_filename,
376- total_size, backing_filename, 0) < 0) {
377- return -1;
372+ ret = bdrv_create(&bdrv_qcow2, tmp_filename,
373+ total_size, backing_filename, 0);
374+ if (ret < 0) {
375+ return ret;
378376 }
379377 filename = tmp_filename;
380378 bs->is_temporary = 1;
@@ -383,14 +381,12 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
383381 pstrcpy(bs->filename, sizeof(bs->filename), filename);
384382 if (flags & BDRV_O_FILE) {
385383 drv = find_protocol(filename);
386- if (!drv)
387- return -ENOENT;
388- } else {
389- if (!drv) {
390- drv = find_image_format(filename);
391- if (!drv)
392- return -1;
393- }
384+ } else if (!drv) {
385+ drv = find_image_format(filename);
386+ }
387+ if (!drv) {
388+ ret = -ENOENT;
389+ goto unlink_and_fail;
394390 }
395391 bs->drv = drv;
396392 bs->opaque = qemu_mallocz(drv->instance_size);
@@ -409,6 +405,9 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
409405 qemu_free(bs->opaque);
410406 bs->opaque = NULL;
411407 bs->drv = NULL;
408+ unlink_and_fail:
409+ if (bs->is_temporary)
410+ unlink(filename);
412411 return ret;
413412 }
414413 if (drv->bdrv_getlength) {
@@ -422,15 +421,13 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
422421 if (bs->backing_file[0] != '\0') {
423422 /* if there is a backing file, use it */
424423 bs->backing_hd = bdrv_new("");
425- if (!bs->backing_hd) {
426- fail:
427- bdrv_close(bs);
428- return -ENOMEM;
429- }
430424 path_combine(backing_filename, sizeof(backing_filename),
431425 filename, bs->backing_file);
432- if (bdrv_open(bs->backing_hd, backing_filename, open_flags) < 0)
433- goto fail;
426+ ret = bdrv_open(bs->backing_hd, backing_filename, open_flags);
427+ if (ret < 0) {
428+ bdrv_close(bs);
429+ return ret;
430+ }
434431 }
435432
436433 /* call the change callback */
@@ -970,6 +967,15 @@ int bdrv_is_encrypted(BlockDriverState *bs)
970967 return bs->encrypted;
971968 }
972969
970+int bdrv_key_required(BlockDriverState *bs)
971+{
972+ BlockDriverState *backing_hd = bs->backing_hd;
973+
974+ if (backing_hd && backing_hd->encrypted && !backing_hd->valid_key)
975+ return 1;
976+ return (bs->encrypted && !bs->valid_key);
977+}
978+
973979 int bdrv_set_key(BlockDriverState *bs, const char *key)
974980 {
975981 int ret;
@@ -982,7 +988,9 @@ int bdrv_set_key(BlockDriverState *bs, const char *key)
982988 }
983989 if (!bs->encrypted || !bs->drv || !bs->drv->bdrv_set_key)
984990 return -1;
985- return bs->drv->bdrv_set_key(bs, key);
991+ ret = bs->drv->bdrv_set_key(bs, key);
992+ bs->valid_key = (ret == 0);
993+ return ret;
986994 }
987995
988996 void bdrv_get_format(BlockDriverState *bs, char *buf, int buf_size)
@@ -1015,12 +1023,12 @@ BlockDriverState *bdrv_find(const char *name)
10151023 return NULL;
10161024 }
10171025
1018-void bdrv_iterate(void (*it)(void *opaque, const char *name), void *opaque)
1026+void bdrv_iterate(void (*it)(void *opaque, BlockDriverState *bs), void *opaque)
10191027 {
10201028 BlockDriverState *bs;
10211029
10221030 for (bs = bdrv_first; bs != NULL; bs = bs->next) {
1023- it(opaque, bs->device_name);
1031+ it(opaque, bs);
10241032 }
10251033 }
10261034
@@ -1105,8 +1113,7 @@ void bdrv_info(void)
11051113 }
11061114 term_printf(" ro=%d", bs->read_only);
11071115 term_printf(" drv=%s", bs->drv->format_name);
1108- if (bs->encrypted)
1109- term_printf(" encrypted");
1116+ term_printf(" encrypted=%d", bdrv_is_encrypted(bs));
11101117 } else {
11111118 term_printf(" [not inserted]");
11121119 }
@@ -1118,7 +1125,6 @@ void bdrv_info(void)
11181125 void bdrv_info_stats (void)
11191126 {
11201127 BlockDriverState *bs;
1121- BlockDriverInfo bdi;
11221128
11231129 for (bs = bdrv_first; bs != NULL; bs = bs->next) {
11241130 term_printf ("%s:"
@@ -1126,18 +1132,23 @@ void bdrv_info_stats (void)
11261132 " wr_bytes=%" PRIu64
11271133 " rd_operations=%" PRIu64
11281134 " wr_operations=%" PRIu64
1129- ,
1135+ "\n",
11301136 bs->device_name,
11311137 bs->rd_bytes, bs->wr_bytes,
11321138 bs->rd_ops, bs->wr_ops);
1133- if (bdrv_get_info(bs, &bdi) == 0)
1134- term_printf(" high=%" PRId64
1135- " bytes_free=%" PRId64,
1136- bdi.highest_alloc, bdi.num_free_bytes);
1137- term_printf("\n");
11381139 }
11391140 }
11401141
1142+const char *bdrv_get_encrypted_filename(BlockDriverState *bs)
1143+{
1144+ if (bs->backing_hd && bs->backing_hd->encrypted)
1145+ return bs->backing_file;
1146+ else if (bs->encrypted)
1147+ return bs->filename;
1148+ else
1149+ return NULL;
1150+}
1151+
11411152 void bdrv_get_backing_filename(BlockDriverState *bs,
11421153 char *filename, int filename_size)
11431154 {
--- a/block.h
+++ b/block.h
@@ -26,8 +26,6 @@ typedef struct BlockDriverInfo {
2626 int cluster_size;
2727 /* offset at which the VM state can be saved (0 if not possible) */
2828 int64_t vm_state_offset;
29- int64_t highest_alloc; /* highest allocated block offset (in bytes) */
30- int64_t num_free_bytes; /* below highest_alloc */
3129 } BlockDriverInfo;
3230
3331 typedef struct QEMUSnapshotInfo {
@@ -103,8 +101,6 @@ BlockDriverAIOCB *bdrv_aio_write(BlockDriverState *bs, int64_t sector_num,
103101 BlockDriverCompletionFunc *cb, void *opaque);
104102 void bdrv_aio_cancel(BlockDriverAIOCB *acb);
105103
106-int qemu_key_check(BlockDriverState *bs, const char *name);
107-
108104 /* Ensure contents are flushed to disk. */
109105 void bdrv_flush(BlockDriverState *bs);
110106 void bdrv_flush_all(void);
@@ -141,9 +137,12 @@ void bdrv_set_change_cb(BlockDriverState *bs,
141137 void (*change_cb)(void *opaque), void *opaque);
142138 void bdrv_get_format(BlockDriverState *bs, char *buf, int buf_size);
143139 BlockDriverState *bdrv_find(const char *name);
144-void bdrv_iterate(void (*it)(void *opaque, const char *name), void *opaque);
140+void bdrv_iterate(void (*it)(void *opaque, BlockDriverState *bs),
141+ void *opaque);
145142 int bdrv_is_encrypted(BlockDriverState *bs);
143+int bdrv_key_required(BlockDriverState *bs);
146144 int bdrv_set_key(BlockDriverState *bs, const char *key);
145+int bdrv_query_missing_keys(void);
147146 void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
148147 void *opaque);
149148 const char *bdrv_get_device_name(BlockDriverState *bs);
@@ -151,6 +150,7 @@ int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num,
151150 const uint8_t *buf, int nb_sectors);
152151 int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
153152
153+const char *bdrv_get_encrypted_filename(BlockDriverState *bs);
154154 void bdrv_get_backing_filename(BlockDriverState *bs,
155155 char *filename, int filename_size);
156156 int bdrv_snapshot_create(BlockDriverState *bs,
--- a/block_int.h
+++ b/block_int.h
@@ -96,6 +96,7 @@ struct BlockDriverState {
9696 int removable; /* if true, the media can be removed */
9797 int locked; /* if true, the media cannot temporarily be ejected */
9898 int encrypted; /* if true, the media is encrypted */
99+ int valid_key; /* if true, a valid encryption key has been set */
99100 int sg; /* if true, the device is a /dev/sg* */
100101 /* event callback when inserting/removing */
101102 void (*change_cb)(void *opaque);
--- a/console.h
+++ b/console.h
@@ -302,10 +302,9 @@ void term_printf(const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1
302302 void term_print_filename(const char *filename);
303303 void term_flush(void);
304304 void term_print_help(void);
305-void monitor_readline(const char *prompt, int is_password,
306- char *buf, int buf_size);
307305 void monitor_suspend(void);
308306 void monitor_resume(void);
307+int monitor_read_bdrv_key(BlockDriverState *bs);
309308
310309 /* readline.c */
311310 typedef void ReadLineFunc(void *opaque, const char *str);
--- a/cpu-defs.h
+++ b/cpu-defs.h
@@ -27,6 +27,7 @@
2727 #include "config.h"
2828 #include <setjmp.h>
2929 #include <inttypes.h>
30+#include <signal.h>
3031 #include "osdep.h"
3132 #include "sys-queue.h"
3233
@@ -170,6 +171,7 @@ typedef struct CPUWatchpoint {
170171 memory was accessed */ \
171172 uint32_t halted; /* Nonzero if the CPU is in suspend state */ \
172173 uint32_t interrupt_request; \
174+ volatile sig_atomic_t exit_request; \
173175 /* The meaning of the MMU modes is defined in the target code. */ \
174176 CPUTLBEntry tlb_table[NB_MMU_MODES][CPU_TLB_SIZE]; \
175177 target_phys_addr_t iotlb[NB_MMU_MODES][CPU_TLB_SIZE]; \
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -311,7 +311,7 @@ int cpu_exec(CPUState *env1)
311311 env->exception_index = -1;
312312 }
313313 #ifdef USE_KQEMU
314- if (kqemu_is_ok(env) && env->interrupt_request == 0) {
314+ if (kqemu_is_ok(env) && env->interrupt_request == 0 && env->exit_request == 0) {
315315 int ret;
316316 env->eflags = env->eflags | helper_cc_compute_all(CC_OP) | (DF & DF_MASK);
317317 ret = kqemu_cpu_exec(env);
@@ -326,7 +326,7 @@ int cpu_exec(CPUState *env1)
326326 } else if (ret == 2) {
327327 /* softmmu execution needed */
328328 } else {
329- if (env->interrupt_request != 0) {
329+ if (env->interrupt_request != 0 || env->exit_request != 0) {
330330 /* hardware interrupt will be executed just after */
331331 } else {
332332 /* otherwise, we restart */
@@ -525,11 +525,11 @@ int cpu_exec(CPUState *env1)
525525 the program flow was changed */
526526 next_tb = 0;
527527 }
528- if (interrupt_request & CPU_INTERRUPT_EXIT) {
529- env->interrupt_request &= ~CPU_INTERRUPT_EXIT;
530- env->exception_index = EXCP_INTERRUPT;
531- cpu_loop_exit();
532- }
528+ }
529+ if (unlikely(env->exit_request)) {
530+ env->exit_request = 0;
531+ env->exception_index = EXCP_INTERRUPT;
532+ cpu_loop_exit();
533533 }
534534 #ifdef DEBUG_EXEC
535535 if (qemu_loglevel_mask(CPU_LOG_TB_CPU)) {
@@ -599,7 +599,7 @@ int cpu_exec(CPUState *env1)
599599 TB, but before it is linked into a potentially
600600 infinite loop and becomes env->current_tb. Avoid
601601 starting execution if there is a pending interrupt. */
602- if (unlikely (env->interrupt_request & CPU_INTERRUPT_EXIT))
602+ if (unlikely (env->exit_request))
603603 env->current_tb = NULL;
604604
605605 while (env->current_tb) {
--- a/exec.c
+++ b/exec.c
@@ -523,6 +523,7 @@ static int cpu_common_load(QEMUFile *f, void *opaque, int version_id)
523523
524524 qemu_get_be32s(f, &env->halted);
525525 qemu_get_be32s(f, &env->interrupt_request);
526+ env->interrupt_request &= ~CPU_INTERRUPT_EXIT;
526527 tlb_flush(env, 1);
527528
528529 return 0;
@@ -1501,9 +1502,12 @@ void cpu_interrupt(CPUState *env, int mask)
15011502 #endif
15021503 int old_mask;
15031504
1505+ if (mask & CPU_INTERRUPT_EXIT) {
1506+ env->exit_request = 1;
1507+ mask &= ~CPU_INTERRUPT_EXIT;
1508+ }
1509+
15041510 old_mask = env->interrupt_request;
1505- /* FIXME: This is probably not threadsafe. A different thread could
1506- be in the middle of a read-modify-write operation. */
15071511 env->interrupt_request |= mask;
15081512 #if defined(USE_NPTL)
15091513 /* FIXME: TB unchaining isn't SMP safe. For now just ignore the
@@ -1514,10 +1518,8 @@ void cpu_interrupt(CPUState *env, int mask)
15141518 if (use_icount) {
15151519 env->icount_decr.u16.high = 0xffff;
15161520 #ifndef CONFIG_USER_ONLY
1517- /* CPU_INTERRUPT_EXIT isn't a real interrupt. It just means
1518- an async event happened and we need to process it. */
15191521 if (!can_do_io(env)
1520- && (mask & ~(old_mask | CPU_INTERRUPT_EXIT)) != 0) {
1522+ && (mask & ~old_mask) != 0) {
15211523 cpu_abort(env, "Raised interrupt while not in I/O function");
15221524 }
15231525 #endif
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -2637,11 +2637,16 @@ static void map_linear_vram(CirrusVGAState *s)
26372637
26382638 s->lfb_vram_mapped = 0;
26392639
2640+ cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x8000,
2641+ (s->vram_offset + s->cirrus_bank_base[0]) | IO_MEM_UNASSIGNED);
2642+ cpu_register_physical_memory(isa_mem_base + 0xa8000, 0x8000,
2643+ (s->vram_offset + s->cirrus_bank_base[1]) | IO_MEM_UNASSIGNED);
26402644 if (!(s->cirrus_srcptr != s->cirrus_srcptr_end)
26412645 && !((s->sr[0x07] & 0x01) == 0)
26422646 && !((s->gr[0x0B] & 0x14) == 0x14)
26432647 && !(s->gr[0x0B] & 0x02)) {
26442648
2649+ vga_dirty_log_stop((VGAState *)s);
26452650 cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x8000,
26462651 (s->vram_offset + s->cirrus_bank_base[0]) | IO_MEM_RAM);
26472652 cpu_register_physical_memory(isa_mem_base + 0xa8000, 0x8000,
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -666,8 +666,8 @@ e1000_receive(void *opaque, const uint8_t *buf, int size)
666666 n = E1000_ICS_RXT0;
667667 if ((rdt = s->mac_reg[RDT]) < s->mac_reg[RDH])
668668 rdt += s->mac_reg[RDLEN] / sizeof(desc);
669- if (((rdt - s->mac_reg[RDH]) * sizeof(desc)) << s->rxbuf_min_shift >=
670- s->mac_reg[RDLEN])
669+ if (((rdt - s->mac_reg[RDH]) * sizeof(desc)) <= s->mac_reg[RDLEN] >>
670+ s->rxbuf_min_shift)
671671 n |= E1000_ICS_RXDMT0;
672672
673673 set_ics(s, 0, n);
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -1369,6 +1369,8 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset)
13691369 CASE_GET_REG32(dsa, 0x10)
13701370 case 0x14: /* ISTAT0 */
13711371 return s->istat0;
1372+ case 0x15: /* ISTAT1 */
1373+ return s->istat1;
13721374 case 0x16: /* MBOX0 */
13731375 return s->mbox0;
13741376 case 0x17: /* MBOX1 */
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -11,6 +11,7 @@
1111 #include "usb.h"
1212 #include "block.h"
1313 #include "scsi-disk.h"
14+#include "console.h"
1415
1516 //#define DEBUG_MSD
1617
@@ -513,7 +514,7 @@ static void usb_msd_handle_destroy(USBDevice *dev)
513514 qemu_free(s);
514515 }
515516
516-USBDevice *usb_msd_init(const char *filename)
517+USBDevice *usb_msd_init(const char *filename, BlockDriverState **pbs)
517518 {
518519 MSDState *s;
519520 BlockDriverState *bdrv;
@@ -552,9 +553,8 @@ USBDevice *usb_msd_init(const char *filename)
552553 bdrv = bdrv_new("usb");
553554 if (bdrv_open2(bdrv, filename, 0, drv) < 0)
554555 goto fail;
555- if (qemu_key_check(bdrv, filename))
556- goto fail;
557556 s->bs = bdrv;
557+ *pbs = bdrv;
558558
559559 s->dev.speed = USB_SPEED_FULL;
560560 s->dev.handle_packet = usb_generic_handle_packet;
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -21,6 +21,9 @@
2121 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222 * THE SOFTWARE.
2323 */
24+
25+#include "block.h"
26+
2427 #define USB_TOKEN_SETUP 0x2d
2528 #define USB_TOKEN_IN 0x69 /* device -> host */
2629 #define USB_TOKEN_OUT 0xe1 /* host -> device */
@@ -250,7 +253,7 @@ USBDevice *usb_keyboard_init(void);
250253 void usb_hid_datain_cb(USBDevice *dev, void *opaque, void (*datain)(void *));
251254
252255 /* usb-msd.c */
253-USBDevice *usb_msd_init(const char *filename);
256+USBDevice *usb_msd_init(const char *filename, BlockDriverState **pbs);
254257
255258 /* usb-net.c */
256259 USBDevice *usb_net_init(NICInfo *nd);
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2482,6 +2482,17 @@ int isa_vga_mm_init(uint8_t *vga_ram_base,
24822482 return 0;
24832483 }
24842484
2485+static void pci_vga_write_config(PCIDevice *d,
2486+ uint32_t address, uint32_t val, int len)
2487+{
2488+ PCIVGAState *pvs = container_of(d, PCIVGAState, dev);
2489+ VGAState *s = &pvs->vga_state;
2490+
2491+ vga_dirty_log_stop(s);
2492+ pci_default_write_config(d, address, val, len);
2493+ vga_dirty_log_start(s);
2494+}
2495+
24852496 int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
24862497 unsigned long vga_ram_offset, int vga_ram_size,
24872498 unsigned long vga_bios_offset, int vga_bios_size)
@@ -2492,7 +2503,7 @@ int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
24922503
24932504 d = (PCIVGAState *)pci_register_device(bus, "VGA",
24942505 sizeof(PCIVGAState),
2495- -1, NULL, NULL);
2506+ -1, NULL, pci_vga_write_config);
24962507 if (!d)
24972508 return -1;
24982509 s = &d->vga_state;
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -228,7 +228,7 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
228228 }
229229
230230 if (elem.out_sg[0].iov_len < sizeof(ctrl) ||
231- elem.out_sg[elem.in_num - 1].iov_len < sizeof(status)) {
231+ elem.in_sg[elem.in_num - 1].iov_len < sizeof(status)) {
232232 fprintf(stderr, "virtio-net ctrl header not in correct element\n");
233233 exit(1);
234234 }
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -726,9 +726,10 @@ VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size,
726726
727727 void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
728728 {
729- /* Always notify when queue is empty */
730- if ((vq->inuse || vring_avail_idx(vq) != vq->last_avail_idx) &&
731- (vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT))
729+ /* Always notify when queue is empty (when feature acknowledge) */
730+ if ((vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT) &&
731+ (!(vdev->features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) ||
732+ (vq->inuse || vring_avail_idx(vq) != vq->last_avail_idx)))
732733 return;
733734
734735 vdev->isr |= 0x01;
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -445,7 +445,7 @@ int kvm_cpu_exec(CPUState *env)
445445 do {
446446 kvm_arch_pre_run(env, run);
447447
448- if ((env->interrupt_request & CPU_INTERRUPT_EXIT)) {
448+ if (env->exit_request) {
449449 dprintf("interrupt exit requested\n");
450450 ret = 0;
451451 break;
@@ -512,8 +512,8 @@ int kvm_cpu_exec(CPUState *env)
512512 }
513513 } while (ret > 0);
514514
515- if ((env->interrupt_request & CPU_INTERRUPT_EXIT)) {
516- env->interrupt_request &= ~CPU_INTERRUPT_EXIT;
515+ if (env->exit_request) {
516+ env->exit_request = 0;
517517 env->exception_index = EXCP_INTERRUPT;
518518 }
519519
--- a/monitor.c
+++ b/monitor.c
@@ -76,6 +76,8 @@ static uint8_t term_outbuf[1024];
7676 static int term_outbuf_index;
7777
7878 static void monitor_start_input(void);
79+static void monitor_readline(const char *prompt, int is_password,
80+ char *buf, int buf_size);
7981
8082 static CPUState *mon_cpu = NULL;
8183
@@ -433,7 +435,7 @@ static void do_change_block(const char *device, const char *filename, const char
433435 if (eject_device(bs, 0) < 0)
434436 return;
435437 bdrv_open2(bs, filename, 0, drv);
436- qemu_key_check(bs, filename);
438+ monitor_read_bdrv_key(bs);
437439 }
438440
439441 static void do_change_vnc(const char *target, const char *arg)
@@ -494,9 +496,24 @@ static void do_stop(void)
494496 vm_stop(EXCP_INTERRUPT);
495497 }
496498
499+static void encrypted_bdrv_it(void *opaque, BlockDriverState *bs)
500+{
501+ int *err = opaque;
502+
503+ if (bdrv_key_required(bs))
504+ *err = monitor_read_bdrv_key(bs);
505+ else
506+ *err = 0;
507+}
508+
497509 static void do_cont(void)
498510 {
499- vm_start();
511+ int err = 0;
512+
513+ bdrv_iterate(encrypted_bdrv_it, &err);
514+ /* only resume the vm if all keys are set and valid */
515+ if (!err)
516+ vm_start();
500517 }
501518
502519 #ifdef CONFIG_GDBSTUB
@@ -2679,8 +2696,9 @@ static void file_completion(const char *input)
26792696 closedir(ffs);
26802697 }
26812698
2682-static void block_completion_it(void *opaque, const char *name)
2699+static void block_completion_it(void *opaque, BlockDriverState *bs)
26832700 {
2701+ const char *name = bdrv_get_device_name(bs);
26842702 const char *input = opaque;
26852703
26862704 if (input[0] == '\0' ||
@@ -2891,8 +2909,8 @@ static void monitor_readline_cb(void *opaque, const char *input)
28912909 monitor_readline_started = 0;
28922910 }
28932911
2894-void monitor_readline(const char *prompt, int is_password,
2895- char *buf, int buf_size)
2912+static void monitor_readline(const char *prompt, int is_password,
2913+ char *buf, int buf_size)
28962914 {
28972915 int i;
28982916 int old_focus[MAX_MON];
@@ -2922,3 +2940,22 @@ void monitor_readline(const char *prompt, int is_password,
29222940 monitor_hd[i]->focus = old_focus[i];
29232941 }
29242942 }
2943+
2944+int monitor_read_bdrv_key(BlockDriverState *bs)
2945+{
2946+ char password[256];
2947+ int i;
2948+
2949+ if (!bdrv_is_encrypted(bs))
2950+ return 0;
2951+
2952+ term_printf("%s (%s) is encrypted.\n", bdrv_get_device_name(bs),
2953+ bdrv_get_encrypted_filename(bs));
2954+ for(i = 0; i < 3; i++) {
2955+ monitor_readline("Password: ", 1, password, sizeof(password));
2956+ if (bdrv_set_key(bs, password) == 0)
2957+ return 0;
2958+ term_printf("invalid password\n");
2959+ }
2960+ return -EPERM;
2961+}
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -101,6 +101,10 @@
101101 /***********************************************************/
102102 /* character device */
103103
104+static TAILQ_HEAD(CharDriverStateHead, CharDriverState) chardevs =
105+ TAILQ_HEAD_INITIALIZER(chardevs);
106+static int initial_reset_issued;
107+
104108 static void qemu_chr_event(CharDriverState *s, int event)
105109 {
106110 if (!s->chr_event)
@@ -118,12 +122,23 @@ static void qemu_chr_reset_bh(void *opaque)
118122
119123 void qemu_chr_reset(CharDriverState *s)
120124 {
121- if (s->bh == NULL) {
125+ if (s->bh == NULL && initial_reset_issued) {
122126 s->bh = qemu_bh_new(qemu_chr_reset_bh, s);
123127 qemu_bh_schedule(s->bh);
124128 }
125129 }
126130
131+void qemu_chr_initial_reset(void)
132+{
133+ CharDriverState *chr;
134+
135+ initial_reset_issued = 1;
136+
137+ TAILQ_FOREACH(chr, &chardevs, next) {
138+ qemu_chr_reset(chr);
139+ }
140+}
141+
127142 int qemu_chr_write(CharDriverState *s, const uint8_t *buf, int len)
128143 {
129144 return s->chr_write(s, buf, len);
@@ -210,12 +225,15 @@ typedef struct {
210225 IOEventHandler *chr_event[MAX_MUX];
211226 void *ext_opaque[MAX_MUX];
212227 CharDriverState *drv;
213- unsigned char buffer[MUX_BUFFER_SIZE];
214- int prod;
215- int cons;
216228 int mux_cnt;
217229 int term_got_escape;
218230 int max_size;
231+ /* Intermediate input buffer allows to catch escape sequences even if the
232+ currently active device is not accepting any input - but only until it
233+ is full as well. */
234+ unsigned char buffer[MAX_MUX][MUX_BUFFER_SIZE];
235+ int prod[MAX_MUX];
236+ int cons[MAX_MUX];
219237 } MuxDriver;
220238
221239
@@ -345,11 +363,11 @@ static void mux_chr_accept_input(CharDriverState *chr)
345363 int m = chr->focus;
346364 MuxDriver *d = chr->opaque;
347365
348- while (d->prod != d->cons &&
366+ while (d->prod[m] != d->cons[m] &&
349367 d->chr_can_read[m] &&
350368 d->chr_can_read[m](d->ext_opaque[m])) {
351369 d->chr_read[m](d->ext_opaque[m],
352- &d->buffer[d->cons++ & MUX_BUFFER_MASK], 1);
370+ &d->buffer[m][d->cons[m]++ & MUX_BUFFER_MASK], 1);
353371 }
354372 }
355373
@@ -357,11 +375,12 @@ static int mux_chr_can_read(void *opaque)
357375 {
358376 CharDriverState *chr = opaque;
359377 MuxDriver *d = chr->opaque;
378+ int m = chr->focus;
360379
361- if ((d->prod - d->cons) < MUX_BUFFER_SIZE)
380+ if ((d->prod[m] - d->cons[m]) < MUX_BUFFER_SIZE)
362381 return 1;
363- if (d->chr_can_read[chr->focus])
364- return d->chr_can_read[chr->focus](d->ext_opaque[chr->focus]);
382+ if (d->chr_can_read[m])
383+ return d->chr_can_read[m](d->ext_opaque[m]);
365384 return 0;
366385 }
367386
@@ -376,12 +395,12 @@ static void mux_chr_read(void *opaque, const uint8_t *buf, int size)
376395
377396 for(i = 0; i < size; i++)
378397 if (mux_proc_byte(chr, d, buf[i])) {
379- if (d->prod == d->cons &&
398+ if (d->prod[m] == d->cons[m] &&
380399 d->chr_can_read[m] &&
381400 d->chr_can_read[m](d->ext_opaque[m]))
382401 d->chr_read[m](d->ext_opaque[m], &buf[i], 1);
383402 else
384- d->buffer[d->prod++ & MUX_BUFFER_MASK] = buf[i];
403+ d->buffer[m][d->prod[m]++ & MUX_BUFFER_MASK] = buf[i];
385404 }
386405 }
387406
@@ -2076,9 +2095,6 @@ static CharDriverState *qemu_chr_open_tcp(const char *host_str,
20762095 return NULL;
20772096 }
20782097
2079-static TAILQ_HEAD(CharDriverStateHead, CharDriverState) chardevs
2080-= TAILQ_HEAD_INITIALIZER(chardevs);
2081-
20822098 CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*init)(struct CharDriverState *s))
20832099 {
20842100 const char *p;
--- a/qemu-char.h
+++ b/qemu-char.h
@@ -74,6 +74,7 @@ void qemu_chr_add_handlers(CharDriverState *s,
7474 void *opaque);
7575 int qemu_chr_ioctl(CharDriverState *s, int cmd, void *arg);
7676 void qemu_chr_reset(CharDriverState *s);
77+void qemu_chr_initial_reset(void);
7778 int qemu_chr_can_read(CharDriverState *s);
7879 void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len);
7980 void qemu_chr_accept_input(CharDriverState *s);
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -74,8 +74,8 @@ static void help(void)
7474 " differ\n"
7575 " 'fmt' is the disk image format. It is guessed automatically in most cases\n"
7676 " 'size' is the disk image size in kilobytes. Optional suffixes\n"
77- " 'M' (megabyte, 1024 * 1024) and 'G' (gigabyte, 1024 * 1024 * 1024) are"
78- " supported any @code{k} or @code{K} is ignored\n"
77+ " 'M' (megabyte, 1024 * 1024) and 'G' (gigabyte, 1024 * 1024 * 1024) are\n"
78+ " supported any 'k' or 'K' is ignored\n"
7979 " 'output_filename' is the destination disk image filename\n"
8080 " 'output_fmt' is the destination format\n"
8181 " '-c' indicates that target image must be compressed (qcow format only)\n"
@@ -730,10 +730,6 @@ static int img_info(int argc, char **argv)
730730 if (bdrv_get_info(bs, &bdi) >= 0) {
731731 if (bdi.cluster_size != 0)
732732 printf("cluster_size: %d\n", bdi.cluster_size);
733- if (bdi.highest_alloc)
734- printf("highest_alloc: %" PRId64 "\n", bdi.highest_alloc);
735- if (bdi.num_free_bytes)
736- printf("num_free_bytes: %" PRId64 "\n", bdi.num_free_bytes);
737733 }
738734 bdrv_get_backing_filename(bs, backing_filename, sizeof(backing_filename));
739735 if (backing_filename[0] != '\0') {
--- a/savevm.c
+++ b/savevm.c
@@ -118,7 +118,9 @@ void qemu_announce_self(void)
118118 VLANClientState *vc;
119119 uint8_t buf[256];
120120
121- for (i = 0; i < nb_nics; i++) {
121+ for (i = 0; i < MAX_NICS; i++) {
122+ if (!nd_table[i].used)
123+ continue;
122124 len = announce_self_create(buf, nd_table[i].macaddr);
123125 vlan = nd_table[i].vlan;
124126 for(vc = vlan->first_client; vc != NULL; vc = vc->next) {
--- a/sdl.c
+++ b/sdl.c
@@ -27,7 +27,7 @@
2727 #include "x_keymap.h"
2828
2929 #include <SDL.h>
30-#include <SDL/SDL_syswm.h>
30+#include <SDL_syswm.h>
3131
3232 #ifndef _WIN32
3333 #include <signal.h>
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1421,10 +1421,10 @@ static void host_cpuid(uint32_t function, uint32_t count,
14211421 #else
14221422 asm volatile("pusha \n\t"
14231423 "cpuid \n\t"
1424- "mov %%eax, 0(%1) \n\t"
1425- "mov %%ebx, 4(%1) \n\t"
1426- "mov %%ecx, 8(%1) \n\t"
1427- "mov %%edx, 12(%1) \n\t"
1424+ "mov %%eax, 0(%2) \n\t"
1425+ "mov %%ebx, 4(%2) \n\t"
1426+ "mov %%ecx, 8(%2) \n\t"
1427+ "mov %%edx, 12(%2) \n\t"
14281428 "popa"
14291429 : : "a"(function), "c"(count), "S"(vec)
14301430 : "memory", "cc");
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -3241,6 +3241,8 @@ target_ulong helper_lsl(target_ulong selector1)
32413241
32423242 selector = selector1 & 0xffff;
32433243 eflags = helper_cc_compute_all(CC_OP);
3244+ if ((selector & 0xfffc) == 0)
3245+ goto fail;
32443246 if (load_segment(&e1, &e2, selector) != 0)
32453247 goto fail;
32463248 rpl = selector & 3;
--- a/vl.c
+++ b/vl.c
@@ -201,6 +201,7 @@ ram_addr_t ram_size;
201201 int nb_nics;
202202 NICInfo nd_table[MAX_NICS];
203203 int vm_running;
204+static int autostart;
204205 static int rtc_utc = 1;
205206 static int rtc_date_offset = -1; /* -1 means no change */
206207 int cirrus_vga_enabled = 1;
@@ -2607,11 +2608,13 @@ int drive_init(struct drive_opt *arg, int snapshot, void *opaque)
26072608 bdrv_flags |= BDRV_O_CACHE_WB;
26082609 else if (cache == 3) /* not specified */
26092610 bdrv_flags |= BDRV_O_CACHE_DEF;
2610- if (bdrv_open2(bdrv, file, bdrv_flags, drv) < 0 || qemu_key_check(bdrv, file)) {
2611+ if (bdrv_open2(bdrv, file, bdrv_flags, drv) < 0) {
26112612 fprintf(stderr, "qemu: could not open disk image %s\n",
26122613 file);
26132614 return -1;
26142615 }
2616+ if (bdrv_key_required(bdrv))
2617+ autostart = 0;
26152618 return drives_table_idx;
26162619 }
26172620
@@ -2658,7 +2661,7 @@ int usb_device_add_dev(USBDevice *dev)
26582661 return 0;
26592662 }
26602663
2661-static int usb_device_add(const char *devname)
2664+static int usb_device_add(const char *devname, int is_hotplug)
26622665 {
26632666 const char *p;
26642667 USBDevice *dev;
@@ -2675,7 +2678,18 @@ static int usb_device_add(const char *devname)
26752678 } else if (!strcmp(devname, "keyboard")) {
26762679 dev = usb_keyboard_init();
26772680 } else if (strstart(devname, "disk:", &p)) {
2678- dev = usb_msd_init(p);
2681+ BlockDriverState *bs;
2682+
2683+ dev = usb_msd_init(p, &bs);
2684+ if (!dev)
2685+ return -1;
2686+ if (bdrv_key_required(bs)) {
2687+ autostart = 0;
2688+ if (is_hotplug && monitor_read_bdrv_key(bs) < 0) {
2689+ dev->handle_destroy(dev);
2690+ return -1;
2691+ }
2692+ }
26792693 } else if (!strcmp(devname, "wacom-tablet")) {
26802694 dev = usb_wacom_init();
26812695 } else if (strstart(devname, "serial:", &p)) {
@@ -2756,7 +2770,7 @@ static int usb_device_del(const char *devname)
27562770
27572771 void do_usb_add(const char *devname)
27582772 {
2759- usb_device_add(devname);
2773+ usb_device_add(devname, 1);
27602774 }
27612775
27622776 void do_usb_del(const char *devname)
@@ -4334,45 +4348,6 @@ static const QEMUOption qemu_options[] = {
43344348 { NULL },
43354349 };
43364350
4337-/* password input */
4338-
4339-int qemu_key_check(BlockDriverState *bs, const char *name)
4340-{
4341- char password[256];
4342- int i;
4343-
4344- if (!bdrv_is_encrypted(bs))
4345- return 0;
4346-
4347- term_printf("%s is encrypted.\n", name);
4348- for(i = 0; i < 3; i++) {
4349- monitor_readline("Password: ", 1, password, sizeof(password));
4350- if (bdrv_set_key(bs, password) == 0)
4351- return 0;
4352- term_printf("invalid password\n");
4353- }
4354- return -EPERM;
4355-}
4356-
4357-static BlockDriverState *get_bdrv(int index)
4358-{
4359- if (index > nb_drives)
4360- return NULL;
4361- return drives_table[index].bdrv;
4362-}
4363-
4364-static void read_passwords(void)
4365-{
4366- BlockDriverState *bs;
4367- int i;
4368-
4369- for(i = 0; i < 6; i++) {
4370- bs = get_bdrv(i);
4371- if (bs)
4372- qemu_key_check(bs, bdrv_get_device_name(bs));
4373- }
4374-}
4375-
43764351 #ifdef HAS_AUDIO
43774352 struct soundhw soundhw[] = {
43784353 #ifdef HAS_AUDIO_CHOICE
@@ -4639,7 +4614,6 @@ int main(int argc, char **argv, char **envp)
46394614 int fds[2];
46404615 int tb_size;
46414616 const char *pid_file = NULL;
4642- int autostart;
46434617 const char *incoming = NULL;
46444618 int fd = 0;
46454619 struct passwd *pwd = NULL;
@@ -4696,7 +4670,7 @@ int main(int argc, char **argv, char **envp)
46964670 kernel_cmdline = "";
46974671 cyls = heads = secs = 0;
46984672 translation = BIOS_ATA_TRANSLATION_AUTO;
4699- monitor_device = "vc";
4673+ monitor_device = "vc:80Cx24C";
47004674
47014675 serial_devices[0] = "vc:80Cx24C";
47024676 for(i = 1; i < MAX_SERIAL_PORTS; i++)
@@ -5637,7 +5611,7 @@ int main(int argc, char **argv, char **envp)
56375611 /* init USB devices */
56385612 if (usb_enabled) {
56395613 for(i = 0; i < usb_devices_index; i++) {
5640- if (usb_device_add(usb_devices[i]) < 0) {
5614+ if (usb_device_add(usb_devices[i], 0) < 0) {
56415615 fprintf(stderr, "Warning: could not add USB device %s\n",
56425616 usb_devices[i]);
56435617 }
@@ -5693,6 +5667,7 @@ int main(int argc, char **argv, char **envp)
56935667 }
56945668
56955669 text_consoles_set_display(display_state);
5670+ qemu_chr_initial_reset();
56965671
56975672 if (monitor_device && monitor_hd)
56985673 monitor_init(monitor_hd, !nographic);
@@ -5747,13 +5722,8 @@ int main(int argc, char **argv, char **envp)
57475722 qemu_start_incoming_migration(incoming);
57485723 }
57495724
5750- {
5751- /* XXX: simplify init */
5752- read_passwords();
5753- if (autostart) {
5754- vm_start();
5755- }
5756- }
5725+ if (autostart)
5726+ vm_start();
57575727
57585728 if (daemonize) {
57595729 uint8_t status = 0;