Skip to content

Commit

Permalink
0.12.0-rc2 - upstream a68fc29 - Dec 12, 2009
Browse files Browse the repository at this point in the history
  • Loading branch information
gdwnldsKSC committed Sep 24, 2024
1 parent 9553abf commit 4c4ff1d
Show file tree
Hide file tree
Showing 37 changed files with 1,263 additions and 330 deletions.
1 change: 1 addition & 0 deletions WinQemu.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,7 @@
<ClInclude Include="qemu\qbool.h" />
<ClInclude Include="qemu\qdict.h" />
<ClInclude Include="qemu\qemu-config.h" />
<ClInclude Include="qemu\qemu-objects.h" />
<ClInclude Include="qemu\qemu-option.h" />
<ClInclude Include="qemu\qemu-options.h" />
<ClInclude Include="qemu\qemu-thread.h" />
Expand Down
3 changes: 3 additions & 0 deletions WinQemu.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -2108,6 +2108,9 @@
<ClInclude Include="qemu\monitor.h">
<Filter>qemu\inc</Filter>
</ClInclude>
<ClInclude Include="qemu\qemu-objects.h">
<Filter>qemu\inc</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.md" />
Expand Down
36 changes: 36 additions & 0 deletions qemu/Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
version 0.12.0-rc2:

- v2: properly save kvm system time msr registers (Glauber Costa)
- convert more monitor commands to qmp (Luiz Capitulino)
- vnc: fix capslock tracking logic. (Gerd Hoffmann)
- QemuOpts: allow larger option values. (Gerd Hoffmann)
- scsi: fix drive hotplug. (Gerd Hoffmann)
- pci: don't hw_error() when no slot is available. (Gerd Hoffmann)
- pci: don't abort() when trying to hotplug with acpi off. (Gerd Hoffmann)
- allow default devices to be implemented in config file (Gerd Hoffman)
- vc: colorize chardev title line with blue background. (Gerd Hoffmann)
- chardev: make chardevs specified in config file work. (Gerd Hoffmann)
- qdev: also match bus name for global properties (Gerd Hoffmann)
- qdev: add command line option to set global defaults for properties. (Gerd Hoffmann)
- kvm: x86: Save/restore exception_index (Jan Kiszka)
- qdev: Replace device names containing whitespace (Markus Armbruster)
- fix rtc-td-hack on host without high-res timers (Gleb Natapov)
- virtio: verify features on load (Michael S. Tsirkin)
- vmware_vga: add rom file so that it boots. (Dave Airlie)
- Do not abort on qemu_malloc(0) in production builds (Anthony Liguori)
- Fix ARM userspace strex implementation. (Paul Brook)
- qemu: delete rule target on error (Michael S. Tsirkin)
- QMP: add human-readable description to error response (Markus Armbruster)
- convert more monitor commands to QError (Markus Armbruster)
- monitor: Fix double-prompt after "change vnc passwd BLA" (Markus Armbruster)
- monitor: do_cont(): Don't ask for passwords (Luiz Capitulino)
- monitor: Introduce 'block_passwd' command (Luiz Capitulino)
- pci: interrupt disable bit support (Michael S. Tsirkin)
- pci: interrupt status bit implementation (Michael S. Tsirkin)
- pci: prepare irq code for interrupt state (Michael S. Tsirkin)
- msix: function mask support (Michael S. Tsirkin)
- msix: macro rename for function mask support (Michael S. Tsirkin)
- cpuid: Fix multicore setup on Intel (Andre Przywara)
- kvm: x86: Fix initial kvm_has_msr_star (Jan Kiszka)
- Update OpenBIOS images to r640 (Aurelien Jarno)

version 0.10.2:

- fix savevm/loadvm (Anthony Liguori)
Expand Down
17 changes: 11 additions & 6 deletions qemu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))

recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)

#######################################################################
# QObject
qobject-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o
qobject-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o
qobject-obj-y += qerror.o

#######################################################################
# block-obj-y is code used by both qemu system emulation and qemu-img

