mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2016-06-07' into staging
trivial patches for 2016-06-07 # gpg: Signature made Tue 07 Jun 2016 16:20:52 BST # gpg: using RSA key 0xBEE59D74A4C3D7DB # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" * remotes/mjt/tags/pull-trivial-patches-2016-06-07: (51 commits) hbitmap: Use DIV_ROUND_UP qemu-timer: Use DIV_ROUND_UP linux-user: Use DIV_ROUND_UP slirp: Use DIV_ROUND_UP usb: Use DIV_ROUND_UP rocker: Use DIV_ROUND_UP SPICE: Use DIV_ROUND_UP audio: Use DIV_ROUND_UP xen: Use DIV_ROUND_UP crypto: Use DIV_ROUND_UP block: Use DIV_ROUND_UP qed: Use DIV_ROUND_UP qcow/qcow2: Use DIV_ROUND_UP parallels: Use DIV_ROUND_UP coccinelle: use macro DIV_ROUND_UP instead of (((n) + (d) - 1) /(d)) thunk: Rename args and fields in host-target bitmask conversion code thunk: Drop unused NO_THUNK_TYPE_SIZE guards qemu-common.h: Drop WORDS_ALIGNED define host-utils: Prefer 'false' for bool type docs/multi-thread-compression: Fix wrong command string ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
#ifdef CONFIG_BZIP2
|
||||
#include <bzlib.h>
|
||||
#endif
|
||||
#include <glib.h>
|
||||
|
||||
enum {
|
||||
/* Limit chunk sizes to prevent unreasonable amounts of memory being used
|
||||
|
||||
+1
-1
@@ -204,7 +204,7 @@ static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
to_allocate = (sector_num + *pnum + s->tracks - 1) / s->tracks - idx;
|
||||
to_allocate = DIV_ROUND_UP(sector_num + *pnum, s->tracks) - idx;
|
||||
space = to_allocate * s->tracks;
|
||||
if (s->data_end + space > bdrv_getlength(bs->file->bs) >> BDRV_SECTOR_BITS) {
|
||||
int ret;
|
||||
|
||||
+2
-2
@@ -868,8 +868,8 @@ static int qcow_create(const char *filename, QemuOpts *opts, Error **errp)
|
||||
}
|
||||
|
||||
tmp = g_malloc0(BDRV_SECTOR_SIZE);
|
||||
for (i = 0; i < ((sizeof(uint64_t)*l1_size + BDRV_SECTOR_SIZE - 1)/
|
||||
BDRV_SECTOR_SIZE); i++) {
|
||||
for (i = 0; i < DIV_ROUND_UP(sizeof(uint64_t) * l1_size, BDRV_SECTOR_SIZE);
|
||||
i++) {
|
||||
ret = blk_pwrite(qcow_blk, header_size + BDRV_SECTOR_SIZE * i,
|
||||
tmp, BDRV_SECTOR_SIZE, 0);
|
||||
if (ret != BDRV_SECTOR_SIZE) {
|
||||
|
||||
@@ -1868,8 +1868,8 @@ int qcow2_expand_zero_clusters(BlockDriverState *bs,
|
||||
}
|
||||
|
||||
for (i = 0; i < s->nb_snapshots; i++) {
|
||||
int l1_sectors = (s->snapshots[i].l1_size * sizeof(uint64_t) +
|
||||
BDRV_SECTOR_SIZE - 1) / BDRV_SECTOR_SIZE;
|
||||
int l1_sectors = DIV_ROUND_UP(s->snapshots[i].l1_size *
|
||||
sizeof(uint64_t), BDRV_SECTOR_SIZE);
|
||||
|
||||
l1_table = g_realloc(l1_table, l1_sectors * BDRV_SECTOR_SIZE);
|
||||
|
||||
|
||||
@@ -490,14 +490,12 @@ static int alloc_refcount_block(BlockDriverState *bs,
|
||||
uint64_t table_clusters =
|
||||
size_to_clusters(s, table_size * sizeof(uint64_t));
|
||||
blocks_clusters = 1 +
|
||||
((table_clusters + s->refcount_block_size - 1)
|
||||
/ s->refcount_block_size);
|
||||
DIV_ROUND_UP(table_clusters, s->refcount_block_size);
|
||||
uint64_t meta_clusters = table_clusters + blocks_clusters;
|
||||
|
||||
last_table_size = table_size;
|
||||
table_size = next_refcount_table_size(s, blocks_used +
|
||||
((meta_clusters + s->refcount_block_size - 1)
|
||||
/ s->refcount_block_size));
|
||||
DIV_ROUND_UP(meta_clusters, s->refcount_block_size));
|
||||
|
||||
} while (last_table_size != table_size);
|
||||
|
||||
|
||||
+1
-2
@@ -234,8 +234,7 @@ int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix)
|
||||
}
|
||||
|
||||
check.result->bfi.total_clusters =
|
||||
(s->header.image_size + s->header.cluster_size - 1) /
|
||||
s->header.cluster_size;
|
||||
DIV_ROUND_UP(s->header.image_size, s->header.cluster_size);
|
||||
ret = qed_check_l1_table(&check, s->l1_table);
|
||||
if (ret == 0) {
|
||||
/* Only check for leaks if entire image was scanned successfully */
|
||||
|
||||
+1
-2
@@ -143,8 +143,7 @@ static void qed_write_header(BDRVQEDState *s, BlockCompletionFunc cb,
|
||||
* them, and write back.
|
||||
*/
|
||||
|
||||
int nsectors = (sizeof(QEDHeader) + BDRV_SECTOR_SIZE - 1) /
|
||||
BDRV_SECTOR_SIZE;
|
||||
int nsectors = DIV_ROUND_UP(sizeof(QEDHeader), BDRV_SECTOR_SIZE);
|
||||
size_t len = nsectors * BDRV_SECTOR_SIZE;
|
||||
QEDWriteHeaderCB *write_header_cb = gencb_alloc(sizeof(*write_header_cb),
|
||||
cb, opaque);
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "migration/migration.h"
|
||||
|
||||
#include <uuid/uuid.h>
|
||||
#include <glib.h>
|
||||
|
||||
/* Options for VHDX creation */
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "migration/migration.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include <zlib.h>
|
||||
#include <glib.h>
|
||||
|
||||
#define VMDK3_MAGIC (('C' << 24) | ('O' << 16) | ('W' << 8) | 'D')
|
||||
#define VMDK4_MAGIC (('K' << 24) | ('D' << 16) | ('M' << 8) | 'V')
|
||||
|
||||
+1
-2
@@ -1960,8 +1960,7 @@ DLOG(fprintf(stderr, "check direntry %d:\n", i); print_direntry(direntries + i))
|
||||
/* check file size with FAT */
|
||||
cluster_count = get_cluster_count_for_direntry(s, direntries + i, path2);
|
||||
if (cluster_count !=
|
||||
(le32_to_cpu(direntries[i].size) + s->cluster_size
|
||||
- 1) / s->cluster_size) {
|
||||
DIV_ROUND_UP(le32_to_cpu(direntries[i].size), s->cluster_size)) {
|
||||
DLOG(fprintf(stderr, "Cluster count mismatch\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+2
-4
@@ -1081,8 +1081,7 @@ qcrypto_block_luks_create(QCryptoBlock *block,
|
||||
luks->header.key_slots[i].key_offset =
|
||||
(QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET /
|
||||
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE) +
|
||||
(ROUND_UP(((splitkeylen + (QCRYPTO_BLOCK_LUKS_SECTOR_SIZE - 1)) /
|
||||
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE),
|
||||
(ROUND_UP(DIV_ROUND_UP(splitkeylen, QCRYPTO_BLOCK_LUKS_SECTOR_SIZE),
|
||||
(QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET /
|
||||
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE)) * i);
|
||||
}
|
||||
@@ -1182,8 +1181,7 @@ qcrypto_block_luks_create(QCryptoBlock *block,
|
||||
luks->header.payload_offset =
|
||||
(QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET /
|
||||
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE) +
|
||||
(ROUND_UP(((splitkeylen + (QCRYPTO_BLOCK_LUKS_SECTOR_SIZE - 1)) /
|
||||
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE),
|
||||
(ROUND_UP(DIV_ROUND_UP(splitkeylen, QCRYPTO_BLOCK_LUKS_SECTOR_SIZE),
|
||||
(QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET /
|
||||
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE)) *
|
||||
QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
|
||||
|
||||
@@ -110,7 +110,7 @@ Usage
|
||||
=====
|
||||
1. Verify both the source and destination QEMU are able
|
||||
to support the multiple thread compression migration:
|
||||
{qemu} info_migrate_capabilities
|
||||
{qemu} info migrate_capabilities
|
||||
{qemu} ... compress: off ...
|
||||
|
||||
2. Activate compression on the source:
|
||||
|
||||
@@ -322,7 +322,7 @@ enum. The value for each branch can be of any type.
|
||||
|
||||
A flat union definition avoids nesting on the wire, and specifies a
|
||||
set of common members that occur in all variants of the union. The
|
||||
'base' key must specifiy either a type name (the type must be a
|
||||
'base' key must specify either a type name (the type must be a
|
||||
struct, not a union), or a dictionary representing an anonymous type.
|
||||
All branches of the union must be complex types, and the top-level
|
||||
members of the union dictionary on the wire will be combination of
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ the parameters for both cases:
|
||||
| throttling.bps-write | bps_wr |
|
||||
|-----------------------+-----------------------|
|
||||
|
||||
It is possible to set limits for both IOPS and bps and the same time,
|
||||
It is possible to set limits for both IOPS and bps at the same time,
|
||||
and for each case we can decide whether to have separate read and
|
||||
write limits or not, but note that if iops-total is set then neither
|
||||
iops-read nor iops-write can be set. The same applies to bps-total and
|
||||
@@ -235,7 +235,7 @@ consider the following values:
|
||||
- Water leaks from the bucket at a rate of 100 IOPS.
|
||||
- Water can be added to the bucket at a rate of 2000 IOPS.
|
||||
- The size of the bucket is 2000 x 60 = 120000
|
||||
- If 'iops-total-max-length' is unset then the bucket size is 100.
|
||||
- If 'iops-total-max' is unset then the bucket size is 100 x 60.
|
||||
|
||||
The bucket is initially empty, therefore water can be added until it's
|
||||
full at a rate of 2000 IOPS (the burst rate). Once the bucket is full
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
#include <utime.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
#include <dirent.h>
|
||||
#include <utime.h>
|
||||
|
||||
@@ -15,7 +15,7 @@ provide access to files beyond 9p export path.
|
||||
|
||||
2) Running QEMU with root privilege could be a security issue.
|
||||
|
||||
To overcome above issues, following approach is used: A new filesytem
|
||||
To overcome above issues, following approach is used: A new filesystem
|
||||
type 'proxy' is introduced. Proxy FS uses chroot + socket combination
|
||||
for securing the vulnerability known with following symbolic links.
|
||||
Intention of adding a new filesystem type is to allow qemu to run
|
||||
|
||||
@@ -1631,7 +1631,7 @@ static int gdbserver_open(int port)
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
ret = listen(fd, 0);
|
||||
ret = listen(fd, 1);
|
||||
if (ret < 0) {
|
||||
perror("listen");
|
||||
close(fd);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <dirent.h>
|
||||
#include <utime.h>
|
||||
#include <sys/resource.h>
|
||||
#include <glib.h>
|
||||
#include "fsdev/file-op-9p.h"
|
||||
#include "fsdev/9p-iov-marshal.h"
|
||||
#include "qemu/thread.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user