Compare commits
59
Commits
v3.0.0-rc2
...
v3.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38441756b7 | ||
|
|
6ad9080538 | ||
|
|
93f874fe9d | ||
|
|
09b94ac0f2 | ||
|
|
09d98b6980 | ||
|
|
341823c172 | ||
|
|
326049cc8e | ||
|
|
7b69454a12 | ||
|
|
adc4fda6d5 | ||
|
|
78e9ddd75e | ||
|
|
1fb57da72a | ||
|
|
896b63dbff | ||
|
|
e3a4129abd | ||
|
|
1c707d6990 | ||
|
|
10efd7e108 | ||
|
|
16e2841d20 | ||
|
|
16b4226363 | ||
|
|
388a86df9c | ||
|
|
6484ab3dff | ||
|
|
1069a3c6e1 | ||
|
|
f750236039 | ||
|
|
b890416474 | ||
|
|
9a1054061c | ||
|
|
42e76456cf | ||
|
|
45a505d0a4 | ||
|
|
fd76fef8e5 | ||
|
|
5d9f3ea081 | ||
|
|
28cbb997d6 | ||
|
|
38138fab93 | ||
|
|
7b799ec696 | ||
|
|
7aefc14565 | ||
|
|
408e5ace51 | ||
|
|
0261fb805c | ||
|
|
218fe5ce40 | ||
|
|
984b0c100f | ||
|
|
942566ffc1 | ||
|
|
d1fb710a9b | ||
|
|
758b71f7a3 | ||
|
|
1239ac241f | ||
|
|
567dcb31f2 | ||
|
|
5a9cb5a97f | ||
|
|
34fa110e42 | ||
|
|
52ebcb2682 | ||
|
|
8ba4f10fa6 | ||
|
|
e11ce12f5e | ||
|
|
b85504314f | ||
|
|
ac49c189b4 | ||
|
|
f4a1b6536f | ||
|
|
a1c81f4f16 | ||
|
|
308999e9d4 | ||
|
|
41b6513436 | ||
|
|
cc4c77e12b | ||
|
|
e4dab9449a | ||
|
|
1d3db6bdbb | ||
|
|
990e0be260 | ||
|
|
6d9dd5fb9d | ||
|
|
ba891d68b4 | ||
|
|
b65ab77b3a | ||
|
|
ad63c549ec |
No files matched your search
@@ -157,7 +157,6 @@ static void cryptodev_vhost_user_event(void *opaque, int event)
|
||||
{
|
||||
CryptoDevBackendVhostUser *s = opaque;
|
||||
CryptoDevBackend *b = CRYPTODEV_BACKEND(s);
|
||||
Error *err = NULL;
|
||||
int queues = b->conf.peers.queues;
|
||||
|
||||
assert(queues < MAX_CRYPTO_QUEUE_NUM);
|
||||
@@ -174,10 +173,6 @@ static void cryptodev_vhost_user_event(void *opaque, int event)
|
||||
cryptodev_vhost_user_stop(queues, s);
|
||||
break;
|
||||
}
|
||||
|
||||
if (err) {
|
||||
error_report_err(err);
|
||||
}
|
||||
}
|
||||
|
||||
static void cryptodev_vhost_user_init(
|
||||
|
||||
+1
-1
@@ -305,7 +305,7 @@ static void blkdebug_parse_filename(const char *filename, QDict *options,
|
||||
|
||||
if (c != filename) {
|
||||
QString *config_path;
|
||||
config_path = qstring_from_substr(filename, 0, c - filename - 1);
|
||||
config_path = qstring_from_substr(filename, 0, c - filename);
|
||||
qdict_put(options, "config", config_path);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ static void blkverify_parse_filename(const char *filename, QDict *options,
|
||||
}
|
||||
|
||||
/* TODO Implement option pass-through and set raw.filename here */
|
||||
raw_path = qstring_from_substr(filename, 0, c - filename - 1);
|
||||
raw_path = qstring_from_substr(filename, 0, c - filename);
|
||||
qdict_put(options, "x-raw", raw_path);
|
||||
|
||||
/* TODO Allow multi-level nesting and set file.filename here */
|
||||
|
||||
+47
-15
@@ -648,7 +648,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
|
||||
}
|
||||
#endif
|
||||
|
||||
bs->supported_zero_flags = s->discard_zeroes ? BDRV_REQ_MAY_UNMAP : 0;
|
||||
bs->supported_zero_flags = BDRV_REQ_MAY_UNMAP;
|
||||
ret = 0;
|
||||
fail:
|
||||
if (filename && (bdrv_flags & BDRV_O_TEMPORARY)) {
|
||||
@@ -1487,6 +1487,35 @@ static ssize_t handle_aiocb_write_zeroes(RawPosixAIOData *aiocb)
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static ssize_t handle_aiocb_write_zeroes_unmap(RawPosixAIOData *aiocb)
|
||||
{
|
||||
BDRVRawState *s G_GNUC_UNUSED = aiocb->bs->opaque;
|
||||
int ret;
|
||||
|
||||
/* First try to write zeros and unmap at the same time */
|
||||
|
||||
#ifdef CONFIG_FALLOCATE_PUNCH_HOLE
|
||||
ret = do_fallocate(s->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
|
||||
aiocb->aio_offset, aiocb->aio_nbytes);
|
||||
if (ret != -ENOTSUP) {
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_XFS
|
||||
if (s->is_xfs) {
|
||||
/* xfs_discard() guarantees that the discarded area reads as all-zero
|
||||
* afterwards, so we can use it here. */
|
||||
return xfs_discard(s, aiocb->aio_offset, aiocb->aio_nbytes);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If we couldn't manage to unmap while guaranteed that the area reads as
|
||||
* all-zero afterwards, just write zeroes without unmapping */
|
||||
ret = handle_aiocb_write_zeroes(aiocb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifndef HAVE_COPY_FILE_RANGE
|
||||
static off_t copy_file_range(int in_fd, off_t *in_off, int out_fd,
|
||||
off_t *out_off, size_t len, unsigned int flags)
|
||||
@@ -1646,6 +1675,9 @@ static int handle_aiocb_truncate(RawPosixAIOData *aiocb)
|
||||
num = MIN(left, 65536);
|
||||
result = write(fd, buf, num);
|
||||
if (result < 0) {
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
result = -errno;
|
||||
error_setg_errno(errp, -result,
|
||||
"Could not write zeros for preallocation");
|
||||
@@ -1729,6 +1761,9 @@ static int aio_worker(void *arg)
|
||||
case QEMU_AIO_WRITE_ZEROES:
|
||||
ret = handle_aiocb_write_zeroes(aiocb);
|
||||
break;
|
||||
case QEMU_AIO_WRITE_ZEROES | QEMU_AIO_DISCARD:
|
||||
ret = handle_aiocb_write_zeroes_unmap(aiocb);
|
||||
break;
|
||||
case QEMU_AIO_COPY_RANGE:
|
||||
ret = handle_aiocb_copy_range(aiocb);
|
||||
break;
|
||||
@@ -2553,15 +2588,13 @@ static int coroutine_fn raw_co_pwrite_zeroes(
|
||||
int bytes, BdrvRequestFlags flags)
|
||||
{
|
||||
BDRVRawState *s = bs->opaque;
|
||||
int operation = QEMU_AIO_WRITE_ZEROES;
|
||||
|
||||
if (!(flags & BDRV_REQ_MAY_UNMAP)) {
|
||||
return paio_submit_co(bs, s->fd, offset, NULL, bytes,
|
||||
QEMU_AIO_WRITE_ZEROES);
|
||||
} else if (s->discard_zeroes) {
|
||||
return paio_submit_co(bs, s->fd, offset, NULL, bytes,
|
||||
QEMU_AIO_DISCARD);
|
||||
if (flags & BDRV_REQ_MAY_UNMAP) {
|
||||
operation |= QEMU_AIO_DISCARD;
|
||||
}
|
||||
return -ENOTSUP;
|
||||
|
||||
return paio_submit_co(bs, s->fd, offset, NULL, bytes, operation);
|
||||
}
|
||||
|
||||
static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||
@@ -3054,20 +3087,19 @@ static coroutine_fn int hdev_co_pwrite_zeroes(BlockDriverState *bs,
|
||||
int64_t offset, int bytes, BdrvRequestFlags flags)
|
||||
{
|
||||
BDRVRawState *s = bs->opaque;
|
||||
int operation = QEMU_AIO_WRITE_ZEROES | QEMU_AIO_BLKDEV;
|
||||
int rc;
|
||||
|
||||
rc = fd_open(bs);
|
||||
if (rc < 0) {
|
||||
return rc;
|
||||
}
|
||||
if (!(flags & BDRV_REQ_MAY_UNMAP)) {
|
||||
return paio_submit_co(bs, s->fd, offset, NULL, bytes,
|
||||
QEMU_AIO_WRITE_ZEROES|QEMU_AIO_BLKDEV);
|
||||
} else if (s->discard_zeroes) {
|
||||
return paio_submit_co(bs, s->fd, offset, NULL, bytes,
|
||||
QEMU_AIO_DISCARD|QEMU_AIO_BLKDEV);
|
||||
|
||||
if (flags & BDRV_REQ_MAY_UNMAP) {
|
||||
operation |= QEMU_AIO_DISCARD;
|
||||
}
|
||||
return -ENOTSUP;
|
||||
|
||||
return paio_submit_co(bs, s->fd, offset, NULL, bytes, operation);
|
||||
}
|
||||
|
||||
static int coroutine_fn hdev_co_create_opts(const char *filename, QemuOpts *opts,
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ static int nbd_parse_uri(const char *filename, QDict *options)
|
||||
/* strip braces from literal IPv6 address */
|
||||
if (uri->server[0] == '[') {
|
||||
host = qstring_from_substr(uri->server, 1,
|
||||
strlen(uri->server) - 2);
|
||||
strlen(uri->server) - 1);
|
||||
} else {
|
||||
host = qstring_from_str(uri->server);
|
||||
}
|
||||
|
||||
+15
-1
@@ -593,15 +593,29 @@ BlockStatsList *qmp_query_blockstats(bool has_query_nodes,
|
||||
p_next = &info->next;
|
||||
}
|
||||
} else {
|
||||
for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
|
||||
for (blk = blk_all_next(NULL); blk; blk = blk_all_next(blk)) {
|
||||
BlockStatsList *info = g_malloc0(sizeof(*info));
|
||||
AioContext *ctx = blk_get_aio_context(blk);
|
||||
BlockStats *s;
|
||||
char *qdev;
|
||||
|
||||
if (!*blk_name(blk) && !blk_get_attached_dev(blk)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
aio_context_acquire(ctx);
|
||||
s = bdrv_query_bds_stats(blk_bs(blk), true);
|
||||
s->has_device = true;
|
||||
s->device = g_strdup(blk_name(blk));
|
||||
|
||||
qdev = blk_get_attached_dev_id(blk);
|
||||
if (qdev && *qdev) {
|
||||
s->has_qdev = true;
|
||||
s->qdev = qdev;
|
||||
} else {
|
||||
g_free(qdev);
|
||||
}
|
||||
|
||||
bdrv_query_blk_stats(s->stats, blk);
|
||||
aio_context_release(ctx);
|
||||
|
||||
|
||||
@@ -938,6 +938,7 @@ static int coroutine_fn qcow_co_create(BlockdevCreateOptions *opts,
|
||||
ret = 0;
|
||||
exit:
|
||||
blk_unref(qcow_blk);
|
||||
bdrv_unref(bs);
|
||||
qcrypto_block_free(crypto);
|
||||
return ret;
|
||||
}
|
||||
|
||||
+1
-1
@@ -797,7 +797,7 @@ static void read_cache_sizes(BlockDriverState *bs, QemuOpts *opts,
|
||||
if (l2_cache_size_set && refcount_cache_size_set) {
|
||||
error_setg(errp, QCOW2_OPT_CACHE_SIZE ", " QCOW2_OPT_L2_CACHE_SIZE
|
||||
" and " QCOW2_OPT_REFCOUNT_CACHE_SIZE " may not be set "
|
||||
"the same time");
|
||||
"at the same time");
|
||||
return;
|
||||
} else if (*l2_cache_size > combined_cache_size) {
|
||||
error_setg(errp, QCOW2_OPT_L2_CACHE_SIZE " may not exceed "
|
||||
|
||||
@@ -255,6 +255,17 @@ comparable library support for invoking and interacting with QEMU programs. If
|
||||
you opt for Python, it is strongly recommended to write Python 3 compatible
|
||||
code.
|
||||
|
||||
Both Python and Bash frameworks in iotests provide helpers to manage test
|
||||
images. They can be used to create and clean up images under the test
|
||||
directory. If no I/O or any protocol specific feature is needed, it is often
|
||||
more convenient to use the pseudo block driver, ``null-co://``, as the test
|
||||
image, which doesn't require image creation or cleaning up. Avoid system-wide
|
||||
devices or files whenever possible, such as ``/dev/null`` or ``/dev/zero``.
|
||||
Otherwise, image locking implications have to be considered. For example,
|
||||
another application on the host may have locked the file, possibly leading to a
|
||||
test failure. If using such devices are explicitly desired, consider adding
|
||||
``locking=off`` option to disable image locking.
|
||||
|
||||
Docker based tests
|
||||
==================
|
||||
|
||||
|
||||
+1
-1
@@ -382,7 +382,7 @@ static void iotkit_realize(DeviceState *dev, Error **errp)
|
||||
return;
|
||||
}
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer1), 0,
|
||||
qdev_get_gpio_in(DEVICE(&s->armv7m), 3));
|
||||
qdev_get_gpio_in(DEVICE(&s->armv7m), 4));
|
||||
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->timer1), 0);
|
||||
object_property_set_link(OBJECT(&s->apb_ppc0), OBJECT(mr), "port[1]", &err);
|
||||
if (err) {
|
||||
|
||||
@@ -1414,6 +1414,7 @@ static const VMStateDescription vmstate_smmuv3_queue = {
|
||||
VMSTATE_UINT32(prod, SMMUQueue),
|
||||
VMSTATE_UINT32(cons, SMMUQueue),
|
||||
VMSTATE_UINT8(log2size, SMMUQueue),
|
||||
VMSTATE_END_OF_LIST(),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ static void copy_properties_from_host(HostProperty *props, int nb_props,
|
||||
/* mandatory property not found: bail out */
|
||||
exit(1);
|
||||
}
|
||||
err = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,6 +421,11 @@ static void virtio_gpu_disable_scanout(VirtIOGPU *g, int scanout_id)
|
||||
scanout->height ?: 480,
|
||||
"Guest disabled display.");
|
||||
}
|
||||
|
||||
if (g->disable_scanout) {
|
||||
g->disable_scanout(g, scanout_id);
|
||||
}
|
||||
|
||||
dpy_gfx_replace_surface(scanout->con, ds);
|
||||
scanout->resource_id = 0;
|
||||
scanout->ds = NULL;
|
||||
|
||||
@@ -75,6 +75,16 @@ static void virtio_vga_gl_block(void *opaque, bool block)
|
||||
}
|
||||
}
|
||||
|
||||
static void virtio_vga_disable_scanout(VirtIOGPU *g, int scanout_id)
|
||||
{
|
||||
VirtIOVGA *vvga = container_of(g, VirtIOVGA, vdev);
|
||||
|
||||
if (scanout_id == 0) {
|
||||
/* reset surface if needed */
|
||||
vvga->vga.graphic_mode = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static const GraphicHwOps virtio_vga_ops = {
|
||||
.invalidate = virtio_vga_invalidate_display,
|
||||
.gfx_update = virtio_vga_update_display,
|
||||
@@ -156,6 +166,7 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
|
||||
vvga->vga_mrs, true);
|
||||
|
||||
vga->con = g->scanout[0].con;
|
||||
g->disable_scanout = virtio_vga_disable_scanout;
|
||||
graphic_console_set_hwops(vga->con, &virtio_vga_ops, vvga);
|
||||
|
||||
for (i = 0; i < g->conf.max_outputs; i++) {
|
||||
|
||||
+16
-12
@@ -2269,7 +2269,16 @@ static void build_srat_hotpluggable_memory(GArray *table_data, uint64_t base,
|
||||
numamem = acpi_data_push(table_data, sizeof *numamem);
|
||||
|
||||
if (!info) {
|
||||
build_srat_memory(numamem, cur, end - cur, default_node,
|
||||
/*
|
||||
* Entry is required for Windows to enable memory hotplug in OS
|
||||
* and for Linux to enable SWIOTLB when booted with less than
|
||||
* 4G of RAM. Windows works better if the entry sets proximity
|
||||
* to the highest NUMA node in the machine at the end of the
|
||||
* reserved space.
|
||||
* Memory devices may override proximity set by this entry,
|
||||
* providing _PXM method if necessary.
|
||||
*/
|
||||
build_srat_memory(numamem, end - 1, 1, default_node,
|
||||
MEM_AFFINITY_HOTPLUGGABLE | MEM_AFFINITY_ENABLED);
|
||||
break;
|
||||
}
|
||||
@@ -2392,9 +2401,12 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
|
||||
mem_len = next_base - pcms->below_4g_mem_size;
|
||||
next_base = mem_base + mem_len;
|
||||
}
|
||||
numamem = acpi_data_push(table_data, sizeof *numamem);
|
||||
build_srat_memory(numamem, mem_base, mem_len, i - 1,
|
||||
MEM_AFFINITY_ENABLED);
|
||||
|
||||
if (mem_len > 0) {
|
||||
numamem = acpi_data_push(table_data, sizeof *numamem);
|
||||
build_srat_memory(numamem, mem_base, mem_len, i - 1,
|
||||
MEM_AFFINITY_ENABLED);
|
||||
}
|
||||
}
|
||||
slots = (table_data->len - numa_start) / sizeof *numamem;
|
||||
for (; slots < pcms->numa_nodes + 2; slots++) {
|
||||
@@ -2402,14 +2414,6 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
|
||||
build_srat_memory(numamem, 0, 0, 0, MEM_AFFINITY_NOFLAGS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Entry is required for Windows to enable memory hotplug in OS
|
||||
* and for Linux to enable SWIOTLB when booted with less than
|
||||
* 4G of RAM. Windows works better if the entry sets proximity
|
||||
* to the highest NUMA node in the machine.
|
||||
* Memory devices may override proximity set by this entry,
|
||||
* providing _PXM method if necessary.
|
||||
*/
|
||||
if (hotplugabble_address_space_size) {
|
||||
build_srat_hotpluggable_memory(table_data, machine->device_memory->base,
|
||||
hotplugabble_address_space_size,
|
||||
|
||||
+142
-142
@@ -29,148 +29,11 @@
|
||||
#include "hw/arm/linux-boot-if.h"
|
||||
#include "sysemu/kvm.h"
|
||||
|
||||
static int gicv3_pre_save(void *opaque)
|
||||
|
||||
static void gicv3_gicd_no_migration_shift_bug_post_load(GICv3State *cs)
|
||||
{
|
||||
GICv3State *s = (GICv3State *)opaque;
|
||||
ARMGICv3CommonClass *c = ARM_GICV3_COMMON_GET_CLASS(s);
|
||||
|
||||
if (c->pre_save) {
|
||||
c->pre_save(s);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gicv3_post_load(void *opaque, int version_id)
|
||||
{
|
||||
GICv3State *s = (GICv3State *)opaque;
|
||||
ARMGICv3CommonClass *c = ARM_GICV3_COMMON_GET_CLASS(s);
|
||||
|
||||
if (c->post_load) {
|
||||
c->post_load(s);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool virt_state_needed(void *opaque)
|
||||
{
|
||||
GICv3CPUState *cs = opaque;
|
||||
|
||||
return cs->num_list_regs != 0;
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_gicv3_cpu_virt = {
|
||||
.name = "arm_gicv3_cpu/virt",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = virt_state_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT64_2DARRAY(ich_apr, GICv3CPUState, 3, 4),
|
||||
VMSTATE_UINT64(ich_hcr_el2, GICv3CPUState),
|
||||
VMSTATE_UINT64_ARRAY(ich_lr_el2, GICv3CPUState, GICV3_LR_MAX),
|
||||
VMSTATE_UINT64(ich_vmcr_el2, GICv3CPUState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
|
||||
static int icc_sre_el1_reg_pre_load(void *opaque)
|
||||
{
|
||||
GICv3CPUState *cs = opaque;
|
||||
|
||||
/*
|
||||
* If the sre_el1 subsection is not transferred this
|
||||
* means SRE_EL1 is 0x7 (which might not be the same as
|
||||
* our reset value).
|
||||
*/
|
||||
cs->icc_sre_el1 = 0x7;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool icc_sre_el1_reg_needed(void *opaque)
|
||||
{
|
||||
GICv3CPUState *cs = opaque;
|
||||
|
||||
return cs->icc_sre_el1 != 7;
|
||||
}
|
||||
|
||||
const VMStateDescription vmstate_gicv3_cpu_sre_el1 = {
|
||||
.name = "arm_gicv3_cpu/sre_el1",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.pre_load = icc_sre_el1_reg_pre_load,
|
||||
.needed = icc_sre_el1_reg_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT64(icc_sre_el1, GICv3CPUState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
|
||||
static const VMStateDescription vmstate_gicv3_cpu = {
|
||||
.name = "arm_gicv3_cpu",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT32(level, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_ctlr, GICv3CPUState),
|
||||
VMSTATE_UINT32_ARRAY(gicr_statusr, GICv3CPUState, 2),
|
||||
VMSTATE_UINT32(gicr_waker, GICv3CPUState),
|
||||
VMSTATE_UINT64(gicr_propbaser, GICv3CPUState),
|
||||
VMSTATE_UINT64(gicr_pendbaser, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_igroupr0, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_ienabler0, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_ipendr0, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_iactiver0, GICv3CPUState),
|
||||
VMSTATE_UINT32(edge_trigger, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_igrpmodr0, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_nsacr, GICv3CPUState),
|
||||
VMSTATE_UINT8_ARRAY(gicr_ipriorityr, GICv3CPUState, GIC_INTERNAL),
|
||||
VMSTATE_UINT64_ARRAY(icc_ctlr_el1, GICv3CPUState, 2),
|
||||
VMSTATE_UINT64(icc_pmr_el1, GICv3CPUState),
|
||||
VMSTATE_UINT64_ARRAY(icc_bpr, GICv3CPUState, 3),
|
||||
VMSTATE_UINT64_2DARRAY(icc_apr, GICv3CPUState, 3, 4),
|
||||
VMSTATE_UINT64_ARRAY(icc_igrpen, GICv3CPUState, 3),
|
||||
VMSTATE_UINT64(icc_ctlr_el3, GICv3CPUState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
},
|
||||
.subsections = (const VMStateDescription * []) {
|
||||
&vmstate_gicv3_cpu_virt,
|
||||
NULL
|
||||
},
|
||||
.subsections = (const VMStateDescription * []) {
|
||||
&vmstate_gicv3_cpu_sre_el1,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static int gicv3_gicd_no_migration_shift_bug_pre_load(void *opaque)
|
||||
{
|
||||
GICv3State *cs = opaque;
|
||||
|
||||
/*
|
||||
* The gicd_no_migration_shift_bug flag is used for migration compatibility
|
||||
* for old version QEMU which may have the GICD bmp shift bug under KVM mode.
|
||||
* Strictly, what we want to know is whether the migration source is using
|
||||
* KVM. Since we don't have any way to determine that, we look at whether the
|
||||
* destination is using KVM; this is close enough because for the older QEMU
|
||||
* versions with this bug KVM -> TCG migration didn't work anyway. If the
|
||||
* source is a newer QEMU without this bug it will transmit the migration
|
||||
* subsection which sets the flag to true; otherwise it will remain set to
|
||||
* the value we select here.
|
||||
*/
|
||||
if (kvm_enabled()) {
|
||||
cs->gicd_no_migration_shift_bug = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gicv3_gicd_no_migration_shift_bug_post_load(void *opaque,
|
||||
int version_id)
|
||||
{
|
||||
GICv3State *cs = opaque;
|
||||
|
||||
if (cs->gicd_no_migration_shift_bug) {
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Older versions of QEMU had a bug in the handling of state save/restore
|
||||
@@ -199,16 +62,152 @@ static int gicv3_gicd_no_migration_shift_bug_post_load(void *opaque,
|
||||
* for next migration to work from this new version QEMU.
|
||||
*/
|
||||
cs->gicd_no_migration_shift_bug = true;
|
||||
}
|
||||
|
||||
static int gicv3_pre_save(void *opaque)
|
||||
{
|
||||
GICv3State *s = (GICv3State *)opaque;
|
||||
ARMGICv3CommonClass *c = ARM_GICV3_COMMON_GET_CLASS(s);
|
||||
|
||||
if (c->pre_save) {
|
||||
c->pre_save(s);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gicv3_post_load(void *opaque, int version_id)
|
||||
{
|
||||
GICv3State *s = (GICv3State *)opaque;
|
||||
ARMGICv3CommonClass *c = ARM_GICV3_COMMON_GET_CLASS(s);
|
||||
|
||||
gicv3_gicd_no_migration_shift_bug_post_load(s);
|
||||
|
||||
if (c->post_load) {
|
||||
c->post_load(s);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool virt_state_needed(void *opaque)
|
||||
{
|
||||
GICv3CPUState *cs = opaque;
|
||||
|
||||
return cs->num_list_regs != 0;
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_gicv3_cpu_virt = {
|
||||
.name = "arm_gicv3_cpu/virt",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = virt_state_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT64_2DARRAY(ich_apr, GICv3CPUState, 3, 4),
|
||||
VMSTATE_UINT64(ich_hcr_el2, GICv3CPUState),
|
||||
VMSTATE_UINT64_ARRAY(ich_lr_el2, GICv3CPUState, GICV3_LR_MAX),
|
||||
VMSTATE_UINT64(ich_vmcr_el2, GICv3CPUState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
|
||||
static int vmstate_gicv3_cpu_pre_load(void *opaque)
|
||||
{
|
||||
GICv3CPUState *cs = opaque;
|
||||
|
||||
/*
|
||||
* If the sre_el1 subsection is not transferred this
|
||||
* means SRE_EL1 is 0x7 (which might not be the same as
|
||||
* our reset value).
|
||||
*/
|
||||
cs->icc_sre_el1 = 0x7;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool icc_sre_el1_reg_needed(void *opaque)
|
||||
{
|
||||
GICv3CPUState *cs = opaque;
|
||||
|
||||
return cs->icc_sre_el1 != 7;
|
||||
}
|
||||
|
||||
const VMStateDescription vmstate_gicv3_cpu_sre_el1 = {
|
||||
.name = "arm_gicv3_cpu/sre_el1",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = icc_sre_el1_reg_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT64(icc_sre_el1, GICv3CPUState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
|
||||
static const VMStateDescription vmstate_gicv3_cpu = {
|
||||
.name = "arm_gicv3_cpu",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.pre_load = vmstate_gicv3_cpu_pre_load,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT32(level, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_ctlr, GICv3CPUState),
|
||||
VMSTATE_UINT32_ARRAY(gicr_statusr, GICv3CPUState, 2),
|
||||
VMSTATE_UINT32(gicr_waker, GICv3CPUState),
|
||||
VMSTATE_UINT64(gicr_propbaser, GICv3CPUState),
|
||||
VMSTATE_UINT64(gicr_pendbaser, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_igroupr0, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_ienabler0, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_ipendr0, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_iactiver0, GICv3CPUState),
|
||||
VMSTATE_UINT32(edge_trigger, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_igrpmodr0, GICv3CPUState),
|
||||
VMSTATE_UINT32(gicr_nsacr, GICv3CPUState),
|
||||
VMSTATE_UINT8_ARRAY(gicr_ipriorityr, GICv3CPUState, GIC_INTERNAL),
|
||||
VMSTATE_UINT64_ARRAY(icc_ctlr_el1, GICv3CPUState, 2),
|
||||
VMSTATE_UINT64(icc_pmr_el1, GICv3CPUState),
|
||||
VMSTATE_UINT64_ARRAY(icc_bpr, GICv3CPUState, 3),
|
||||
VMSTATE_UINT64_2DARRAY(icc_apr, GICv3CPUState, 3, 4),
|
||||
VMSTATE_UINT64_ARRAY(icc_igrpen, GICv3CPUState, 3),
|
||||
VMSTATE_UINT64(icc_ctlr_el3, GICv3CPUState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
},
|
||||
.subsections = (const VMStateDescription * []) {
|
||||
&vmstate_gicv3_cpu_virt,
|
||||
&vmstate_gicv3_cpu_sre_el1,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static int gicv3_pre_load(void *opaque)
|
||||
{
|
||||
GICv3State *cs = opaque;
|
||||
|
||||
/*
|
||||
* The gicd_no_migration_shift_bug flag is used for migration compatibility
|
||||
* for old version QEMU which may have the GICD bmp shift bug under KVM mode.
|
||||
* Strictly, what we want to know is whether the migration source is using
|
||||
* KVM. Since we don't have any way to determine that, we look at whether the
|
||||
* destination is using KVM; this is close enough because for the older QEMU
|
||||
* versions with this bug KVM -> TCG migration didn't work anyway. If the
|
||||
* source is a newer QEMU without this bug it will transmit the migration
|
||||
* subsection which sets the flag to true; otherwise it will remain set to
|
||||
* the value we select here.
|
||||
*/
|
||||
if (kvm_enabled()) {
|
||||
cs->gicd_no_migration_shift_bug = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool needed_always(void *opaque)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const VMStateDescription vmstate_gicv3_gicd_no_migration_shift_bug = {
|
||||
.name = "arm_gicv3/gicd_no_migration_shift_bug",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.pre_load = gicv3_gicd_no_migration_shift_bug_pre_load,
|
||||
.post_load = gicv3_gicd_no_migration_shift_bug_post_load,
|
||||
.needed = needed_always,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_BOOL(gicd_no_migration_shift_bug, GICv3State),
|
||||
VMSTATE_END_OF_LIST()
|
||||
@@ -219,6 +218,7 @@ static const VMStateDescription vmstate_gicv3 = {
|
||||
.name = "arm_gicv3",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.pre_load = gicv3_pre_load,
|
||||
.pre_save = gicv3_pre_save,
|
||||
.post_load = gicv3_post_load,
|
||||
.priority = MIG_PRI_GICV3,
|
||||
|
||||
@@ -2064,7 +2064,7 @@ static int nvic_security_post_load(void *opaque, int version_id)
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_nvic_security = {
|
||||
.name = "nvic/m-security",
|
||||
.name = "armv7m_nvic/m-security",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = nvic_security_needed,
|
||||
|
||||
@@ -554,9 +554,8 @@ static void cuda_init(Object *obj)
|
||||
CUDAState *s = CUDA(obj);
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
|
||||
|
||||
object_initialize(&s->mos6522_cuda, sizeof(s->mos6522_cuda),
|
||||
TYPE_MOS6522_CUDA);
|
||||
qdev_set_parent_bus(DEVICE(&s->mos6522_cuda), sysbus_get_default());
|
||||
sysbus_init_child_obj(obj, "mos6522-cuda", &s->mos6522_cuda,
|
||||
sizeof(s->mos6522_cuda), TYPE_MOS6522_CUDA);
|
||||
|
||||
memory_region_init_io(&s->mem, obj, &mos6522_cuda_ops, s, "cuda", 0x2000);
|
||||
sysbus_init_mmio(sbd, &s->mem);
|
||||
|
||||
+8
-16
@@ -209,14 +209,11 @@ static void macio_oldworld_realize(PCIDevice *d, Error **errp)
|
||||
static void macio_init_ide(MacIOState *s, MACIOIDEState *ide, size_t ide_size,
|
||||
int index)
|
||||
{
|
||||
gchar *name;
|
||||
gchar *name = g_strdup_printf("ide[%i]", index);
|
||||
|
||||
object_initialize(ide, ide_size, TYPE_MACIO_IDE);
|
||||
qdev_set_parent_bus(DEVICE(ide), sysbus_get_default());
|
||||
sysbus_init_child_obj(OBJECT(s), name, ide, ide_size, TYPE_MACIO_IDE);
|
||||
memory_region_add_subregion(&s->bar, 0x1f000 + ((index + 1) * 0x1000),
|
||||
&ide->mem);
|
||||
name = g_strdup_printf("ide[%i]", index);
|
||||
object_property_add_child(OBJECT(s), name, OBJECT(ide), NULL);
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
@@ -232,9 +229,7 @@ static void macio_oldworld_init(Object *obj)
|
||||
qdev_prop_allow_set_link_before_realize,
|
||||
0, NULL);
|
||||
|
||||
object_initialize(&s->cuda, sizeof(s->cuda), TYPE_CUDA);
|
||||
qdev_set_parent_bus(DEVICE(&s->cuda), sysbus_get_default());
|
||||
object_property_add_child(obj, "cuda", OBJECT(&s->cuda), NULL);
|
||||
sysbus_init_child_obj(obj, "cuda", &s->cuda, sizeof(s->cuda), TYPE_CUDA);
|
||||
|
||||
object_initialize(&os->nvram, sizeof(os->nvram), TYPE_MACIO_NVRAM);
|
||||
dev = DEVICE(&os->nvram);
|
||||
@@ -390,8 +385,8 @@ static void macio_newworld_init(Object *obj)
|
||||
qdev_prop_allow_set_link_before_realize,
|
||||
0, NULL);
|
||||
|
||||
object_initialize(&ns->gpio, sizeof(ns->gpio), TYPE_MACIO_GPIO);
|
||||
qdev_set_parent_bus(DEVICE(&ns->gpio), sysbus_get_default());
|
||||
sysbus_init_child_obj(obj, "gpio", &ns->gpio, sizeof(ns->gpio),
|
||||
TYPE_MACIO_GPIO);
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
macio_init_ide(s, &ns->ide[i], sizeof(ns->ide[i]), i);
|
||||
@@ -404,13 +399,10 @@ static void macio_instance_init(Object *obj)
|
||||
|
||||
memory_region_init(&s->bar, obj, "macio", 0x80000);
|
||||
|
||||
object_initialize(&s->dbdma, sizeof(s->dbdma), TYPE_MAC_DBDMA);
|
||||
qdev_set_parent_bus(DEVICE(&s->dbdma), sysbus_get_default());
|
||||
object_property_add_child(obj, "dbdma", OBJECT(&s->dbdma), NULL);
|
||||
sysbus_init_child_obj(obj, "dbdma", &s->dbdma, sizeof(s->dbdma),
|
||||
TYPE_MAC_DBDMA);
|
||||
|
||||
object_initialize(&s->escc, sizeof(s->escc), TYPE_ESCC);
|
||||
qdev_set_parent_bus(DEVICE(&s->escc), sysbus_get_default());
|
||||
object_property_add_child(obj, "escc", OBJECT(&s->escc), NULL);
|
||||
sysbus_init_child_obj(obj, "escc", &s->escc, sizeof(s->escc), TYPE_ESCC);
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_macio_oldworld = {
|
||||
|
||||
+2
-3
@@ -770,9 +770,8 @@ static void pmu_init(Object *obj)
|
||||
qdev_prop_allow_set_link_before_realize,
|
||||
0, NULL);
|
||||
|
||||
object_initialize(&s->mos6522_pmu, sizeof(s->mos6522_pmu),
|
||||
TYPE_MOS6522_PMU);
|
||||
qdev_set_parent_bus(DEVICE(&s->mos6522_pmu), sysbus_get_default());
|
||||
sysbus_init_child_obj(obj, "mos6522-pmu", &s->mos6522_pmu,
|
||||
sizeof(s->mos6522_pmu), TYPE_MOS6522_PMU);
|
||||
|
||||
memory_region_init_io(&s->mem, obj, &mos6522_pmu_ops, s, "via-pmu",
|
||||
0x2000);
|
||||
|
||||
+1
-1
@@ -547,7 +547,7 @@ static void tz_mpc_realize(DeviceState *dev, Error **errp)
|
||||
address_space_init(&s->blocked_io_as, &s->blocked_io,
|
||||
"tz-mpc-blocked-io");
|
||||
|
||||
s->blk_lut = g_new(uint32_t, s->blk_max);
|
||||
s->blk_lut = g_new0(uint32_t, s->blk_max);
|
||||
}
|
||||
|
||||
static int tz_mpc_post_load(void *opaque, int version_id)
|
||||
|
||||
+8
-13
@@ -57,7 +57,7 @@ typedef struct PPC440PCIXState {
|
||||
struct PLBOutMap pom[PPC440_PCIX_NR_POMS];
|
||||
struct PLBInMap pim[PPC440_PCIX_NR_PIMS];
|
||||
uint32_t sts;
|
||||
qemu_irq irq[PCI_NUM_PINS];
|
||||
qemu_irq irq;
|
||||
AddressSpace bm_as;
|
||||
MemoryRegion bm;
|
||||
|
||||
@@ -418,21 +418,20 @@ static void ppc440_pcix_reset(DeviceState *dev)
|
||||
* This may need further refactoring for other boards. */
|
||||
static int ppc440_pcix_map_irq(PCIDevice *pci_dev, int irq_num)
|
||||
{
|
||||
int slot = pci_dev->devfn >> 3;
|
||||
trace_ppc440_pcix_map_irq(pci_dev->devfn, irq_num, slot);
|
||||
return slot - 1;
|
||||
trace_ppc440_pcix_map_irq(pci_dev->devfn, irq_num, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ppc440_pcix_set_irq(void *opaque, int irq_num, int level)
|
||||
{
|
||||
qemu_irq *pci_irqs = opaque;
|
||||
qemu_irq *pci_irq = opaque;
|
||||
|
||||
trace_ppc440_pcix_set_irq(irq_num);
|
||||
if (irq_num < 0) {
|
||||
error_report("%s: PCI irq %d", __func__, irq_num);
|
||||
return;
|
||||
}
|
||||
qemu_set_irq(pci_irqs[irq_num], level);
|
||||
qemu_set_irq(*pci_irq, level);
|
||||
}
|
||||
|
||||
static AddressSpace *ppc440_pcix_set_iommu(PCIBus *b, void *opaque, int devfn)
|
||||
@@ -471,19 +470,15 @@ static int ppc440_pcix_initfn(SysBusDevice *dev)
|
||||
{
|
||||
PPC440PCIXState *s;
|
||||
PCIHostState *h;
|
||||
int i;
|
||||
|
||||
h = PCI_HOST_BRIDGE(dev);
|
||||
s = PPC440_PCIX_HOST_BRIDGE(dev);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(s->irq); i++) {
|
||||
sysbus_init_irq(dev, &s->irq[i]);
|
||||
}
|
||||
|
||||
sysbus_init_irq(dev, &s->irq);
|
||||
memory_region_init(&s->busmem, OBJECT(dev), "pci bus memory", UINT64_MAX);
|
||||
h->bus = pci_register_root_bus(DEVICE(dev), NULL, ppc440_pcix_set_irq,
|
||||
ppc440_pcix_map_irq, s->irq, &s->busmem,
|
||||
get_system_io(), PCI_DEVFN(0, 0), 4, TYPE_PCI_BUS);
|
||||
ppc440_pcix_map_irq, &s->irq, &s->busmem,
|
||||
get_system_io(), PCI_DEVFN(0, 0), 1, TYPE_PCI_BUS);
|
||||
|
||||
s->dev = pci_create_simple(h->bus, PCI_DEVFN(0, 0), "ppc4xx-host-bridge");
|
||||
|
||||
|
||||
+2
-4
@@ -515,10 +515,8 @@ static void sam460ex_init(MachineState *machine)
|
||||
|
||||
/* PCI bus */
|
||||
ppc460ex_pcie_init(env);
|
||||
/* FIXME: is this correct? */
|
||||
dev = sysbus_create_varargs("ppc440-pcix-host", 0xc0ec00000,
|
||||
uic[1][0], uic[1][20], uic[1][21], uic[1][22],
|
||||
NULL);
|
||||
/* All PCI irqs are connected to the same UIC pin (cf. UBoot source) */
|
||||
dev = sysbus_create_simple("ppc440-pcix-host", 0xc0ec00000, uic[1][0]);
|
||||
pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0");
|
||||
if (!pci_bus) {
|
||||
error_report("couldn't create PCI controller!");
|
||||
|
||||
@@ -320,6 +320,7 @@ static void sclp_memory_init(SCLPDevice *sclp)
|
||||
initial_mem = initial_mem >> increment_size << increment_size;
|
||||
|
||||
machine->ram_size = initial_mem;
|
||||
machine->maxram_size = initial_mem;
|
||||
/* let's propagate the changed ram size into the global variable. */
|
||||
ram_size = initial_mem;
|
||||
}
|
||||
|
||||
+3
-1
@@ -663,12 +663,14 @@ static void vhost_iommu_region_add(MemoryListener *listener,
|
||||
struct vhost_iommu *iommu;
|
||||
Int128 end;
|
||||
int iommu_idx;
|
||||
IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr);
|
||||
IOMMUMemoryRegion *iommu_mr;
|
||||
|
||||
if (!memory_region_is_iommu(section->mr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
iommu_mr = IOMMU_MEMORY_REGION(section->mr);
|
||||
|
||||
iommu = g_malloc0(sizeof(*iommu));
|
||||
end = int128_add(int128_make64(section->offset_within_region),
|
||||
section->size);
|
||||
|
||||
@@ -43,11 +43,12 @@ typedef struct BlockFragInfo {
|
||||
typedef enum {
|
||||
BDRV_REQ_COPY_ON_READ = 0x1,
|
||||
BDRV_REQ_ZERO_WRITE = 0x2,
|
||||
/* The BDRV_REQ_MAY_UNMAP flag is used to indicate that the block driver
|
||||
* is allowed to optimize a write zeroes request by unmapping (discarding)
|
||||
* blocks if it is guaranteed that the result will read back as
|
||||
* zeroes. The flag is only passed to the driver if the block device is
|
||||
* opened with BDRV_O_UNMAP.
|
||||
|
||||
/*
|
||||
* The BDRV_REQ_MAY_UNMAP flag is used in write_zeroes requests to indicate
|
||||
* that the block driver should unmap (discard) blocks if it is guaranteed
|
||||
* that the result will read back as zeroes. The flag is only passed to the
|
||||
* driver if the block device is opened with BDRV_O_UNMAP.
|
||||
*/
|
||||
BDRV_REQ_MAY_UNMAP = 0x4,
|
||||
|
||||
|
||||
@@ -317,6 +317,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
|
||||
#define PC_COMPAT_2_11 \
|
||||
HW_COMPAT_2_11 \
|
||||
{\
|
||||
.driver = TYPE_X86_CPU,\
|
||||
.property = "x-migrate-smi-count",\
|
||||
.value = "off",\
|
||||
},{\
|
||||
.driver = "Skylake-Server" "-" TYPE_X86_CPU,\
|
||||
.property = "clflushopt",\
|
||||
.value = "off",\
|
||||
|
||||
@@ -125,6 +125,7 @@ typedef struct VirtIOGPU {
|
||||
uint32_t bytes_3d;
|
||||
} stats;
|
||||
|
||||
void (*disable_scanout)(struct VirtIOGPU *g, int scanout_id);
|
||||
Error *migration_blocker;
|
||||
} VirtIOGPU;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ struct QString {
|
||||
|
||||
QString *qstring_new(void);
|
||||
QString *qstring_from_str(const char *str);
|
||||
QString *qstring_from_substr(const char *str, int start, int end);
|
||||
QString *qstring_from_substr(const char *str, size_t start, size_t end);
|
||||
size_t qstring_get_length(const QString *qstring);
|
||||
const char *qstring_get_str(const QString *qstring);
|
||||
const char *qstring_get_try_str(const QString *qstring);
|
||||
|
||||
@@ -49,7 +49,9 @@ safe_syscall_base:
|
||||
* and returns the result in r3
|
||||
* Shuffle everything around appropriately.
|
||||
*/
|
||||
mr 11, 3 /* signal_pending */
|
||||
std 14, 16(1) /* Preserve r14 in SP+16 */
|
||||
.cfi_offset 14, 16
|
||||
mr 14, 3 /* signal_pending */
|
||||
mr 0, 4 /* syscall number */
|
||||
mr 3, 5 /* syscall arguments */
|
||||
mr 4, 6
|
||||
@@ -67,12 +69,13 @@ safe_syscall_base:
|
||||
*/
|
||||
safe_syscall_start:
|
||||
/* if signal_pending is non-zero, don't do the call */
|
||||
lwz 12, 0(11)
|
||||
lwz 12, 0(14)
|
||||
cmpwi 0, 12, 0
|
||||
bne- 0f
|
||||
sc
|
||||
safe_syscall_end:
|
||||
/* code path when we did execute the syscall */
|
||||
ld 14, 16(1) /* restore r14 to its original value */
|
||||
bnslr+
|
||||
|
||||
/* syscall failed; return negative errno */
|
||||
@@ -81,6 +84,7 @@ safe_syscall_end:
|
||||
|
||||
/* code path when we didn't execute the syscall */
|
||||
0: addi 3, 0, -TARGET_ERESTARTSYS
|
||||
ld 14, 16(1) /* restore r14 to its orginal value */
|
||||
blr
|
||||
.cfi_endproc
|
||||
|
||||
|
||||
+12
-3
@@ -391,14 +391,23 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!len) {
|
||||
errno = EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Also check for overflows... */
|
||||
len = TARGET_PAGE_ALIGN(len);
|
||||
if (!len) {
|
||||
errno = ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (offset & ~TARGET_PAGE_MASK) {
|
||||
errno = EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
len = TARGET_PAGE_ALIGN(len);
|
||||
if (len == 0)
|
||||
goto the_end;
|
||||
real_start = start & qemu_host_page_mask;
|
||||
host_offset = offset & qemu_host_page_mask;
|
||||
|
||||
|
||||
@@ -633,7 +633,7 @@ static void monitor_qapi_event_handler(void *opaque);
|
||||
* applying any rate limiting if required.
|
||||
*/
|
||||
static void
|
||||
monitor_qapi_event_queue(QAPIEvent event, QDict *qdict, Error **errp)
|
||||
monitor_qapi_event_queue_no_reenter(QAPIEvent event, QDict *qdict)
|
||||
{
|
||||
MonitorQAPIEventConf *evconf;
|
||||
MonitorQAPIEventState *evstate;
|
||||
@@ -688,6 +688,48 @@ monitor_qapi_event_queue(QAPIEvent event, QDict *qdict, Error **errp)
|
||||
qemu_mutex_unlock(&monitor_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
monitor_qapi_event_queue(QAPIEvent event, QDict *qdict, Error **errp)
|
||||
{
|
||||
/*
|
||||
* monitor_qapi_event_queue_no_reenter() is not reentrant: it
|
||||
* would deadlock on monitor_lock. Work around by queueing
|
||||
* events in thread-local storage.
|
||||
* TODO: remove this, make it re-enter safe.
|
||||
*/
|
||||
typedef struct MonitorQapiEvent {
|
||||
QAPIEvent event;
|
||||
QDict *qdict;
|
||||
QSIMPLEQ_ENTRY(MonitorQapiEvent) entry;
|
||||
} MonitorQapiEvent;
|
||||
static __thread QSIMPLEQ_HEAD(, MonitorQapiEvent) event_queue;
|
||||
static __thread bool reentered;
|
||||
MonitorQapiEvent *ev;
|
||||
|
||||
if (!reentered) {
|
||||
QSIMPLEQ_INIT(&event_queue);
|
||||
}
|
||||
|
||||
ev = g_new(MonitorQapiEvent, 1);
|
||||
ev->qdict = qobject_ref(qdict);
|
||||
ev->event = event;
|
||||
QSIMPLEQ_INSERT_TAIL(&event_queue, ev, entry);
|
||||
if (reentered) {
|
||||
return;
|
||||
}
|
||||
|
||||
reentered = true;
|
||||
|
||||
while ((ev = QSIMPLEQ_FIRST(&event_queue)) != NULL) {
|
||||
QSIMPLEQ_REMOVE_HEAD(&event_queue, entry);
|
||||
monitor_qapi_event_queue_no_reenter(ev->event, ev->qdict);
|
||||
qobject_unref(ev->qdict);
|
||||
g_free(ev);
|
||||
}
|
||||
|
||||
reentered = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function runs evconf->rate ns after sending a throttled
|
||||
* event.
|
||||
|
||||
+10
-4
@@ -866,6 +866,9 @@
|
||||
#
|
||||
# @node-name: The node name of the device. (Since 2.3)
|
||||
#
|
||||
# @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
|
||||
# device. (since 3.0)
|
||||
#
|
||||
# @stats: A @BlockDeviceStats for the device.
|
||||
#
|
||||
# @parent: This describes the file block device if it has one.
|
||||
@@ -879,7 +882,7 @@
|
||||
# Since: 0.14.0
|
||||
##
|
||||
{ 'struct': 'BlockStats',
|
||||
'data': {'*device': 'str', '*node-name': 'str',
|
||||
'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
|
||||
'stats': 'BlockDeviceStats',
|
||||
'*parent': 'BlockStats',
|
||||
'*backing': 'BlockStats'} }
|
||||
@@ -941,7 +944,8 @@
|
||||
# "idle_time_ns":2953431879,
|
||||
# "account_invalid":true,
|
||||
# "account_failed":false
|
||||
# }
|
||||
# },
|
||||
# "qdev": "/machine/unattached/device[23]"
|
||||
# },
|
||||
# {
|
||||
# "device":"ide1-cd0",
|
||||
@@ -959,7 +963,8 @@
|
||||
# "wr_merged":0,
|
||||
# "account_invalid":false,
|
||||
# "account_failed":false
|
||||
# }
|
||||
# },
|
||||
# "qdev": "/machine/unattached/device[24]"
|
||||
# },
|
||||
# {
|
||||
# "device":"floppy0",
|
||||
@@ -977,7 +982,8 @@
|
||||
# "wr_merged":0,
|
||||
# "account_invalid":false,
|
||||
# "account_failed":false
|
||||
# }
|
||||
# },
|
||||
# "qdev": "/machine/unattached/device[16]"
|
||||
# },
|
||||
# {
|
||||
# "device":"sd0",
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ STEXI
|
||||
ETEXI
|
||||
|
||||
DEF("convert", img_convert,
|
||||
"convert [--object objectdef] [--image-opts] [--target-image-opts] [-U] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-B backing_file] [-o options] [-l snapshot_param] [-S sparse_size] [-m num_coroutines] [-W] filename [filename2 [...]] output_filename")
|
||||
"convert [--object objectdef] [--image-opts] [--target-image-opts] [-U] [-C] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-B backing_file] [-o options] [-l snapshot_param] [-S sparse_size] [-m num_coroutines] [-W] filename [filename2 [...]] output_filename")
|
||||
STEXI
|
||||
@item convert [--object @var{objectdef}] [--image-opts] [--target-image-opts] [-U] [-c] [-p] [-q] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-l @var{snapshot_param}] [-S @var{sparse_size}] [-m @var{num_coroutines}] [-W] @var{filename} [@var{filename2} [...]] @var{output_filename}
|
||||
ETEXI
|
||||
|
||||
+17
-4
@@ -2024,11 +2024,12 @@ static int img_convert(int argc, char **argv)
|
||||
skip_create = false, progress = false, tgt_image_opts = false;
|
||||
int64_t ret = -EINVAL;
|
||||
bool force_share = false;
|
||||
bool explict_min_sparse = false;
|
||||
|
||||
ImgConvertState s = (ImgConvertState) {
|
||||
/* Need at least 4k of zeros for sparse detection */
|
||||
.min_sparse = 8,
|
||||
.copy_range = true,
|
||||
.copy_range = false,
|
||||
.buf_sectors = IO_BUF_SIZE / BDRV_SECTOR_SIZE,
|
||||
.wr_in_order = true,
|
||||
.num_coroutines = 8,
|
||||
@@ -2043,7 +2044,7 @@ static int img_convert(int argc, char **argv)
|
||||
{"target-image-opts", no_argument, 0, OPTION_TARGET_IMAGE_OPTS},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
c = getopt_long(argc, argv, ":hf:O:B:co:l:S:pt:T:qnm:WU",
|
||||
c = getopt_long(argc, argv, ":hf:O:B:Cco:l:S:pt:T:qnm:WU",
|
||||
long_options, NULL);
|
||||
if (c == -1) {
|
||||
break;
|
||||
@@ -2067,9 +2068,11 @@ static int img_convert(int argc, char **argv)
|
||||
case 'B':
|
||||
out_baseimg = optarg;
|
||||
break;
|
||||
case 'C':
|
||||
s.copy_range = true;
|
||||
break;
|
||||
case 'c':
|
||||
s.compressed = true;
|
||||
s.copy_range = false;
|
||||
break;
|
||||
case 'o':
|
||||
if (!is_valid_option_list(optarg)) {
|
||||
@@ -2112,7 +2115,7 @@ static int img_convert(int argc, char **argv)
|
||||
}
|
||||
|
||||
s.min_sparse = sval / BDRV_SECTOR_SIZE;
|
||||
s.copy_range = false;
|
||||
explict_min_sparse = true;
|
||||
break;
|
||||
}
|
||||
case 'p':
|
||||
@@ -2172,6 +2175,16 @@ static int img_convert(int argc, char **argv)
|
||||
goto fail_getopt;
|
||||
}
|
||||
|
||||
if (s.compressed && s.copy_range) {
|
||||
error_report("Cannot enable copy offloading when -c is used");
|
||||
goto fail_getopt;
|
||||
}
|
||||
|
||||
if (explict_min_sparse && s.copy_range) {
|
||||
error_report("Cannot enable copy offloading when -S is used");
|
||||
goto fail_getopt;
|
||||
}
|
||||
|
||||
if (tgt_image_opts && !skip_create) {
|
||||
error_report("--target-image-opts requires use of -n flag");
|
||||
goto fail_getopt;
|
||||
|
||||
+9
-5
@@ -96,8 +96,7 @@ will enumerate information about backing files in a disk image chain. Refer
|
||||
below for further description.
|
||||
|
||||
@item -c
|
||||
indicates that target image must be compressed (qcow format only). If this
|
||||
option is used, copy offloading will not be attempted.
|
||||
indicates that target image must be compressed (qcow format only)
|
||||
|
||||
@item -h
|
||||
with or without a command shows help and lists the supported formats
|
||||
@@ -116,8 +115,7 @@ in case both @var{-q} and @var{-p} options are used.
|
||||
indicates the consecutive number of bytes that must contain only zeros
|
||||
for qemu-img to create a sparse image during conversion. This value is rounded
|
||||
down to the nearest 512 bytes. You may use the common size suffixes like
|
||||
@code{k} for kilobytes. If this option is used, copy offloading will not be
|
||||
attempted.
|
||||
@code{k} for kilobytes.
|
||||
|
||||
@item -t @var{cache}
|
||||
specifies the cache mode that should be used with the (destination) file. See
|
||||
@@ -171,6 +169,12 @@ Number of parallel coroutines for the convert process
|
||||
Allow out-of-order writes to the destination. This option improves performance,
|
||||
but is only recommended for preallocated devices like host devices or other
|
||||
raw block devices.
|
||||
@item -C
|
||||
Try to use copy offloading to move data from source image to target. This may
|
||||
improve performance if the data is remote, such as with NFS or iSCSI backends,
|
||||
but will not automatically sparsify zero sectors, and may result in a fully
|
||||
allocated target image depending on the host support for getting allocation
|
||||
information.
|
||||
@end table
|
||||
|
||||
Parameters to dd subcommand:
|
||||
@@ -321,7 +325,7 @@ Error on reading data
|
||||
|
||||
@end table
|
||||
|
||||
@item convert [--object @var{objectdef}] [--image-opts] [--target-image-opts] [-U] [-c] [-p] [-q] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-l @var{snapshot_param}] [-S @var{sparse_size}] [-m @var{num_coroutines}] [-W] @var{filename} [@var{filename2} [...]] @var{output_filename}
|
||||
@item convert [--object @var{objectdef}] [--image-opts] [--target-image-opts] [-U] [-C] [-c] [-p] [-q] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-l @var{snapshot_param}] [-S @var{sparse_size}] [-m @var{num_coroutines}] [-W] @var{filename} [@var{filename2} [...]] @var{output_filename}
|
||||
|
||||
Convert the disk image @var{filename} or a snapshot @var{snapshot_param}
|
||||
to disk image @var{output_filename} using format @var{output_fmt}. It can be optionally compressed (@code{-c}
|
||||
|
||||
+8
-4
@@ -37,21 +37,23 @@ size_t qstring_get_length(const QString *qstring)
|
||||
*
|
||||
* Return string reference
|
||||
*/
|
||||
QString *qstring_from_substr(const char *str, int start, int end)
|
||||
QString *qstring_from_substr(const char *str, size_t start, size_t end)
|
||||
{
|
||||
QString *qstring;
|
||||
|
||||
assert(start <= end);
|
||||
|
||||
qstring = g_malloc(sizeof(*qstring));
|
||||
qobject_init(QOBJECT(qstring), QTYPE_QSTRING);
|
||||
|
||||
qstring->length = end - start + 1;
|
||||
qstring->length = end - start;
|
||||
qstring->capacity = qstring->length;
|
||||
|
||||
assert(qstring->capacity < SIZE_MAX);
|
||||
qstring->string = g_malloc(qstring->capacity + 1);
|
||||
memcpy(qstring->string, str + start, qstring->length);
|
||||
qstring->string[qstring->length] = 0;
|
||||
|
||||
|
||||
return qstring;
|
||||
}
|
||||
|
||||
@@ -62,13 +64,15 @@ QString *qstring_from_substr(const char *str, int start, int end)
|
||||
*/
|
||||
QString *qstring_from_str(const char *str)
|
||||
{
|
||||
return qstring_from_substr(str, 0, strlen(str) - 1);
|
||||
return qstring_from_substr(str, 0, strlen(str));
|
||||
}
|
||||
|
||||
static void capacity_increase(QString *qstring, size_t len)
|
||||
{
|
||||
if (qstring->capacity < (qstring->length + len)) {
|
||||
assert(len <= SIZE_MAX - qstring->capacity);
|
||||
qstring->capacity += len;
|
||||
assert(qstring->capacity <= SIZE_MAX / 2);
|
||||
qstring->capacity *= 2; /* use exponential growth */
|
||||
|
||||
qstring->string = g_realloc(qstring->string, qstring->capacity + 1);
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ m_inc(struct mbuf *m, int size)
|
||||
int datasize;
|
||||
|
||||
/* some compilers throw up on gotos. This one we can fake. */
|
||||
if (m->m_size > size) {
|
||||
if (M_ROOM(m) > size) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -5591,12 +5591,6 @@ void arm_cpu_list(FILE *f, fprintf_function cpu_fprintf)
|
||||
(*cpu_fprintf)(f, "Available CPUs:\n");
|
||||
g_slist_foreach(list, arm_cpu_list_entry, &s);
|
||||
g_slist_free(list);
|
||||
#ifdef CONFIG_KVM
|
||||
/* The 'host' CPU type is dynamically registered only if KVM is
|
||||
* enabled, so we have to special-case it here:
|
||||
*/
|
||||
(*cpu_fprintf)(f, " host (only available in KVM mode)\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void arm_cpu_add_definition(gpointer data, gpointer user_data)
|
||||
|
||||
@@ -184,6 +184,7 @@ static const VMStateDescription vmstate_m_faultmask_primask = {
|
||||
.name = "cpu/m/faultmask-primask",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = m_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT32(env.v7m.faultmask[M_REG_NS], ARMCPU),
|
||||
VMSTATE_UINT32(env.v7m.primask[M_REG_NS], ARMCPU),
|
||||
@@ -230,6 +231,7 @@ static const VMStateDescription vmstate_m_scr = {
|
||||
.name = "cpu/m/scr",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = m_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT32(env.v7m.scr[M_REG_NS], ARMCPU),
|
||||
VMSTATE_END_OF_LIST()
|
||||
@@ -240,6 +242,7 @@ static const VMStateDescription vmstate_m_other_sp = {
|
||||
.name = "cpu/m/other-sp",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = m_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT32(env.v7m.other_sp, ARMCPU),
|
||||
VMSTATE_END_OF_LIST()
|
||||
|
||||
@@ -5435,6 +5435,8 @@ static Property x86_cpu_properties[] = {
|
||||
false),
|
||||
DEFINE_PROP_BOOL("vmware-cpuid-freq", X86CPU, vmware_cpuid_freq, true),
|
||||
DEFINE_PROP_BOOL("tcg-cpuid", X86CPU, expose_tcg, true),
|
||||
DEFINE_PROP_BOOL("x-migrate-smi-count", X86CPU, migrate_smi_count,
|
||||
true),
|
||||
/*
|
||||
* lecacy_cache defaults to true unless the CPU model provides its
|
||||
* own cache information (see x86_cpu_load_def()).
|
||||
|
||||
@@ -1379,6 +1379,7 @@ struct X86CPU {
|
||||
bool expose_kvm;
|
||||
bool expose_tcg;
|
||||
bool migratable;
|
||||
bool migrate_smi_count;
|
||||
bool max_features; /* Enable all supported features automatically */
|
||||
uint32_t apic_id;
|
||||
|
||||
|
||||
@@ -400,7 +400,7 @@ static bool msr_smi_count_needed(void *opaque)
|
||||
X86CPU *cpu = opaque;
|
||||
CPUX86State *env = &cpu->env;
|
||||
|
||||
return env->msr_smi_count != 0;
|
||||
return cpu->migrate_smi_count && env->msr_smi_count != 0;
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_msr_smi_count = {
|
||||
|
||||
@@ -447,6 +447,9 @@ void helper_rdmsr(CPUX86State *env)
|
||||
val = env->tsc_aux;
|
||||
break;
|
||||
#endif
|
||||
case MSR_SMI_COUNT:
|
||||
val = env->msr_smi_count;
|
||||
break;
|
||||
case MSR_MTRRphysBase(0):
|
||||
case MSR_MTRRphysBase(1):
|
||||
case MSR_MTRRphysBase(2):
|
||||
|
||||
@@ -54,6 +54,7 @@ void do_smm_enter(X86CPU *cpu)
|
||||
qemu_log_mask(CPU_LOG_INT, "SMM: enter\n");
|
||||
log_cpu_state_mask(CPU_LOG_INT, CPU(cpu), CPU_DUMP_CCOP);
|
||||
|
||||
env->msr_smi_count++;
|
||||
env->hflags |= HF_SMM_MASK;
|
||||
if (env->hflags2 & HF2_NMI_MASK) {
|
||||
env->hflags2 |= HF2_SMM_INSIDE_NMI_MASK;
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ static void xtensa_cpu_initfn(Object *obj)
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
env->address_space_er = g_malloc(sizeof(*env->address_space_er));
|
||||
env->system_er = g_malloc(sizeof(*env->system_er));
|
||||
memory_region_init_io(env->system_er, NULL, NULL, env, "er",
|
||||
memory_region_init_io(env->system_er, obj, NULL, env, "er",
|
||||
UINT64_C(0x100000000));
|
||||
address_space_init(env->address_space_er, env->system_er, "ER");
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -1094,9 +1094,9 @@ void tcg_optimize(TCGContext *s)
|
||||
tmp = arg_info(op->args[1])->val;
|
||||
tmp = dup_const(TCGOP_VECE(op), tmp);
|
||||
tcg_opt_gen_movi(s, op, op->args[0], tmp);
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
goto do_default;
|
||||
|
||||
CASE_OP_32_64(not):
|
||||
CASE_OP_32_64(neg):
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -154,7 +154,7 @@ static void qobject_is_equal_string_test(void)
|
||||
str_case = qstring_from_str("Foo");
|
||||
|
||||
/* Should yield "foo" */
|
||||
str_built = qstring_from_substr("form", 0, 1);
|
||||
str_built = qstring_from_substr("form", 0, 2);
|
||||
qstring_append_chr(str_built, 'o');
|
||||
|
||||
check_unequal(str_base, str_whitespace_0, str_whitespace_1,
|
||||
|
||||
@@ -66,7 +66,7 @@ static void qstring_from_substr_test(void)
|
||||
{
|
||||
QString *qs;
|
||||
|
||||
qs = qstring_from_substr("virtualization", 3, 9);
|
||||
qs = qstring_from_substr("virtualization", 3, 10);
|
||||
g_assert(qs != NULL);
|
||||
g_assert(strcmp(qstring_get_str(qs), "tualiza") == 0);
|
||||
|
||||
|
||||
@@ -157,6 +157,14 @@ run_qemu_img convert -o help
|
||||
# Try help option for a format that does not support creation
|
||||
run_qemu_img convert -O bochs -o help
|
||||
|
||||
echo
|
||||
echo === convert: -C and other options ===
|
||||
|
||||
# Adding the help option to a command without other -o options
|
||||
run_qemu_img convert -C -S 4k -O $IMGFMT "$TEST_IMG" "$TEST_IMG".target
|
||||
run_qemu_img convert -C -S 8k -O $IMGFMT "$TEST_IMG" "$TEST_IMG".target
|
||||
run_qemu_img convert -C -c -O $IMGFMT "$TEST_IMG" "$TEST_IMG".target
|
||||
|
||||
echo
|
||||
echo === amend: Options specified more than once ===
|
||||
|
||||
|
||||
@@ -508,6 +508,17 @@ size Virtual disk size
|
||||
Testing: convert -O bochs -o help
|
||||
qemu-img: Format driver 'bochs' does not support image creation
|
||||
|
||||
=== convert: -C and other options ===
|
||||
|
||||
Testing: convert -C -S 4k -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.target
|
||||
qemu-img: Cannot enable copy offloading when -S is used
|
||||
|
||||
Testing: convert -C -S 8k -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.target
|
||||
qemu-img: Cannot enable copy offloading when -S is used
|
||||
|
||||
Testing: convert -C -c -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.target
|
||||
qemu-img: Cannot enable copy offloading when -c is used
|
||||
|
||||
=== amend: Options specified more than once ===
|
||||
|
||||
Testing: amend -f foo -f qcow2 -o lazy_refcounts=on TEST_DIR/t.qcow2
|
||||
|
||||
@@ -5,10 +5,10 @@ wrote 65536/65536 bytes at offset 0
|
||||
|
||||
=== Testing invalid option combinations ===
|
||||
|
||||
can't open device TEST_DIR/t.IMGFMT: cache-size, l2-cache-size and refcount-cache-size may not be set the same time
|
||||
can't open device TEST_DIR/t.IMGFMT: cache-size, l2-cache-size and refcount-cache-size may not be set at the same time
|
||||
can't open device TEST_DIR/t.IMGFMT: l2-cache-size may not exceed cache-size
|
||||
can't open device TEST_DIR/t.IMGFMT: refcount-cache-size may not exceed cache-size
|
||||
can't open device TEST_DIR/t.IMGFMT: cache-size, l2-cache-size and refcount-cache-size may not be set the same time
|
||||
can't open device TEST_DIR/t.IMGFMT: cache-size, l2-cache-size and refcount-cache-size may not be set at the same time
|
||||
can't open device TEST_DIR/t.IMGFMT: L2 cache entry size must be a power of two between 512 and the cluster size (65536)
|
||||
can't open device TEST_DIR/t.IMGFMT: L2 cache entry size must be a power of two between 512 and the cluster size (65536)
|
||||
can't open device TEST_DIR/t.IMGFMT: L2 cache entry size must be a power of two between 512 and the cluster size (65536)
|
||||
|
||||
@@ -16,7 +16,7 @@ read 33554432/33554432 bytes at offset 0
|
||||
=== Try setting some invalid values ===
|
||||
|
||||
Parameter 'lazy-refcounts' expects 'on' or 'off'
|
||||
cache-size, l2-cache-size and refcount-cache-size may not be set the same time
|
||||
cache-size, l2-cache-size and refcount-cache-size may not be set at the same time
|
||||
l2-cache-size may not exceed cache-size
|
||||
refcount-cache-size may not exceed cache-size
|
||||
L2 cache size too big
|
||||
|
||||
@@ -56,10 +56,10 @@ for PROTO in "file" "host_device" "host_cdrom"; do
|
||||
echo
|
||||
echo "== Testing RO =="
|
||||
$QEMU_IO -c "open -r -o driver=$PROTO,filename=$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
|
||||
$QEMU_IO -c "open -r -o driver=$PROTO,filename=/dev/null" 2>&1 | _filter_imgfmt
|
||||
$QEMU_IO -c "open -r -o driver=$PROTO,filename=/dev/null,locking=off" 2>&1 | _filter_imgfmt
|
||||
echo "== Testing RW =="
|
||||
$QEMU_IO -c "open -o driver=$PROTO,filename=$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
|
||||
$QEMU_IO -c "open -o driver=$PROTO,filename=/dev/null" 2>&1 | _filter_imgfmt
|
||||
$QEMU_IO -c "open -o driver=$PROTO,filename=/dev/null,locking=off" 2>&1 | _filter_imgfmt
|
||||
done
|
||||
|
||||
# success, all done
|
||||
|
||||
Executable
+101
@@ -0,0 +1,101 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Test query-blockstats with different ways to create a BB
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# creator
|
||||
owner=kwolf@redhat.com
|
||||
|
||||
seq=$(basename $0)
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=$PWD
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
_cleanup_test_img
|
||||
}
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common.rc
|
||||
. ./common.filter
|
||||
|
||||
_supported_fmt generic
|
||||
_supported_proto file
|
||||
_supported_os Linux
|
||||
|
||||
function do_run_qemu()
|
||||
{
|
||||
echo Testing: "$@"
|
||||
$QEMU -nographic -qmp-pretty stdio -serial none "$@"
|
||||
echo
|
||||
}
|
||||
|
||||
function run_qemu()
|
||||
{
|
||||
do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp \
|
||||
| _filter_qemu | _filter_imgfmt \
|
||||
| _filter_generated_node_ids
|
||||
}
|
||||
|
||||
echo
|
||||
echo '=== blockstats with -drive if=virtio ==='
|
||||
echo
|
||||
|
||||
run_qemu -drive driver=null-co,if=virtio <<EOF
|
||||
{ "execute": "qmp_capabilities" }
|
||||
{ "execute": "query-blockstats"}
|
||||
{ "execute": "quit" }
|
||||
EOF
|
||||
|
||||
echo
|
||||
echo '=== blockstats with -drive if=none ==='
|
||||
echo
|
||||
|
||||
run_qemu -drive driver=null-co,if=none <<EOF
|
||||
{ "execute": "qmp_capabilities" }
|
||||
{ "execute": "query-blockstats"}
|
||||
{ "execute": "quit" }
|
||||
EOF
|
||||
|
||||
echo
|
||||
echo '=== blockstats with -blockdev ==='
|
||||
echo
|
||||
|
||||
run_qemu -blockdev driver=null-co,node-name=null <<EOF
|
||||
{ "execute": "qmp_capabilities" }
|
||||
{ "execute": "query-blockstats"}
|
||||
{ "execute": "quit" }
|
||||
EOF
|
||||
|
||||
echo
|
||||
echo '=== blockstats with -blockdev and -device ==='
|
||||
echo
|
||||
|
||||
run_qemu -blockdev driver=null-co,node-name=null -device virtio-blk,drive=null,id=virtio0 <<EOF
|
||||
{ "execute": "qmp_capabilities" }
|
||||
{ "execute": "query-blockstats"}
|
||||
{ "execute": "quit" }
|
||||
EOF
|
||||
|
||||
# success, all done
|
||||
echo "*** done"
|
||||
rm -f $seq.full
|
||||
status=0
|
||||
@@ -0,0 +1,205 @@
|
||||
QA output created by 227
|
||||
|
||||
=== blockstats with -drive if=virtio ===
|
||||
|
||||
Testing: -drive driver=null-co,if=virtio
|
||||
{
|
||||
QMP_VERSION
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"device": "virtio0",
|
||||
"stats": {
|
||||
"flush_total_time_ns": 0,
|
||||
"wr_highest_offset": 0,
|
||||
"wr_total_time_ns": 0,
|
||||
"failed_wr_operations": 0,
|
||||
"failed_rd_operations": 0,
|
||||
"wr_merged": 0,
|
||||
"wr_bytes": 0,
|
||||
"timed_stats": [
|
||||
],
|
||||
"failed_flush_operations": 0,
|
||||
"account_invalid": true,
|
||||
"rd_total_time_ns": 0,
|
||||
"flush_operations": 0,
|
||||
"wr_operations": 0,
|
||||
"rd_merged": 0,
|
||||
"rd_bytes": 0,
|
||||
"invalid_flush_operations": 0,
|
||||
"account_failed": true,
|
||||
"rd_operations": 0,
|
||||
"invalid_wr_operations": 0,
|
||||
"invalid_rd_operations": 0
|
||||
},
|
||||
"node-name": "NODE_NAME",
|
||||
"qdev": "/machine/peripheral-anon/device[0]/virtio-backend"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"timestamp": {
|
||||
"seconds": TIMESTAMP,
|
||||
"microseconds": TIMESTAMP
|
||||
},
|
||||
"event": "SHUTDOWN",
|
||||
"data": {
|
||||
"guest": false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=== blockstats with -drive if=none ===
|
||||
|
||||
Testing: -drive driver=null-co,if=none
|
||||
{
|
||||
QMP_VERSION
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"device": "none0",
|
||||
"stats": {
|
||||
"flush_total_time_ns": 0,
|
||||
"wr_highest_offset": 0,
|
||||
"wr_total_time_ns": 0,
|
||||
"failed_wr_operations": 0,
|
||||
"failed_rd_operations": 0,
|
||||
"wr_merged": 0,
|
||||
"wr_bytes": 0,
|
||||
"timed_stats": [
|
||||
],
|
||||
"failed_flush_operations": 0,
|
||||
"account_invalid": true,
|
||||
"rd_total_time_ns": 0,
|
||||
"flush_operations": 0,
|
||||
"wr_operations": 0,
|
||||
"rd_merged": 0,
|
||||
"rd_bytes": 0,
|
||||
"invalid_flush_operations": 0,
|
||||
"account_failed": true,
|
||||
"rd_operations": 0,
|
||||
"invalid_wr_operations": 0,
|
||||
"invalid_rd_operations": 0
|
||||
},
|
||||
"node-name": "NODE_NAME"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"timestamp": {
|
||||
"seconds": TIMESTAMP,
|
||||
"microseconds": TIMESTAMP
|
||||
},
|
||||
"event": "SHUTDOWN",
|
||||
"data": {
|
||||
"guest": false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=== blockstats with -blockdev ===
|
||||
|
||||
Testing: -blockdev driver=null-co,node-name=null
|
||||
{
|
||||
QMP_VERSION
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"return": [
|
||||
]
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"timestamp": {
|
||||
"seconds": TIMESTAMP,
|
||||
"microseconds": TIMESTAMP
|
||||
},
|
||||
"event": "SHUTDOWN",
|
||||
"data": {
|
||||
"guest": false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=== blockstats with -blockdev and -device ===
|
||||
|
||||
Testing: -blockdev driver=null-co,node-name=null -device virtio-blk,drive=null,id=virtio0
|
||||
{
|
||||
QMP_VERSION
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"device": "",
|
||||
"stats": {
|
||||
"flush_total_time_ns": 0,
|
||||
"wr_highest_offset": 0,
|
||||
"wr_total_time_ns": 0,
|
||||
"failed_wr_operations": 0,
|
||||
"failed_rd_operations": 0,
|
||||
"wr_merged": 0,
|
||||
"wr_bytes": 0,
|
||||
"timed_stats": [
|
||||
],
|
||||
"failed_flush_operations": 0,
|
||||
"account_invalid": false,
|
||||
"rd_total_time_ns": 0,
|
||||
"flush_operations": 0,
|
||||
"wr_operations": 0,
|
||||
"rd_merged": 0,
|
||||
"rd_bytes": 0,
|
||||
"invalid_flush_operations": 0,
|
||||
"account_failed": false,
|
||||
"rd_operations": 0,
|
||||
"invalid_wr_operations": 0,
|
||||
"invalid_rd_operations": 0
|
||||
},
|
||||
"node-name": "null",
|
||||
"qdev": "/machine/peripheral/virtio0/virtio-backend"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"timestamp": {
|
||||
"seconds": TIMESTAMP,
|
||||
"microseconds": TIMESTAMP
|
||||
},
|
||||
"event": "SHUTDOWN",
|
||||
"data": {
|
||||
"guest": false
|
||||
}
|
||||
}
|
||||
|
||||
*** done
|
||||
@@ -224,3 +224,4 @@
|
||||
223 rw auto quick
|
||||
225 rw auto quick
|
||||
226 auto quick
|
||||
227 auto quick
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#define D(x)
|
||||
@@ -435,6 +435,25 @@ void checked_write(int fd, const void *buf, size_t count)
|
||||
fail_unless(rc == count);
|
||||
}
|
||||
|
||||
void check_invalid_mmaps(void)
|
||||
{
|
||||
unsigned char *addr;
|
||||
|
||||
/* Attempt to map a zero length page. */
|
||||
addr = mmap(NULL, 0, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
fprintf(stdout, "%s addr=%p", __func__, (void *)addr);
|
||||
fail_unless(addr == MAP_FAILED);
|
||||
fail_unless(errno == EINVAL);
|
||||
|
||||
/* Attempt to map a over length page. */
|
||||
addr = mmap(NULL, -4, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
fprintf(stdout, "%s addr=%p", __func__, (void *)addr);
|
||||
fail_unless(addr == MAP_FAILED);
|
||||
fail_unless(errno == ENOMEM);
|
||||
|
||||
fprintf(stdout, " passed\n");
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char tempname[] = "/tmp/.cmmapXXXXXX";
|
||||
@@ -476,6 +495,7 @@ int main(int argc, char **argv)
|
||||
check_file_fixed_mmaps();
|
||||
check_file_fixed_eof_mmaps();
|
||||
check_file_unfixed_eof_mmaps();
|
||||
check_invalid_mmaps();
|
||||
|
||||
/* Fails at the moment. */
|
||||
/* check_aligned_anonymous_fixed_mmaps_collide_with_host(); */
|
||||
|
||||
+2
-9
@@ -578,17 +578,10 @@ int64_t timerlistgroup_deadline_ns(QEMUTimerListGroup *tlg)
|
||||
{
|
||||
int64_t deadline = -1;
|
||||
QEMUClockType type;
|
||||
bool play = replay_mode == REPLAY_MODE_PLAY;
|
||||
for (type = 0; type < QEMU_CLOCK_MAX; type++) {
|
||||
if (qemu_clock_use_for_deadline(type)) {
|
||||
if (!play || type == QEMU_CLOCK_REALTIME) {
|
||||
deadline = qemu_soonest_timeout(deadline,
|
||||
timerlist_deadline_ns(tlg->tl[type]));
|
||||
} else {
|
||||
/* Read clock from the replay file and
|
||||
do not calculate the deadline, based on virtual clock. */
|
||||
qemu_clock_get_ns(type);
|
||||
}
|
||||
deadline = qemu_soonest_timeout(deadline,
|
||||
timerlist_deadline_ns(tlg->tl[type]));
|
||||
}
|
||||
}
|
||||
return deadline;
|
||||
|
||||
Reference in new issue
Block a user