Expand Down Expand Up @@ -120,6 +126,7 @@ net-obj-y += $(addprefix net/, $(net-nested-y))

obj-y = $(block-obj-y)
obj-y += $(net-obj-y)
obj-y += $(qobject-obj-y)
obj-y += readline.o console.o

obj-y += tcg-runtime.o host-utils.o
Expand Down Expand Up @@ -152,8 +159,6 @@ obj-y += buffered_file.o migration.o migration-tcp.o qemu-sockets.o
obj-y += qemu-char.o aio.o savevm.o
obj-y += msmouse.o ps2.o
obj-y += qdev.o qdev-properties.o
obj-y += qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o json-lexer.o
obj-y += json-streamer.o json-parser.o qjson.o qerror.o
obj-y += qemu-config.o block-migration.o

obj-$(CONFIG_BRLAPI) += baum.o
Expand Down Expand Up @@ -230,18 +235,18 @@ libqemu_common.a: $(obj-y)

qemu-img.o: qemu-img-cmds.h

qemu-img$(EXESUF): qemu-img.o qemu-tool.o $(block-obj-y)
qemu-img$(EXESUF): qemu-img.o qemu-tool.o $(block-obj-y) $(qobject-obj-y)

qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o $(block-obj-y)
qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o $(block-obj-y) $(qobject-obj-y)

qemu-io$(EXESUF): qemu-io.o qemu-tool.o cmd.o $(block-obj-y)
qemu-io$(EXESUF): qemu-io.o qemu-tool.o cmd.o $(block-obj-y) $(qobject-obj-y)

qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $@")

check-qint: check-qint.o qint.o qemu-malloc.o
check-qstring: check-qstring.o qstring.o qemu-malloc.o
check-qdict: check-qdict.o qdict.o qint.o qstring.o qemu-malloc.o
check-qdict: check-qdict.o qdict.o qint.o qstring.o qbool.o qemu-malloc.o qlist.o
check-qlist: check-qlist.o qlist.o qint.o qemu-malloc.o
check-qfloat: check-qfloat.o qfloat.o qemu-malloc.o
check-qjson: check-qjson.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o qjson.o json-streamer.o json-lexer.o json-parser.o qemu-malloc.o
Expand Down
2 changes: 1 addition & 1 deletion qemu/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.91
0.11.92
207 changes: 175 additions & 32 deletions qemu/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "monitor.h"
#include "block_int.h"
#include "module.h"
#include "qemu-objects.h"

#ifdef CONFIG_BSD
#include <sys/types.h>
Expand Down Expand Up @@ -1164,61 +1165,203 @@ int bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
return bs->drv->bdrv_is_allocated(bs, sector_num, nb_sectors, pnum);
}

void bdrv_info(Monitor *mon)
static void bdrv_print_dict(QObject *obj, void *opaque)
{
QDict *bs_dict;
Monitor *mon = opaque;

bs_dict = qobject_to_qdict(obj);

monitor_printf(mon, "%s: type=%s removable=%d",
qdict_get_str(bs_dict, "device"),
qdict_get_str(bs_dict, "type"),
qdict_get_bool(bs_dict, "removable"));

if (qdict_get_bool(bs_dict, "removable")) {
monitor_printf(mon, " locked=%d", qdict_get_bool(bs_dict, "locked"));
}

if (qdict_haskey(bs_dict, "inserted")) {
QDict *qdict = qobject_to_qdict(qdict_get(bs_dict, "inserted"));

monitor_printf(mon, " file=");
monitor_print_filename(mon, qdict_get_str(qdict, "file"));
if (qdict_haskey(qdict, "backing_file")) {
monitor_printf(mon, " backing_file=");
monitor_print_filename(mon, qdict_get_str(qdict, "backing_file"));
}
monitor_printf(mon, " ro=%d drv=%s encrypted=%d",
qdict_get_bool(qdict, "ro"),
qdict_get_str(qdict, "drv"),
qdict_get_bool(qdict, "encrypted"));
} else {
monitor_printf(mon, " [not inserted]");
}

monitor_printf(mon, "\n");
}

