From: Ian Jackson Date: Tue, 14 Apr 2009 16:35:05 +0000 (+0100) Subject: Merge branch 'stable_0_10' X-Git-Tag: xen-3.4.0-rc2~1 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=baf8c0bc4bee8cacb089d5d635f41eebb23f084c;p=qemu-xen-4.0-testing.git Merge branch 'stable_0_10' Conflicts: block.c hw/cirrus_vga.c hw/vga.c --- baf8c0bc4bee8cacb089d5d635f41eebb23f084c diff --cc block.c index c6f9c4d7,3f262fa5..8a0e8b28 --- a/block.c +++ b/block.c @@@ -335,9 -311,7 +335,7 @@@ int bdrv_file_open(BlockDriverState **p int ret; bs = bdrv_new(""); - if (!bs) - return -ENOMEM; - ret = bdrv_open2(bs, filename, flags | BDRV_O_FILE, NULL); + ret = bdrv_open2(bs, filename, flags | BDRV_O_FILE, &bdrv_raw); if (ret < 0) { bdrv_delete(bs); return ret; @@@ -446,15 -421,13 +445,13 @@@ int bdrv_open2(BlockDriverState *bs, co if (bs->backing_file[0] != '\0') { /* if there is a backing file, use it */ bs->backing_hd = bdrv_new(""); - if (!bs->backing_hd) { - fail: - bdrv_close(bs); - return -ENOMEM; - } path_combine(backing_filename, sizeof(backing_filename), filename, bs->backing_file); - if (bdrv_open2(bs->backing_hd, backing_filename, open_flags, &bdrv_raw) < 0) - goto fail; - ret = bdrv_open(bs->backing_hd, backing_filename, open_flags); ++ ret = bdrv_open2(bs->backing_hd, backing_filename, open_flags, &bdrv_raw); + if (ret < 0) { + bdrv_close(bs); + return ret; + } } /* call the change callback */ diff --cc block.h index 5a91ad43,979781a1..fc0afbbd --- a/block.h +++ b/block.h @@@ -101,15 -99,11 +99,13 @@@ BlockDriverAIOCB *bdrv_aio_read(BlockDr BlockDriverAIOCB *bdrv_aio_write(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque); +BlockDriverAIOCB *bdrv_aio_flush(BlockDriverState *bs, + BlockDriverCompletionFunc *cb, void *opaque); void bdrv_aio_cancel(BlockDriverAIOCB *acb); - int qemu_key_check(BlockDriverState *bs, const char *name); - /* Ensure contents are flushed to disk. */ -void bdrv_flush(BlockDriverState *bs); -void bdrv_flush_all(void); +int bdrv_flush(BlockDriverState *bs); +int bdrv_flush_all(void); int bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum); diff --cc block_int.h index 1481a5c9,c6af1c64..1c8655b2 --- a/block_int.h +++ b/block_int.h @@@ -101,8 -101,8 +106,9 @@@ struct BlockDriverState int removable; /* if true, the media can be removed */ int locked; /* if true, the media cannot temporarily be ejected */ int encrypted; /* if true, the media is encrypted */ + int valid_key; /* if true, a valid encryption key has been set */ int sg; /* if true, the device is a /dev/sg* */ + int extendable;/* if true, we may write out of original range */ /* event callback when inserting/removing */ void (*change_cb)(void *opaque); void *change_opaque; diff --cc hw/vga.c index de587355,709d6bb9..7b8572af --- a/hw/vga.c +++ b/hw/vga.c @@@ -1549,9 -1584,8 +1549,9 @@@ void vga_invalidate_scanlines(VGAState */ static void vga_draw_graphic(VGAState *s, int full_update) { - int y1, y, update, page_min, page_max, linesize, y_start, double_scan, mask, depth; - int width, height, shift_control, line_offset, page0, page1, bwidth, bits; + int y1, y, update, linesize, y_start, double_scan, mask, depth; - int width, height, shift_control, line_offset, bwidth, ds_depth, bits; ++ int width, height, shift_control, line_offset, bwidth, bits; + ram_addr_t page0, page1; int disp_width, multi_scan, multi_run; uint8_t *d; uint32_t v, addr1, addr; @@@ -1580,13 -1615,19 +1580,22 @@@ s->shift_control = shift_control; s->double_scan = double_scan; } + if (shift_control == 1 && (s->sr[0x01] & 8)) { + disp_width <<= 1; + } - ds_depth = ds_get_bits_per_pixel(s->ds); + if (shift_control == 0) { + if (s->sr[0x01] & 8) { + disp_width <<= 1; + } + } else if (shift_control == 1) { + if (s->sr[0x01] & 8) { + disp_width <<= 1; + } + } + depth = s->get_bpp(s); - if (s->line_offset != s->last_line_offset || + if (s->line_offset != s->last_line_offset || disp_width != s->last_width || height != s->last_height || s->last_depth != depth) { @@@ -2806,6 -2646,37 +2826,7 @@@ static void vga_screen_dump(void *opaqu ppm_save(filename, ds->surface); - qemu_free_displaysurface(ds->surface); + qemu_free_displaysurface(ds); s->ds = saved_ds; -} - -static void vga_screen_dump_graphic(VGAState *s, const char *filename) -{ - int w, h; - - s->get_resolution(s, &w, &h); - vga_screen_dump_common(s, filename, w, h); -} - -static void vga_screen_dump_text(VGAState *s, const char *filename) -{ - int w, h, cwidth, cheight; - - vga_get_text_resolution(s, &w, &h, &cwidth, &cheight); - vga_screen_dump_common(s, filename, w * cwidth, h * cheight); -} - -/* save the vga display in a PPM image even if no display is - available */ -static void vga_screen_dump(void *opaque, const char *filename) -{ - VGAState *s = (VGAState *)opaque; - - if (!(s->ar_index & 0x20)) - vga_screen_dump_blank(s, filename); - else if (s->gr[6] & 1) - vga_screen_dump_graphic(s, filename); - else - vga_screen_dump_text(s, filename); + vga_invalidate_display(s); }