Compare commits
26 Commits
v2.0.0-rc2
...
qemu-2.0.0
Author | SHA1 | Date | |
---|---|---|---|
|
a9e8aeb375 | ||
|
851627352c | ||
|
50212d6346 | ||
|
c2b9af1d6c | ||
|
940973ae0b | ||
|
8611224a7b | ||
|
482f38b948 | ||
|
590e5dd98f | ||
|
f12d048a52 | ||
|
3c99afc779 | ||
|
9878d173f5 | ||
|
8c6c047899 | ||
|
92b3eeadd9 | ||
|
edc2438512 | ||
|
21e2db7260 | ||
|
80fc7b1755 | ||
|
5450466394 | ||
|
cd82b6fb4d | ||
|
715c3f60ef | ||
|
28ec11bc88 | ||
|
2d968ffbae | ||
|
afbc0dd649 | ||
|
f516a5cc05 | ||
|
0a9077ea14 | ||
|
775478418a | ||
|
50329d3418 |
@@ -148,16 +148,26 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
s->extent_blocks = 1 + (le32_to_cpu(bochs.extent) - 1) / 512;
|
||||
|
||||
s->extent_size = le32_to_cpu(bochs.extent);
|
||||
if (s->extent_size == 0) {
|
||||
error_setg(errp, "Extent size may not be zero");
|
||||
return -EINVAL;
|
||||
if (s->extent_size < BDRV_SECTOR_SIZE) {
|
||||
/* bximage actually never creates extents smaller than 4k */
|
||||
error_setg(errp, "Extent size must be at least 512");
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
} else if (!is_power_of_2(s->extent_size)) {
|
||||
error_setg(errp, "Extent size %" PRIu32 " is not a power of two",
|
||||
s->extent_size);
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
} else if (s->extent_size > 0x800000) {
|
||||
error_setg(errp, "Extent size %" PRIu32 " is too large",
|
||||
s->extent_size);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (s->catalog_size < bs->total_sectors / s->extent_size) {
|
||||
if (s->catalog_size < DIV_ROUND_UP(bs->total_sectors,
|
||||
s->extent_size / BDRV_SECTOR_SIZE))
|
||||
{
|
||||
error_setg(errp, "Catalog size is too small for this disk size");
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
|
@@ -1233,6 +1233,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
iscsi_readcapacity_sync(iscsilun, &local_err);
|
||||
if (local_err != NULL) {
|
||||
error_propagate(errp, local_err);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
bs->total_sectors = sector_lun2qemu(iscsilun->num_blocks, iscsilun);
|
||||
|
@@ -1876,6 +1876,10 @@ void qmp_block_commit(const char *device,
|
||||
*/
|
||||
BlockdevOnError on_error = BLOCKDEV_ON_ERROR_REPORT;
|
||||
|
||||
if (!has_speed) {
|
||||
speed = 0;
|
||||
}
|
||||
|
||||
/* drain all i/o before commits */
|
||||
bdrv_drain_all();
|
||||
|
||||
|
5
configure
vendored
5
configure
vendored
@@ -1448,7 +1448,10 @@ done
|
||||
if test "$stack_protector" != "no" ; then
|
||||
gcc_flags="-fstack-protector-strong -fstack-protector-all"
|
||||
for flag in $gcc_flags; do
|
||||
if compile_prog "-Werror $flag" "" ; then
|
||||
# We need to check both a compile and a link, since some compiler
|
||||
# setups fail only on a .c->.o compile and some only at link time
|
||||
if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC &&
|
||||
compile_prog "-Werror $flag" ""; then
|
||||
QEMU_CFLAGS="$QEMU_CFLAGS $flag"
|
||||
LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag"
|
||||
break
|
||||
|
@@ -391,7 +391,7 @@ static void build_append_int(GArray *table, uint32_t value)
|
||||
build_append_byte(table, 0x01); /* OneOp */
|
||||
} else if (value <= 0xFF) {
|
||||
build_append_value(table, value, 1);
|
||||
} else if (value <= 0xFFFFF) {
|
||||
} else if (value <= 0xFFFF) {
|
||||
build_append_value(table, value, 2);
|
||||
} else {
|
||||
build_append_value(table, value, 4);
|
||||
|
@@ -3,12 +3,12 @@ static unsigned char AcpiDsdtAmlCode[] = {
|
||||
0x53,
|
||||
0x44,
|
||||
0x54,
|
||||
0x85,
|
||||
0x80,
|
||||
0x11,
|
||||
0x0,
|
||||
0x0,
|
||||
0x1,
|
||||
0x8b,
|
||||
0x60,
|
||||
0x42,
|
||||
0x58,
|
||||
0x50,
|
||||
@@ -31,8 +31,8 @@ static unsigned char AcpiDsdtAmlCode[] = {
|
||||
0x4e,
|
||||
0x54,
|
||||
0x4c,
|
||||
0x23,
|
||||
0x8,
|
||||
0x15,
|
||||
0x11,
|
||||
0x13,
|
||||
0x20,
|
||||
0x10,
|
||||
@@ -4010,7 +4010,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
|
||||
0x53,
|
||||
0x1,
|
||||
0x10,
|
||||
0x47,
|
||||
0x42,
|
||||
0x11,
|
||||
0x5f,
|
||||
0x53,
|
||||
@@ -4243,7 +4243,7 @@ static unsigned char AcpiDsdtAmlCode[] = {
|
||||
0x60,
|
||||
0x5b,
|
||||
0x82,
|
||||
0x2e,
|
||||
0x29,
|
||||
0x50,
|
||||
0x52,
|
||||
0x45,
|
||||
@@ -4253,16 +4253,11 @@ static unsigned char AcpiDsdtAmlCode[] = {
|
||||
0x48,
|
||||
0x49,
|
||||
0x44,
|
||||
0xd,
|
||||
0xc,
|
||||
0x41,
|
||||
0x43,
|
||||
0x50,
|
||||
0x49,
|
||||
0x30,
|
||||
0x30,
|
||||
0x30,
|
||||
0x34,
|
||||
0x0,
|
||||
0xd0,
|
||||
0xa,
|
||||
0x6,
|
||||
0x8,
|
||||
0x5f,
|
||||
0x43,
|
||||
|
@@ -3,12 +3,12 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
|
||||
0x53,
|
||||
0x44,
|
||||
0x54,
|
||||
0xd7,
|
||||
0xd2,
|
||||
0x1c,
|
||||
0x0,
|
||||
0x0,
|
||||
0x1,
|
||||
0x3e,
|
||||
0x13,
|
||||
0x42,
|
||||
0x58,
|
||||
0x50,
|
||||
@@ -31,8 +31,8 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
|
||||
0x4e,
|
||||
0x54,
|
||||
0x4c,
|
||||
0x23,
|
||||
0x8,
|
||||
0x15,
|
||||
0x11,
|
||||
0x13,
|
||||
0x20,
|
||||
0x10,
|
||||
@@ -6959,7 +6959,7 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
|
||||
0x53,
|
||||
0x1,
|
||||
0x10,
|
||||
0x47,
|
||||
0x42,
|
||||
0x11,
|
||||
0x5f,
|
||||
0x53,
|
||||
@@ -7192,7 +7192,7 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
|
||||
0x60,
|
||||
0x5b,
|
||||
0x82,
|
||||
0x2e,
|
||||
0x29,
|
||||
0x50,
|
||||
0x52,
|
||||
0x45,
|
||||
@@ -7202,16 +7202,11 @@ static unsigned char Q35AcpiDsdtAmlCode[] = {
|
||||
0x48,
|
||||
0x49,
|
||||
0x44,
|
||||
0xd,
|
||||
0xc,
|
||||
0x41,
|
||||
0x43,
|
||||
0x50,
|
||||
0x49,
|
||||
0x30,
|
||||
0x30,
|
||||
0x30,
|
||||
0x34,
|
||||
0x0,
|
||||
0xd0,
|
||||
0xa,
|
||||
0x6,
|
||||
0x8,
|
||||
0x5f,
|
||||
0x43,
|
||||
|
@@ -1602,7 +1602,7 @@ static bool cmd_smart(IDEState *s, uint8_t cmd)
|
||||
case 2: /* extended self test */
|
||||
s->smart_selftest_count++;
|
||||
if (s->smart_selftest_count > 21) {
|
||||
s->smart_selftest_count = 0;
|
||||
s->smart_selftest_count = 1;
|
||||
}
|
||||
n = 2 + (s->smart_selftest_count - 1) * 24;
|
||||
s->smart_selftest_data[n] = s->sector;
|
||||
|
@@ -677,7 +677,7 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (in_use + mac_data.entries <= MAC_TABLE_ENTRIES) {
|
||||
if (mac_data.entries <= MAC_TABLE_ENTRIES - in_use) {
|
||||
s = iov_to_buf(iov, iov_cnt, 0, &macs[in_use * ETH_ALEN],
|
||||
mac_data.entries * ETH_ALEN);
|
||||
if (s != mac_data.entries * ETH_ALEN) {
|
||||
|
@@ -52,6 +52,9 @@
|
||||
#define VMXNET3_DEVICE_VERSION 0x1
|
||||
#define VMXNET3_DEVICE_REVISION 0x1
|
||||
|
||||
/* Number of interrupt vectors for non-MSIx modes */
|
||||
#define VMXNET3_MAX_NMSIX_INTRS (1)
|
||||
|
||||
/* Macros for rings descriptors access */
|
||||
#define VMXNET3_READ_TX_QUEUE_DESCR8(dpa, field) \
|
||||
(vmw_shmem_ld8(dpa + offsetof(struct Vmxnet3_TxQueueDesc, field)))
|
||||
@@ -1305,6 +1308,51 @@ static bool vmxnet3_verify_intx(VMXNET3State *s, int intx)
|
||||
(pci_get_byte(s->parent_obj.config + PCI_INTERRUPT_PIN) - 1));
|
||||
}
|
||||
|
||||
static void vmxnet3_validate_interrupt_idx(bool is_msix, int idx)
|
||||
{
|
||||
int max_ints = is_msix ? VMXNET3_MAX_INTRS : VMXNET3_MAX_NMSIX_INTRS;
|
||||
if (idx >= max_ints) {
|
||||
hw_error("Bad interrupt index: %d\n", idx);
|
||||
}
|
||||
}
|
||||
|
||||
static void vmxnet3_validate_interrupts(VMXNET3State *s)
|
||||
{
|
||||
int i;
|
||||
|
||||
VMW_CFPRN("Verifying event interrupt index (%d)", s->event_int_idx);
|
||||
vmxnet3_validate_interrupt_idx(s->msix_used, s->event_int_idx);
|
||||
|
||||
for (i = 0; i < s->txq_num; i++) {
|
||||
int idx = s->txq_descr[i].intr_idx;
|
||||
VMW_CFPRN("Verifying TX queue %d interrupt index (%d)", i, idx);
|
||||
vmxnet3_validate_interrupt_idx(s->msix_used, idx);
|
||||
}
|
||||
|
||||
for (i = 0; i < s->rxq_num; i++) {
|
||||
int idx = s->rxq_descr[i].intr_idx;
|
||||
VMW_CFPRN("Verifying RX queue %d interrupt index (%d)", i, idx);
|
||||
vmxnet3_validate_interrupt_idx(s->msix_used, idx);
|
||||
}
|
||||
}
|
||||
|
||||
static void vmxnet3_validate_queues(VMXNET3State *s)
|
||||
{
|
||||
/*
|
||||
* txq_num and rxq_num are total number of queues
|
||||
* configured by guest. These numbers must not
|
||||
* exceed corresponding maximal values.
|
||||
*/
|
||||
|
||||
if (s->txq_num > VMXNET3_DEVICE_MAX_TX_QUEUES) {
|
||||
hw_error("Bad TX queues number: %d\n", s->txq_num);
|
||||
}
|
||||
|
||||
if (s->rxq_num > VMXNET3_DEVICE_MAX_RX_QUEUES) {
|
||||
hw_error("Bad RX queues number: %d\n", s->rxq_num);
|
||||
}
|
||||
}
|
||||
|
||||
static void vmxnet3_activate_device(VMXNET3State *s)
|
||||
{
|
||||
int i;
|
||||
@@ -1351,7 +1399,7 @@ static void vmxnet3_activate_device(VMXNET3State *s)
|
||||
VMXNET3_READ_DRV_SHARED8(s->drv_shmem, devRead.misc.numRxQueues);
|
||||
|
||||
VMW_CFPRN("Number of TX/RX queues %u/%u", s->txq_num, s->rxq_num);
|
||||
assert(s->txq_num <= VMXNET3_DEVICE_MAX_TX_QUEUES);
|
||||
vmxnet3_validate_queues(s);
|
||||
|
||||
qdescr_table_pa =
|
||||
VMXNET3_READ_DRV_SHARED64(s->drv_shmem, devRead.misc.queueDescPA);
|
||||
@@ -1447,6 +1495,8 @@ static void vmxnet3_activate_device(VMXNET3State *s)
|
||||
sizeof(s->rxq_descr[i].rxq_stats));
|
||||
}
|
||||
|
||||
vmxnet3_validate_interrupts(s);
|
||||
|
||||
/* Make sure everything is in place before device activation */
|
||||
smp_wmb();
|
||||
|
||||
@@ -2005,7 +2055,6 @@ vmxnet3_cleanup_msix(VMXNET3State *s)
|
||||
}
|
||||
}
|
||||
|
||||
#define VMXNET3_MSI_NUM_VECTORS (1)
|
||||
#define VMXNET3_MSI_OFFSET (0x50)
|
||||
#define VMXNET3_USE_64BIT (true)
|
||||
#define VMXNET3_PER_VECTOR_MASK (false)
|
||||
@@ -2016,7 +2065,7 @@ vmxnet3_init_msi(VMXNET3State *s)
|
||||
PCIDevice *d = PCI_DEVICE(s);
|
||||
int res;
|
||||
|
||||
res = msi_init(d, VMXNET3_MSI_OFFSET, VMXNET3_MSI_NUM_VECTORS,
|
||||
res = msi_init(d, VMXNET3_MSI_OFFSET, VMXNET3_MAX_NMSIX_INTRS,
|
||||
VMXNET3_USE_64BIT, VMXNET3_PER_VECTOR_MASK);
|
||||
if (0 > res) {
|
||||
VMW_WRPRN("Failed to initialize MSI, error %d", res);
|
||||
@@ -2342,6 +2391,9 @@ static int vmxnet3_post_load(void *opaque, int version_id)
|
||||
}
|
||||
}
|
||||
|
||||
vmxnet3_validate_queues(s);
|
||||
vmxnet3_validate_interrupts(s);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -441,7 +441,7 @@ static int kvm_physical_sync_dirty_bitmap(MemoryRegionSection *section)
|
||||
|
||||
d.slot = mem->slot;
|
||||
|
||||
if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) < 0) {
|
||||
if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) {
|
||||
DPRINTF("ioctl failed %d\n", errno);
|
||||
ret = -1;
|
||||
break;
|
||||
|
@@ -1225,7 +1225,8 @@ Object *object_resolve_path_component(Object *parent, const gchar *part)
|
||||
}
|
||||
|
||||
if (object_property_is_link(prop)) {
|
||||
return *(Object **)prop->opaque;
|
||||
LinkProperty *lprop = prop->opaque;
|
||||
return *lprop->child;
|
||||
} else if (object_property_is_child(prop)) {
|
||||
return prop->opaque;
|
||||
} else {
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -69,10 +69,14 @@ _use_sample_img empty.bochs.bz2
|
||||
poke_file "$TEST_IMG" "$disk_size_offset" "\x00\xc0\x0f\x00\x00\x00\x00\x7f"
|
||||
{ $QEMU_IO -c "read 2T 4k" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
|
||||
|
||||
_use_sample_img empty.bochs.bz2
|
||||
poke_file "$TEST_IMG" "$catalog_size_offset" "\x10\x00\x00\x00"
|
||||
{ $QEMU_IO -c "read 0xfbe00 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
|
||||
|
||||
echo
|
||||
echo "== Negative extent size =="
|
||||
_use_sample_img empty.bochs.bz2
|
||||
poke_file "$TEST_IMG" "$extent_size_offset" "\xff\xff\xff\xff"
|
||||
poke_file "$TEST_IMG" "$extent_size_offset" "\x00\x00\x00\x80"
|
||||
{ $QEMU_IO -c "read 768k 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
|
||||
|
||||
echo
|
||||
|
@@ -15,12 +15,14 @@ no file open, try 'help open'
|
||||
== Too small catalog bitmap for image size ==
|
||||
qemu-io: can't open device TEST_DIR/empty.bochs: Catalog size is too small for this disk size
|
||||
no file open, try 'help open'
|
||||
qemu-io: can't open device TEST_DIR/empty.bochs: Catalog size is too small for this disk size
|
||||
no file open, try 'help open'
|
||||
|
||||
== Negative extent size ==
|
||||
qemu-io: can't open device TEST_DIR/empty.bochs: Extent size 4294967295 is too large
|
||||
qemu-io: can't open device TEST_DIR/empty.bochs: Extent size 2147483648 is too large
|
||||
no file open, try 'help open'
|
||||
|
||||
== Zero extent size ==
|
||||
qemu-io: can't open device TEST_DIR/empty.bochs: Extent size may not be zero
|
||||
qemu-io: can't open device TEST_DIR/empty.bochs: Extent size must be at least 512
|
||||
no file open, try 'help open'
|
||||
*** done
|
||||
|
21
ui/sdl2.c
21
ui/sdl2.c
@@ -278,7 +278,7 @@ static void sdl_hide_cursor(void)
|
||||
SDL_ShowCursor(1);
|
||||
SDL_SetCursor(sdl_cursor_hidden);
|
||||
} else {
|
||||
SDL_ShowCursor(0);
|
||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,6 +289,7 @@ static void sdl_show_cursor(void)
|
||||
}
|
||||
|
||||
if (!qemu_input_is_absolute()) {
|
||||
SDL_SetRelativeMouseMode(SDL_FALSE);
|
||||
SDL_ShowCursor(1);
|
||||
if (guest_cursor &&
|
||||
(gui_grab || qemu_input_is_absolute() || absolute_enabled)) {
|
||||
@@ -403,13 +404,17 @@ static void sdl_send_mouse_event(struct sdl2_state *scon, int dx, int dy,
|
||||
}
|
||||
qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_X, off_x + x, max_w);
|
||||
qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y, off_y + y, max_h);
|
||||
} else if (guest_cursor) {
|
||||
x -= guest_x;
|
||||
y -= guest_y;
|
||||
guest_x += x;
|
||||
guest_y += y;
|
||||
qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_X, x);
|
||||
qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_Y, y);
|
||||
} else {
|
||||
if (guest_cursor) {
|
||||
x -= guest_x;
|
||||
y -= guest_y;
|
||||
guest_x += x;
|
||||
guest_y += y;
|
||||
dx = x;
|
||||
dy = y;
|
||||
}
|
||||
qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_X, dx);
|
||||
qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_Y, dy);
|
||||
}
|
||||
qemu_input_event_sync();
|
||||
}
|
||||
|
Reference in New Issue
Block a user