void bdrv_info_print(Monitor *mon, const QObject *data)
{
qlist_iter(qobject_to_qlist(data), bdrv_print_dict, mon);
}

/**
* bdrv_info(): Block devices information
*
* Each block device information is stored in a QDict and the
* returned QObject is a QList of all devices.
*
* The QDict contains the following:
*
* - "device": device name
* - "type": device type
* - "removable": true if the device is removable, false otherwise
* - "locked": true if the device is locked, false otherwise
* - "inserted": only present if the device is inserted, it is a QDict
* containing the following:
* - "file": device file name
* - "ro": true if read-only, false otherwise
* - "drv": driver format name
* - "backing_file": backing file name if one is used
* - "encrypted": true if encrypted, false otherwise
*
* Example:
*
* [ { "device": "ide0-hd0", "type": "hd", "removable": false, "locked": false,
* "inserted": { "file": "/tmp/foobar", "ro": false, "drv": "qcow2" } },
* { "device": "floppy0", "type": "floppy", "removable": true,
* "locked": false } ]
*/
void bdrv_info(Monitor *mon, QObject **ret_data)
{
QList *bs_list;
BlockDriverState *bs;

bs_list = qlist_new();

for (bs = bdrv_first; bs != NULL; bs = bs->next) {
monitor_printf(mon, "%s:", bs->device_name);
monitor_printf(mon, " type=");
QObject *bs_obj;
const char *type = "unknown";

switch(bs->type) {
case BDRV_TYPE_HD:
monitor_printf(mon, "hd");
type = "hd";
break;
case BDRV_TYPE_CDROM:
monitor_printf(mon, "cdrom");
type = "cdrom";
break;
case BDRV_TYPE_FLOPPY:
monitor_printf(mon, "floppy");
type = "floppy";
break;
}
monitor_printf(mon, " removable=%d", bs->removable);
if (bs->removable) {
monitor_printf(mon, " locked=%d", bs->locked);
}

bs_obj = qobject_from_jsonf("{ 'device': %s, 'type': %s, "
"'removable': %i, 'locked': %i }",
bs->device_name, type, bs->removable,
bs->locked);
assert(bs_obj != NULL);

if (bs->drv) {
monitor_printf(mon, " file=");
monitor_print_filename(mon, bs->filename);
QObject *obj;
QDict *bs_dict = qobject_to_qdict(bs_obj);

obj = qobject_from_jsonf("{ 'file': %s, 'ro': %i, 'drv': %s, "
"'encrypted': %i }",
bs->filename, bs->read_only,
bs->drv->format_name,
bdrv_is_encrypted(bs));
assert(obj != NULL);
if (bs->backing_file[0] != '\0') {
monitor_printf(mon, " backing_file=");
monitor_print_filename(mon, bs->backing_file);
QDict *qdict = qobject_to_qdict(obj);
qdict_put(qdict, "backing_file",
qstring_from_str(bs->backing_file));
}
monitor_printf(mon, " ro=%d", bs->read_only);
monitor_printf(mon, " drv=%s", bs->drv->format_name);
monitor_printf(mon, " encrypted=%d", bdrv_is_encrypted(bs));
} else {
monitor_printf(mon, " [not inserted]");

qdict_put_obj(bs_dict, "inserted", obj);
}
monitor_printf(mon, "\n");
qlist_append_obj(bs_list, bs_obj);
}

*ret_data = QOBJECT(bs_list);
}

static void bdrv_stats_iter(QObject *data, void *opaque)
{
QDict *qdict;
Monitor *mon = opaque;

qdict = qobject_to_qdict(data);
monitor_printf(mon, "%s:", qdict_get_str(qdict, "device"));

qdict = qobject_to_qdict(qdict_get(qdict, "stats"));
monitor_printf(mon, " rd_bytes=%" PRId64
" wr_bytes=%" PRId64
" rd_operations=%" PRId64
" wr_operations=%" PRId64
"\n",
qdict_get_int(qdict, "rd_bytes"),
qdict_get_int(qdict, "wr_bytes"),
qdict_get_int(qdict, "rd_operations"),
qdict_get_int(qdict, "wr_operations"));
}

