Compare commits
23 Commits
v0.14.0-rc
...
v0.14.0
Author | SHA1 | Date | |
---|---|---|---|
|
0850f81099 | ||
|
6a7999b222 | ||
|
e3c8fc83aa | ||
|
bd2483faf1 | ||
|
7083b66b45 | ||
|
9de12c453d | ||
|
c7e9df3bc6 | ||
|
038a866f81 | ||
|
64a216f58e | ||
|
12597b0608 | ||
|
e37dcdfb8d | ||
|
5c9596112c | ||
|
16e07bc282 | ||
|
607a375709 | ||
|
ac12a5af0b | ||
|
b03088c32f | ||
|
eee37d310c | ||
|
28637533d6 | ||
|
23e4cff984 | ||
|
0893194783 | ||
|
e5f1c19665 | ||
|
343c1de916 | ||
|
b75568889f |
@@ -515,13 +515,16 @@ static int get_cluster_table(BlockDriverState *bs, uint64_t offset,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* FIXME Order */
|
/* First allocate a new L2 table (and do COW if needed) */
|
||||||
if (l2_offset)
|
|
||||||
qcow2_free_clusters(bs, l2_offset, s->l2_size * sizeof(uint64_t));
|
|
||||||
ret = l2_allocate(bs, l1_index, &l2_table);
|
ret = l2_allocate(bs, l1_index, &l2_table);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Then decrease the refcount of the old table */
|
||||||
|
if (l2_offset) {
|
||||||
|
qcow2_free_clusters(bs, l2_offset, s->l2_size * sizeof(uint64_t));
|
||||||
|
}
|
||||||
l2_offset = s->l1_table[l1_index] & ~QCOW_OFLAG_COPIED;
|
l2_offset = s->l1_table[l1_index] & ~QCOW_OFLAG_COPIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -878,11 +881,11 @@ int qcow2_decompress_cluster(BlockDriverState *bs, uint64_t cluster_offset)
|
|||||||
BLKDBG_EVENT(bs->file, BLKDBG_READ_COMPRESSED);
|
BLKDBG_EVENT(bs->file, BLKDBG_READ_COMPRESSED);
|
||||||
ret = bdrv_read(bs->file, coffset >> 9, s->cluster_data, nb_csectors);
|
ret = bdrv_read(bs->file, coffset >> 9, s->cluster_data, nb_csectors);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return -1;
|
return ret;
|
||||||
}
|
}
|
||||||
if (decompress_buffer(s->cluster_cache, s->cluster_size,
|
if (decompress_buffer(s->cluster_cache, s->cluster_size,
|
||||||
s->cluster_data + sector_offset, csize) < 0) {
|
s->cluster_data + sector_offset, csize) < 0) {
|
||||||
return -1;
|
return -EIO;
|
||||||
}
|
}
|
||||||
s->cluster_cache_offset = coffset;
|
s->cluster_cache_offset = coffset;
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
#include "aes.h"
|
#include "aes.h"
|
||||||
#include "block/qcow2.h"
|
#include "block/qcow2.h"
|
||||||
#include "qemu-error.h"
|
#include "qemu-error.h"
|
||||||
|
#include "qerror.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Differences with QCOW:
|
Differences with QCOW:
|
||||||
@@ -59,7 +60,7 @@ static int qcow2_probe(const uint8_t *buf, int buf_size, const char *filename)
|
|||||||
|
|
||||||
if (buf_size >= sizeof(QCowHeader) &&
|
if (buf_size >= sizeof(QCowHeader) &&
|
||||||
be32_to_cpu(cow_header->magic) == QCOW_MAGIC &&
|
be32_to_cpu(cow_header->magic) == QCOW_MAGIC &&
|
||||||
be32_to_cpu(cow_header->version) == QCOW_VERSION)
|
be32_to_cpu(cow_header->version) >= QCOW_VERSION)
|
||||||
return 100;
|
return 100;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
@@ -163,10 +164,18 @@ static int qcow2_open(BlockDriverState *bs, int flags)
|
|||||||
be64_to_cpus(&header.snapshots_offset);
|
be64_to_cpus(&header.snapshots_offset);
|
||||||
be32_to_cpus(&header.nb_snapshots);
|
be32_to_cpus(&header.nb_snapshots);
|
||||||
|
|
||||||
if (header.magic != QCOW_MAGIC || header.version != QCOW_VERSION) {
|
if (header.magic != QCOW_MAGIC) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
if (header.version != QCOW_VERSION) {
|
||||||
|
char version[64];
|
||||||
|
snprintf(version, sizeof(version), "QCOW version %d", header.version);
|
||||||
|
qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
|
||||||
|
bs->device_name, "qcow2", version);
|
||||||
|
ret = -ENOTSUP;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
if (header.cluster_bits < MIN_CLUSTER_BITS ||
|
if (header.cluster_bits < MIN_CLUSTER_BITS ||
|
||||||
header.cluster_bits > MAX_CLUSTER_BITS) {
|
header.cluster_bits > MAX_CLUSTER_BITS) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
@@ -355,7 +364,7 @@ int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov,
|
|||||||
else
|
else
|
||||||
n1 = bs->total_sectors - sector_num;
|
n1 = bs->total_sectors - sector_num;
|
||||||
|
|
||||||
qemu_iovec_memset(qiov, 0, 512 * (nb_sectors - n1));
|
qemu_iovec_memset_skip(qiov, 0, 512 * (nb_sectors - n1), 512 * n1);
|
||||||
|
|
||||||
return n1;
|
return n1;
|
||||||
}
|
}
|
||||||
@@ -478,10 +487,11 @@ static void qcow2_aio_read_cb(void *opaque, int ret)
|
|||||||
if (n1 > 0) {
|
if (n1 > 0) {
|
||||||
BLKDBG_EVENT(bs->file, BLKDBG_READ_BACKING_AIO);
|
BLKDBG_EVENT(bs->file, BLKDBG_READ_BACKING_AIO);
|
||||||
acb->hd_aiocb = bdrv_aio_readv(bs->backing_hd, acb->sector_num,
|
acb->hd_aiocb = bdrv_aio_readv(bs->backing_hd, acb->sector_num,
|
||||||
&acb->hd_qiov, acb->cur_nr_sectors,
|
&acb->hd_qiov, n1, qcow2_aio_read_cb, acb);
|
||||||
qcow2_aio_read_cb, acb);
|
if (acb->hd_aiocb == NULL) {
|
||||||
if (acb->hd_aiocb == NULL)
|
ret = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ret = qcow2_schedule_bh(qcow2_aio_read_bh, acb);
|
ret = qcow2_schedule_bh(qcow2_aio_read_bh, acb);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -496,8 +506,10 @@ static void qcow2_aio_read_cb(void *opaque, int ret)
|
|||||||
}
|
}
|
||||||
} else if (acb->cluster_offset & QCOW_OFLAG_COMPRESSED) {
|
} else if (acb->cluster_offset & QCOW_OFLAG_COMPRESSED) {
|
||||||
/* add AIO support for compressed blocks ? */
|
/* add AIO support for compressed blocks ? */
|
||||||
if (qcow2_decompress_cluster(bs, acb->cluster_offset) < 0)
|
ret = qcow2_decompress_cluster(bs, acb->cluster_offset);
|
||||||
|
if (ret < 0) {
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
qemu_iovec_from_buffer(&acb->hd_qiov,
|
qemu_iovec_from_buffer(&acb->hd_qiov,
|
||||||
s->cluster_cache + index_in_cluster * 512,
|
s->cluster_cache + index_in_cluster * 512,
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
#include "qed.h"
|
#include "qed.h"
|
||||||
|
#include "qerror.h"
|
||||||
|
|
||||||
static void qed_aio_cancel(BlockDriverAIOCB *blockacb)
|
static void qed_aio_cancel(BlockDriverAIOCB *blockacb)
|
||||||
{
|
{
|
||||||
@@ -311,7 +312,13 @@ static int bdrv_qed_open(BlockDriverState *bs, int flags)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (s->header.features & ~QED_FEATURE_MASK) {
|
if (s->header.features & ~QED_FEATURE_MASK) {
|
||||||
return -ENOTSUP; /* image uses unsupported feature bits */
|
/* image uses unsupported feature bits */
|
||||||
|
char buf[64];
|
||||||
|
snprintf(buf, sizeof(buf), "%" PRIx64,
|
||||||
|
s->header.features & ~QED_FEATURE_MASK);
|
||||||
|
qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
|
||||||
|
bs->device_name, "QED", buf);
|
||||||
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
if (!qed_is_cluster_size_valid(s->header.cluster_size)) {
|
if (!qed_is_cluster_size_valid(s->header.cluster_size)) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
12
blockdev.c
12
blockdev.c
@@ -182,6 +182,7 @@ static void drive_uninit(DriveInfo *dinfo)
|
|||||||
{
|
{
|
||||||
qemu_opts_del(dinfo->opts);
|
qemu_opts_del(dinfo->opts);
|
||||||
bdrv_delete(dinfo->bdrv);
|
bdrv_delete(dinfo->bdrv);
|
||||||
|
qemu_free(dinfo->id);
|
||||||
QTAILQ_REMOVE(&drives, dinfo, next);
|
QTAILQ_REMOVE(&drives, dinfo, next);
|
||||||
qemu_free(dinfo);
|
qemu_free(dinfo);
|
||||||
}
|
}
|
||||||
@@ -525,7 +526,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
|
|||||||
} else if (ro == 1) {
|
} else if (ro == 1) {
|
||||||
if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY && type != IF_NONE) {
|
if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY && type != IF_NONE) {
|
||||||
error_report("readonly not supported by this bus type");
|
error_report("readonly not supported by this bus type");
|
||||||
return NULL;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -535,12 +536,19 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
|
|||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
error_report("could not open disk image %s: %s",
|
error_report("could not open disk image %s: %s",
|
||||||
file, strerror(-ret));
|
file, strerror(-ret));
|
||||||
return NULL;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bdrv_key_required(dinfo->bdrv))
|
if (bdrv_key_required(dinfo->bdrv))
|
||||||
autostart = 0;
|
autostart = 0;
|
||||||
return dinfo;
|
return dinfo;
|
||||||
|
|
||||||
|
err:
|
||||||
|
bdrv_delete(dinfo->bdrv);
|
||||||
|
qemu_free(dinfo->id);
|
||||||
|
QTAILQ_REMOVE(&drives, dinfo, next);
|
||||||
|
qemu_free(dinfo);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_commit(Monitor *mon, const QDict *qdict)
|
void do_commit(Monitor *mon, const QDict *qdict)
|
||||||
|
31
cutils.c
31
cutils.c
@@ -267,6 +267,37 @@ void qemu_iovec_memset(QEMUIOVector *qiov, int c, size_t count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qemu_iovec_memset_skip(QEMUIOVector *qiov, int c, size_t count,
|
||||||
|
size_t skip)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
size_t done;
|
||||||
|
void *iov_base;
|
||||||
|
uint64_t iov_len;
|
||||||
|
|
||||||
|
done = 0;
|
||||||
|
for (i = 0; (i < qiov->niov) && (done != count); i++) {
|
||||||
|
if (skip >= qiov->iov[i].iov_len) {
|
||||||
|
/* Skip the whole iov */
|
||||||
|
skip -= qiov->iov[i].iov_len;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
/* Skip only part (or nothing) of the iov */
|
||||||
|
iov_base = (uint8_t*) qiov->iov[i].iov_base + skip;
|
||||||
|
iov_len = qiov->iov[i].iov_len - skip;
|
||||||
|
skip = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (done + iov_len > count) {
|
||||||
|
memset(iov_base, c, count - done);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
memset(iov_base, c, iov_len);
|
||||||
|
}
|
||||||
|
done += iov_len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
/* Sets a specific flag */
|
/* Sets a specific flag */
|
||||||
int fcntl_setfl(int fd, int flag)
|
int fcntl_setfl(int fd, int flag)
|
||||||
|
@@ -822,7 +822,7 @@ ETEXI
|
|||||||
|
|
||||||
{
|
{
|
||||||
.name = "snapshot_blkdev",
|
.name = "snapshot_blkdev",
|
||||||
.args_type = "device:s,snapshot_file:s?,format:s?",
|
.args_type = "device:B,snapshot_file:s?,format:s?",
|
||||||
.params = "device [new-image-file] [format]",
|
.params = "device [new-image-file] [format]",
|
||||||
.help = "initiates a live snapshot\n\t\t\t"
|
.help = "initiates a live snapshot\n\t\t\t"
|
||||||
"of device. If a new image file is specified, the\n\t\t\t"
|
"of device. If a new image file is specified, the\n\t\t\t"
|
||||||
|
44
hw/apic.c
44
hw/apic.c
@@ -372,19 +372,36 @@ static int apic_get_arb_pri(APICState *s)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* <0 - low prio interrupt,
|
||||||
|
* 0 - no interrupt,
|
||||||
|
* >0 - interrupt number
|
||||||
|
*/
|
||||||
|
static int apic_irq_pending(APICState *s)
|
||||||
|
{
|
||||||
|
int irrv, ppr;
|
||||||
|
irrv = get_highest_priority_int(s->irr);
|
||||||
|
if (irrv < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ppr = apic_get_ppr(s);
|
||||||
|
if (ppr && (irrv & 0xf0) <= (ppr & 0xf0)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return irrv;
|
||||||
|
}
|
||||||
|
|
||||||
/* signal the CPU if an irq is pending */
|
/* signal the CPU if an irq is pending */
|
||||||
static void apic_update_irq(APICState *s)
|
static void apic_update_irq(APICState *s)
|
||||||
{
|
{
|
||||||
int irrv, ppr;
|
if (!(s->spurious_vec & APIC_SV_ENABLE)) {
|
||||||
if (!(s->spurious_vec & APIC_SV_ENABLE))
|
|
||||||
return;
|
return;
|
||||||
irrv = get_highest_priority_int(s->irr);
|
}
|
||||||
if (irrv < 0)
|
if (apic_irq_pending(s) > 0) {
|
||||||
return;
|
cpu_interrupt(s->cpu_env, CPU_INTERRUPT_HARD);
|
||||||
ppr = apic_get_ppr(s);
|
}
|
||||||
if (ppr && (irrv & 0xf0) <= (ppr & 0xf0))
|
|
||||||
return;
|
|
||||||
cpu_interrupt(s->cpu_env, CPU_INTERRUPT_HARD);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void apic_reset_irq_delivered(void)
|
void apic_reset_irq_delivered(void)
|
||||||
@@ -590,12 +607,13 @@ int apic_get_interrupt(DeviceState *d)
|
|||||||
if (!(s->spurious_vec & APIC_SV_ENABLE))
|
if (!(s->spurious_vec & APIC_SV_ENABLE))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* XXX: spurious IRQ handling */
|
intno = apic_irq_pending(s);
|
||||||
intno = get_highest_priority_int(s->irr);
|
|
||||||
if (intno < 0)
|
if (intno == 0) {
|
||||||
return -1;
|
return -1;
|
||||||
if (s->tpr && intno <= s->tpr)
|
} else if (intno < 0) {
|
||||||
return s->spurious_vec & 0xff;
|
return s->spurious_vec & 0xff;
|
||||||
|
}
|
||||||
reset_bit(s->irr, intno);
|
reset_bit(s->irr, intno);
|
||||||
set_bit(s->isr, intno);
|
set_bit(s->isr, intno);
|
||||||
apic_update_irq(s);
|
apic_update_irq(s);
|
||||||
|
@@ -1481,7 +1481,7 @@ static void load_symbols(struct elfhdr *hdr, int fd, abi_ulong load_bias)
|
|||||||
struct elf_shdr *shdr;
|
struct elf_shdr *shdr;
|
||||||
char *strings;
|
char *strings;
|
||||||
struct syminfo *s;
|
struct syminfo *s;
|
||||||
struct elf_sym *syms;
|
struct elf_sym *syms, *new_syms;
|
||||||
|
|
||||||
shnum = hdr->e_shnum;
|
shnum = hdr->e_shnum;
|
||||||
i = shnum * sizeof(struct elf_shdr);
|
i = shnum * sizeof(struct elf_shdr);
|
||||||
@@ -1550,12 +1550,14 @@ static void load_symbols(struct elfhdr *hdr, int fd, abi_ulong load_bias)
|
|||||||
that we threw away. Whether or not this has any effect on the
|
that we threw away. Whether or not this has any effect on the
|
||||||
memory allocation depends on the malloc implementation and how
|
memory allocation depends on the malloc implementation and how
|
||||||
many symbols we managed to discard. */
|
many symbols we managed to discard. */
|
||||||
syms = realloc(syms, nsyms * sizeof(*syms));
|
new_syms = realloc(syms, nsyms * sizeof(*syms));
|
||||||
if (syms == NULL) {
|
if (new_syms == NULL) {
|
||||||
free(s);
|
free(s);
|
||||||
|
free(syms);
|
||||||
free(strings);
|
free(strings);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
syms = new_syms;
|
||||||
|
|
||||||
qsort(syms, nsyms, sizeof(*syms), symcmp);
|
qsort(syms, nsyms, sizeof(*syms), symcmp);
|
||||||
|
|
||||||
|
@@ -312,10 +312,8 @@
|
|||||||
IOCTL(LOOP_CLR_FD, 0, TYPE_INT)
|
IOCTL(LOOP_CLR_FD, 0, TYPE_INT)
|
||||||
IOCTL(LOOP_SET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
|
IOCTL(LOOP_SET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
|
||||||
IOCTL(LOOP_GET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
|
IOCTL(LOOP_GET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
|
||||||
#if 0 /* These have some problems - not fully tested */
|
|
||||||
IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
|
IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
|
||||||
IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
|
IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
|
||||||
#endif
|
|
||||||
IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)
|
IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)
|
||||||
|
|
||||||
IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop)))
|
IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop)))
|
||||||
|
@@ -322,6 +322,8 @@ void qemu_iovec_reset(QEMUIOVector *qiov);
|
|||||||
void qemu_iovec_to_buffer(QEMUIOVector *qiov, void *buf);
|
void qemu_iovec_to_buffer(QEMUIOVector *qiov, void *buf);
|
||||||
void qemu_iovec_from_buffer(QEMUIOVector *qiov, const void *buf, size_t count);
|
void qemu_iovec_from_buffer(QEMUIOVector *qiov, const void *buf, size_t count);
|
||||||
void qemu_iovec_memset(QEMUIOVector *qiov, int c, size_t count);
|
void qemu_iovec_memset(QEMUIOVector *qiov, int c, size_t count);
|
||||||
|
void qemu_iovec_memset_skip(QEMUIOVector *qiov, int c, size_t count,
|
||||||
|
size_t skip);
|
||||||
|
|
||||||
struct Monitor;
|
struct Monitor;
|
||||||
typedef struct Monitor Monitor;
|
typedef struct Monitor Monitor;
|
||||||
|
10
qemu-img.c
10
qemu-img.c
@@ -213,8 +213,9 @@ static BlockDriverState *bdrv_new_open(const char *filename,
|
|||||||
BlockDriverState *bs;
|
BlockDriverState *bs;
|
||||||
BlockDriver *drv;
|
BlockDriver *drv;
|
||||||
char password[256];
|
char password[256];
|
||||||
|
int ret;
|
||||||
|
|
||||||
bs = bdrv_new("");
|
bs = bdrv_new("image");
|
||||||
|
|
||||||
if (fmt) {
|
if (fmt) {
|
||||||
drv = bdrv_find_format(fmt);
|
drv = bdrv_find_format(fmt);
|
||||||
@@ -225,10 +226,13 @@ static BlockDriverState *bdrv_new_open(const char *filename,
|
|||||||
} else {
|
} else {
|
||||||
drv = NULL;
|
drv = NULL;
|
||||||
}
|
}
|
||||||
if (bdrv_open(bs, filename, flags, drv) < 0) {
|
|
||||||
error_report("Could not open '%s'", filename);
|
ret = bdrv_open(bs, filename, flags, drv);
|
||||||
|
if (ret < 0) {
|
||||||
|
error_report("Could not open '%s': %s", filename, strerror(-ret));
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bdrv_is_encrypted(bs)) {
|
if (bdrv_is_encrypted(bs)) {
|
||||||
printf("Disk image '%s' is encrypted.\n", filename);
|
printf("Disk image '%s' is encrypted.\n", filename);
|
||||||
if (read_password(password, sizeof(password)) < 0) {
|
if (read_password(password, sizeof(password)) < 0) {
|
||||||
|
@@ -708,8 +708,6 @@ int64_t qemu_next_deadline(void)
|
|||||||
return delta;
|
return delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
|
|
||||||
static int64_t qemu_next_alarm_deadline(void)
|
static int64_t qemu_next_alarm_deadline(void)
|
||||||
{
|
{
|
||||||
int64_t delta;
|
int64_t delta;
|
||||||
@@ -922,6 +920,8 @@ static void dynticks_rearm_timer(struct qemu_alarm_timer *t)
|
|||||||
|
|
||||||
#endif /* defined(__linux__) */
|
#endif /* defined(__linux__) */
|
||||||
|
|
||||||
|
#if !defined(_WIN32)
|
||||||
|
|
||||||
static int unix_start_timer(struct qemu_alarm_timer *t)
|
static int unix_start_timer(struct qemu_alarm_timer *t)
|
||||||
{
|
{
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
|
5
qerror.c
5
qerror.c
@@ -200,6 +200,11 @@ static const QErrorStringTable qerror_table[] = {
|
|||||||
.error_fmt = QERR_UNDEFINED_ERROR,
|
.error_fmt = QERR_UNDEFINED_ERROR,
|
||||||
.desc = "An undefined error has ocurred",
|
.desc = "An undefined error has ocurred",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.error_fmt = QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
|
||||||
|
.desc = "'%(device)' uses a %(format) feature which is not "
|
||||||
|
"supported by this qemu version: %(feature)",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.error_fmt = QERR_VNC_SERVER_FAILED,
|
.error_fmt = QERR_VNC_SERVER_FAILED,
|
||||||
.desc = "Could not start VNC server on %(target)",
|
.desc = "Could not start VNC server on %(target)",
|
||||||
|
3
qerror.h
3
qerror.h
@@ -165,6 +165,9 @@ QError *qobject_to_qerror(const QObject *obj);
|
|||||||
#define QERR_UNDEFINED_ERROR \
|
#define QERR_UNDEFINED_ERROR \
|
||||||
"{ 'class': 'UndefinedError', 'data': {} }"
|
"{ 'class': 'UndefinedError', 'data': {} }"
|
||||||
|
|
||||||
|
#define QERR_UNKNOWN_BLOCK_FORMAT_FEATURE \
|
||||||
|
"{ 'class': 'UnknownBlockFormatFeature', 'data': { 'device': %s, 'format': %s, 'feature': %s } }"
|
||||||
|
|
||||||
#define QERR_VNC_SERVER_FAILED \
|
#define QERR_VNC_SERVER_FAILED \
|
||||||
"{ 'class': 'VNCServerFailed', 'data': { 'target': %s } }"
|
"{ 'class': 'VNCServerFailed', 'data': { 'target': %s } }"
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
* Find a nice value for msize
|
* Find a nice value for msize
|
||||||
* XXX if_maxlinkhdr already in mtu
|
* XXX if_maxlinkhdr already in mtu
|
||||||
*/
|
*/
|
||||||
#define SLIRP_MSIZE (IF_MTU + IF_MAXLINKHDR + sizeof(struct m_hdr ) + 6)
|
#define SLIRP_MSIZE (IF_MTU + IF_MAXLINKHDR + offsetof(struct mbuf, m_dat) + 6)
|
||||||
|
|
||||||
void
|
void
|
||||||
m_init(Slirp *slirp)
|
m_init(Slirp *slirp)
|
||||||
@@ -65,7 +65,7 @@ m_get(Slirp *slirp)
|
|||||||
m->m_flags = (flags | M_USEDLIST);
|
m->m_flags = (flags | M_USEDLIST);
|
||||||
|
|
||||||
/* Initialise it */
|
/* Initialise it */
|
||||||
m->m_size = SLIRP_MSIZE - sizeof(struct m_hdr);
|
m->m_size = SLIRP_MSIZE - offsetof(struct mbuf, m_dat);
|
||||||
m->m_data = m->m_dat;
|
m->m_data = m->m_dat;
|
||||||
m->m_len = 0;
|
m->m_len = 0;
|
||||||
m->m_nextpkt = NULL;
|
m->m_nextpkt = NULL;
|
||||||
|
@@ -1147,8 +1147,8 @@ void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,
|
|||||||
if (cenv == env) {
|
if (cenv == env) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
qemu_inject_x86_mce(env, 1, MCI_STATUS_VAL | MCI_STATUS_UC,
|
||||||
qemu_inject_x86_mce(env, 1, 0xa000000000000000, 0, 0, 0);
|
MCG_STATUS_MCIP | MCG_STATUS_RIPV, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user