[libvirt] [PATCH v3] add a boot option to do strict boot
by Amos Kong
Seabios already added a new device type to halt booting.
Qemu can add "HALT" at the end of bootindex string, then
seabios will halt booting after trying to boot from all
selected devices.
This patch added a new boot option to configure if boot
from un-selected devices.
This option only effects when boot priority is changed by
bootindex options, the old style(-boot order=..) will still
try to boot from un-selected devices.
v2: add HALT entry in get_boot_devices_list()
v3: rebase to latest qemu upstream
Signed-off-by: Amos Kong <akong(a)redhat.com>
---
As we discussed in the past, we need to introduce a general
query-config command to tell libvirt the supported options.
Anthony will do it?
http://lists.nongnu.org/archive/html/qemu-devel/2013-03/msg00349.html
---
qemu-options.hx | 8 ++++++--
vl.c | 25 ++++++++++++++++++++++++-
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 30fb85d..06dd565 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -161,14 +161,14 @@ ETEXI
DEF("boot", HAS_ARG, QEMU_OPTION_boot,
"-boot [order=drives][,once=drives][,menu=on|off]\n"
- " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time]\n"
+ " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
" 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
" 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
" 'sp_time': the period that splash picture last if menu=on, unit is ms\n"
" 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
QEMU_ARCH_ALL)
STEXI
-@item -boot [order=@var{drives}][,once=@var{drives}][,menu=on|off][,splash=@var{sp_name}][,splash-time=@var{sp_time}][,reboot-timeout=@var{rb_timeout}]
+@item -boot [order=@var{drives}][,once=@var{drives}][,menu=on|off][,splash=@var{sp_name}][,splash-time=@var{sp_time}][,reboot-timeout=@var{rb_timeout}][,strict=on|off]
@findex -boot
Specify boot order @var{drives} as a string of drive letters. Valid
drive letters depend on the target achitecture. The x86 PC uses: a, b
@@ -192,6 +192,10 @@ when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not
reboot, qemu passes '-1' to bios by default. Currently Seabios for X86
system support it.
+Do strict boot via @option{strict=on} as far as firmware/BIOS
+supports it. This only effects when boot priority is changed by
+bootindex options. The default is non-strict boot.
+
@example
# try to boot from network first, then from hard disk
qemu-system-i386 -boot order=nc
diff --git a/vl.c b/vl.c
index ce51e65..aeed7f4 100644
--- a/vl.c
+++ b/vl.c
@@ -234,6 +234,7 @@ int ctrl_grab = 0;
unsigned int nb_prom_envs = 0;
const char *prom_envs[MAX_PROM_ENVS];
int boot_menu;
+bool boot_strict;
uint8_t *boot_splash_filedata;
size_t boot_splash_filedata_size;
uint8_t qemu_extra_params_fw[2];
@@ -458,6 +459,9 @@ static QemuOptsList qemu_boot_opts = {
}, {
.name = "reboot-timeout",
.type = QEMU_OPT_STRING,
+ }, {
+ .name = "strict",
+ .type = QEMU_OPT_STRING,
},
{ /*End of list */ }
},
@@ -1267,6 +1271,12 @@ char *get_boot_devices_list(size_t *size)
*size = total;
+ if (boot_strict && *size > 0) {
+ list[total-1] = '\n';
+ list = g_realloc(list, total + 4);
+ memcpy(&list[total], "HALT", 4);
+ *size = total + 4;
+ }
return list;
}
@@ -3131,7 +3141,7 @@ int main(int argc, char **argv, char **envp)
static const char * const params[] = {
"order", "once", "menu",
"splash", "splash-time",
- "reboot-timeout", NULL
+ "reboot-timeout", "strict", NULL
};
char buf[sizeof(boot_devices)];
char *standard_boot_devices;
@@ -3174,6 +3184,19 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
}
+ if (get_param_value(buf, sizeof(buf),
+ "strict", optarg)) {
+ if (!strcmp(buf, "on")) {
+ boot_strict = true;
+ } else if (!strcmp(buf, "off")) {
+ boot_strict = false;
+ } else {
+ fprintf(stderr,
+ "qemu: invalid option value '%s'\n",
+ buf);
+ exit(1);
+ }
+ }
if (!qemu_opts_parse(qemu_find_opts("boot-opts"),
optarg, 0)) {
exit(1);
--
1.7.1
12 years, 1 month
[libvirt] conftest segfault
by Gene Czarcinski
One of the libvirt tests (conftest) has been segfaulting for some time
with no indication of a test failure other than a message in syslog. I
verified this by building libvirt-1.0.3-1 with mock.
Gene
12 years, 1 month
[libvirt] [libvirt-designer 1/2] Fix libvirt caps -> libosinfo platform short id mapping
by Christophe Fergeau
The code was building an id starting with kvm- while libosinfo qemu
description uses qemu-kvm-. Also, starting from qemu 1.2.0, there is
no separate qemu-kvm tarball.
guess_platform_from_connect is starting to be a bit magic, it may
be better to add a <machine> attribute to libosinfo <platform>
description and to use this to improve the matching between
libosinfo data and libvirt caps.
---
examples/virtxml.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/examples/virtxml.c b/examples/virtxml.c
index 09f49cf..a68843d 100644
--- a/examples/virtxml.c
+++ b/examples/virtxml.c
@@ -442,13 +442,13 @@ guess_platform_from_connect(GVirConnection *conn)
}
/* do some mappings:
- * QEMU -> kvm
+ * QEMU -> qemu-kvm
* Xen -> xen
*/
type = g_ascii_strdown(hv_type, -1);
- if (g_str_equal(type, "qemu")) {
+ if (g_str_equal(type, "qemu") && ver <= 1002000) {
g_free(type);
- type = g_strdup("kvm");
+ type = g_strdup("qemu-kvm");
}
major = ver / 1000000;
--
1.8.1.4
12 years, 1 month
[libvirt] [PATCH 1/2] Fix /pool/storage/directory@path documentation
by Christophe Fergeau
Because of a wrong copy and paste, the documentation was saying that
'path' is the path to a block device node while it's a path to a
directory.
---
Pushed under the trivial rule
docs/formatstorage.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in
index 8ac7ab1..49ae818 100644
--- a/docs/formatstorage.html.in
+++ b/docs/formatstorage.html.in
@@ -84,7 +84,7 @@
<dt><code>directory</code></dt>
<dd>Provides the source for pools backed by directories. May
only occur once. Contains a single attribute <code>path</code>
- which is the fully qualified path to the block device node.
+ which is the fully qualified path to the backing directory.
<span class="since">Since 0.4.1</span></dd>
<dt><code>adapter</code></dt>
<dd>Provides the source for pools backed by SCSI adapters. May
--
1.8.1.4
12 years, 1 month
[libvirt] [PATCH 0/5]Add startupPolicy attribute support for hard disks
by Guannan Ren
The set of patches is trying to add 'startupPolicy' attribute support
to the source element of hard disks. Policy levels are using the
mandatory, requisite, optional levels as originally documented.
For the 'optional' policy, there is a little difference from CDROM and
Floppy which only drop its source path, for disks, if missing, the
checking function will drop their definitions, because qemu doesn't
allow missing source path for hard disk.
If guest is using per-device boot element for its devices, after dropping
one or more bootable device, the boot order will not be contiguous, the way
here I use is to reorder them to make them contiguous. In this way, I
introduce two new bit-operating functions
virBitmapNextLastSetBit: Search for the last set bit before
certain position.
virBitmapNextLastSetBit: Search for the last clear bit before
certain position.
Guannan Ren(5)
[PATCH 1/5] conf: add startupPolicy attribute for harddisk
[PATCH 2/5] util: add two functions to find last set or unset bit in
[PATCH 3/5] qemu: move disk presence checking before disk chain
[PATCH 4/5] qemu: drop disk definition if missing and reorder
[PATCH 5/5] event: add hard disk dropping event reason enum
docs/formatdomain.html.in | 9 +++++---
include/libvirt/libvirt.h.in | 1 +
src/conf/domain_conf.c | 21 +++++++++++++------
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 2 ++
src/qemu/qemu_domain.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
src/qemu/qemu_process.c | 7 ++++---
src/util/virbitmap.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/util/virbitmap.h | 6 ++++++
tests/virbitmaptest.c | 51 +++++++++++++++++++++++++++++++++++++++++++++-
10 files changed, 276 insertions(+), 24 deletions(-)
12 years, 1 month
[libvirt] qmp monitor is broken
by Gerd Hoffmann
Hi,
$subject says it. Bisecting points to:
commit 23673ca740e0eda66901ca801a5a901df378b063
Author: Anthony Liguori <aliguori(a)us.ibm.com>
Date: Tue Mar 5 23:21:23 2013 +0530
qemu-char: add watch support
This allows a front-end to request for a callback when the backend
is writable again.
Signed-off-by: Anthony Liguori <aliguori(a)us.ibm.com>
Signed-off-by: Amit Shah <amit.shah(a)redhat.com>
Symtoms: "virsh start" hangs (not always, but most of the time). When
killing qemu it prints an error message:
error: Failed to start domain fedora-org-virtio
error: internal error cannot parse json {"return": [{"name":
"chardev-remove"}, {"name": "chardev-add"}, {"name": "query-target"},
{"name": "query-cpu-definitions"}, {"name": "query-machines"}, {"name":
"device-list-properties"}, {"name": "qom-list-types"}, {"name":
"change-vnc-password"}, {"name": "nbd-server-stop"}, {"name":
"nbd-server-add"}, {"name": "nbd-server-start"}, {"name": "qom-get"},
{"name": "qom-set"}, {"name": "qom-list"}, {"name": "query-block-jobs"},
{"name": "query-balloon"}, {"name": "query-migrate-capabilities"},
{"name": "migrate-set-capabilities"}, {"name": "query-migrate"},
{"name": "query-uuid"}, {"name": "query-name"}, {"name": "query-spice"},
{"name": "query-vnc"}, {"name": "query-mice"}, {"name": "query-status"},
{"name": "query-kvm"}, {"name": "query-pci"}, {"name": "query-cpus"},
{"name": "query-blockstats"}, {"name": "query-block"}, {"name":
"query-chardev"}, {"name": "query-events"}, {"name": "query-commands"},
{"name": "query-version"}, {"name": "human-monitor-command"}, {"name":
"qmp_capabilities
So it looks like a bulky qmp reply is written incomplete (or corrupted)
and libvirt waits forever for the missing bits ...
cheers,
Gerd
12 years, 1 month
[libvirt] [ANNOUNCE] libvirt-glib 0.1.6 release
by Daniel P. Berrange
I am pleased to announce that a new release of the libvirt-glib package,
version 0.1.6, is now available from
ftp://libvirt.org/libvirt/glib/
The packages are GPG signed with
Key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF (4096R)
New in this release:
- Prefer g_strlcpy over strncpy
- Fix potential crashes in some error handling cases
- Fix typo in gvir_config_init docs which broke vala binding
- Use 'transfer none' for argv parameter in all init functions
- Ensure stream data parameters are annotated to be guint8
arrays, not gchar, since they're not NULL terminated
strings.
- Replace FSF address with URL in copyright headers
- Add API for changing Spice compression parameters.
libvirt-glib comprises three distinct libraries:
- libvirt-glib - Integrate with the GLib event loop and error handling
- libvirt-gconfig - Representation of libvirt XML documents as GObjects
- libvirt-gobject - Mapping of libvirt APIs into the GObject type system
NB: While libvirt aims to be API/ABI stable forever, with libvirt-glib
we are not yet guaranteeing that libvirt-glib libraries are API/ABI
permanently stable. As of the 0.0.8 release, we have tentatively frozen
the API/ABI with the intent of being longterm stable hereafter, but
there is still a small chance we might find flaws requiring an API/ABI
change. The likelihood of this is low, however, and we will strive to
avoid it.
Follow up comments about libvirt-glib should be directed to the regular
libvir-list(a)redhat.com development list.
Thanks to all the people involved in contributing to this release.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
12 years, 1 month
[libvirt] [PATCH v8 0/3] DEVICE_DELETED event
by Michael S. Tsirkin
libvirt has a long-standing bug: when removing the device,
it can request removal but does not know when the
removal completes. Add an event so we can fix this in a robust way.
First patch only adds the event with ID, second patch adds a path field.
Split this way for ease of backport (stable downstreams without QOM
would want to only take the first patch).
Event without fields is still useful as management can use it to
poll device list to figure out which device was removed.
Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com>
If there are no more comments I'll stick this on my
pci branch.
Changes from v7:
- none, v7 was malformed series sent by mistake
Changes from v6:
- make empty event use data: {}, Markus prefers this
Changes from v5:
- Emit an empty event on unnamed devices in patch 1/3, as suggested by Markus
Changes from v4:
- Add extra triggers and extra fields as requested by Markus
Changes from v3:
- Document that we only emit events for devices with
and ID, as suggested by Markus
Changes from v2:
- move event toward the end of device_unparent,
so that parents are reported after their children,
as suggested by Paolo
Changes from v1:
- move to device_unparent
- address comments by Andreas and Eric
--
Anthony Liguori
Michael S. Tsirkin (3):
qdev: DEVICE_DELETED event
qom: pass original path to unparent method
qmp: add path to device_deleted event
QMP/qmp-events.txt | 18 ++++++++++++++++++
hw/qdev.c | 15 +++++++++++++--
include/monitor/monitor.h | 1 +
include/qom/object.h | 3 ++-
monitor.c | 1 +
qapi-schema.json | 4 +++-
qom/object.c | 4 +++-
7 files changed, 41 insertions(+), 5 deletions(-)
--
MST
12 years, 1 month
[libvirt] [libvirt-sandbox][PATCH] Docs: fix a typo in help documents
by Alex Jia
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
bin/virt-sandbox.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/virt-sandbox.c b/bin/virt-sandbox.c
index bd7ac49..654a205 100644
--- a/bin/virt-sandbox.c
+++ b/bin/virt-sandbox.c
@@ -87,10 +87,10 @@ int main(int argc, char **argv) {
{ "name", 'n', 0, G_OPTION_ARG_STRING, &name,
N_("name of the sandbox"), "NAME" },
{ "mount", 'm', 0, G_OPTION_ARG_STRING_ARRAY, &mounts,
- N_("mount a filesystem int he guest"), "TYPE:TARGET=SOURCE" },
+ N_("mount a filesystem in the guest"), "TYPE:TARGET=SOURCE" },
{ "include", 'i', 0, G_OPTION_ARG_STRING_ARRAY, &includes,
N_("file to copy into custom dir"), "GUEST-PATH=HOST-PATH", },
- { "includefile", 'I', 0, G_OPTION_ARG_STRING, &includefile,
+ { "interfile", 'I', 0, G_OPTION_ARG_STRING, &includefile,
N_("file contain list of files to include"), "FILE" },
{ "network", 'N', 0, G_OPTION_ARG_STRING_ARRAY, &networks,
N_("setup network interface properties"), "PATH", },
--
1.7.1
12 years, 1 month