/* The "info blockstats" command. */
void bdrv_info_stats(Monitor *mon)
void bdrv_stats_print(Monitor *mon, const QObject *data)
{
qlist_iter(qobject_to_qlist(data), bdrv_stats_iter, mon);
}

/**
* bdrv_info_stats(): show block device statistics
*
* Each device statistic information is stored in a QDict and
* the returned QObject is a QList of all devices.
*
* The QDict contains the following:
*
* - "device": device name
* - "stats": A QDict with the statistics information, it contains:
* - "rd_bytes": bytes read
* - "wr_bytes": bytes written
* - "rd_operations": read operations
* - "wr_operations": write operations
*
* Example:
*
* [ { "device": "ide0-hd0",
* "stats": { "rd_bytes": 512,
* "wr_bytes": 0,
* "rd_operations": 1,
* "wr_operations": 0 } },
* { "device": "ide1-cd0",
* "stats": { "rd_bytes": 0,
* "wr_bytes": 0,
* "rd_operations": 0,
* "wr_operations": 0 } } ]
*/
void bdrv_info_stats(Monitor *mon, QObject **ret_data)
{
QObject *obj;
QList *devices;
BlockDriverState *bs;

devices = qlist_new();

for (bs = bdrv_first; bs != NULL; bs = bs->next) {
monitor_printf(mon, "%s:"
" rd_bytes=%" PRIu64
" wr_bytes=%" PRIu64
" rd_operations=%" PRIu64
" wr_operations=%" PRIu64
"\n",
bs->device_name,
bs->rd_bytes, bs->wr_bytes,
bs->rd_ops, bs->wr_ops);
}
obj = qobject_from_jsonf("{ 'device': %s, 'stats': {"
"'rd_bytes': %" PRId64 ","
"'wr_bytes': %" PRId64 ","
"'rd_operations': %" PRId64 ","
"'wr_operations': %" PRId64
"} }",
bs->device_name,
bs->rd_bytes, bs->wr_bytes,
bs->rd_ops, bs->wr_ops);
assert(obj != NULL);
qlist_append_obj(devices, obj);
}

*ret_data = QOBJECT(devices);
}

const char *bdrv_get_encrypted_filename(BlockDriverState *bs)
Expand Down
7 changes: 5 additions & 2 deletions qemu/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "qemu-aio.h"
#include "qemu-common.h"
#include "qemu-option.h"
#include "qobject.h"

/* block.c */
typedef struct BlockDriver BlockDriver;
Expand Down Expand Up @@ -45,8 +46,10 @@ typedef struct QEMUSnapshotInfo {
#define BDRV_SECTOR_SIZE (1 << BDRV_SECTOR_BITS)
#define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1);

void bdrv_info(Monitor *mon);
void bdrv_info_stats(Monitor *mon);
void bdrv_info_print(Monitor *mon, const QObject *data);
void bdrv_info(Monitor *mon, QObject **ret_data);
void bdrv_stats_print(Monitor *mon, const QObject *data);
void bdrv_info_stats(Monitor *mon, QObject **ret_data);

void bdrv_init(void);
void bdrv_init_with_whitelist(void);
Expand Down
2 changes: 1 addition & 1 deletion qemu/config-host.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define CONFIG_STATIC 1
#define CONFIG_SLIRP 1
#define CONFIG_ADLIB 1
#define QEMU_VERSION "pre-0.12.0-rc1"
#define QEMU_VERSION "0.11.92"
#define QEMU_PKGVERSION "MS-VisualStudio-2022"
#define CONFIG_UNAME_RELEASE ""
#define CONFIG_AUDIO_DRIVERS &winwave_audio_driver, \
Expand Down
Loading

0 comments on commit 4c4ff1d

Please sign in to comment.