[libvirt] [PATCH v2 00/22] Remove unnecessary curly brackets around one-line bodies
by Martin Kletzander
Brackets were removed by the following script in the root directory of
libvirt's repository:
for i in $(git ls-files | grep '\.[ch]$'); do
echo -n "$i ... ";
emacs $i --batch --eval \
'(replace-regexp "^\\([[:space:]]*\\(if\\|for\\|while\\).*)\\)[[:space:]]*{\\(\n[^\n;]*;[^\n;]*\\)\n[[:space:]]*}$" "\\1\\3" nil (point-min) (point-max))' \
-f save-buffer &>/dev/null;
echo done;
done
v2:
- Smaller patches, so there has to be none allowed through by
moderators
- Only curly brackets around one-line bodies with one-line preceding
conditions removed
- syntax-check! (with some other bracket-spacing.pl cleanups
Martin Kletzander (22):
virt-aa-helper: Trick invalid syntax-check
Remove unnecessary curly brackets in daemon/ and examples/
Remove unnecessary curly brackets in src/esx/esx_driver.c
Remove unnecessary curly brackets in rest of src/esx/
Remove unnecessary curly brackets in src/vmx/vmx.c
Remove unnecessary curly brackets in src/conf/
Remove unnecessary curly brackets in src/hyperv/
Remove unnecessary curly brackets in src/node_device/
Remove unnecessary curly brackets in src/qemu/
Remove unnecessary curly brackets in src/storage/
Remove unnecessary curly brackets in src/test/test_driver.c
Remove unnecessary curly brackets in src/util/
Remove unnecessary curly brackets in src/vbox/
Remove unnecessary curly brackets in rest of src/[a-n]*/
Remove unnecessary curly brackets in rest of src/[o-u]*/
Remove unnecessary curly brackets in rest of src/
Remove unnecessary curly brackets in tools/
Remove unnecessary curly brackets in tests/
docs: Adjust contributor guidelines about curly brackets
bracket-spacing: Don't modify current line
bracket-spacing: Remove pointless cycles
bracket-spacing: Add syntax-check for unnecessary curly brackets
HACKING | 8 +-
build-aux/bracket-spacing.pl | 74 ++++--
daemon/libvirtd.c | 15 +-
daemon/remote.c | 12 +-
docs/hacking.html.in | 4 +-
examples/object-events/event-test.c | 3 +-
examples/openauth/openauth.c | 9 +-
src/access/viraccessdriverstack.c | 3 +-
src/bhyve/bhyve_driver.c | 3 +-
src/conf/capabilities.c | 3 +-
src/conf/domain_conf.c | 135 ++++-------
src/conf/interface_conf.c | 9 +-
src/conf/network_conf.c | 51 ++--
src/conf/node_device_conf.c | 15 +-
src/conf/nwfilter_conf.c | 12 +-
src/conf/object_event.c | 6 +-
src/conf/storage_conf.c | 24 +-
src/datatypes.c | 6 +-
src/driver.c | 3 +-
src/esx/esx_device_monitor.c | 3 +-
src/esx/esx_driver.c | 390 ++++++++++--------------------
src/esx/esx_interface_driver.c | 12 +-
src/esx/esx_network_driver.c | 57 ++---
src/esx/esx_nwfilter_driver.c | 3 +-
src/esx/esx_secret_driver.c | 3 +-
src/esx/esx_storage_backend_iscsi.c | 45 ++--
src/esx/esx_storage_backend_vmfs.c | 51 ++--
src/esx/esx_storage_driver.c | 81 +++----
src/esx/esx_util.c | 45 ++--
src/esx/esx_vi.c | 249 +++++++------------
src/esx/esx_vi_types.c | 45 ++--
src/hyperv/hyperv_device_monitor.c | 3 +-
src/hyperv/hyperv_driver.c | 87 +++----
src/hyperv/hyperv_interface_driver.c | 3 +-
src/hyperv/hyperv_network_driver.c | 3 +-
src/hyperv/hyperv_nwfilter_driver.c | 3 +-
src/hyperv/hyperv_secret_driver.c | 3 +-
src/hyperv/hyperv_storage_driver.c | 3 +-
src/hyperv/hyperv_util.c | 6 +-
src/hyperv/hyperv_wmi.c | 39 +--
src/interface/interface_backend_udev.c | 12 +-
src/libvirt-lxc.c | 3 +-
src/libvirt-nodedev.c | 3 +-
src/libvirt-storage.c | 6 +-
src/libxl/libxl_driver.c | 12 +-
src/locking/lock_daemon.c | 3 +-
src/locking/lock_driver_sanlock.c | 6 +-
src/lxc/lxc_container.c | 9 +-
src/lxc/lxc_driver.c | 9 +-
src/lxc/lxc_process.c | 6 +-
src/network/bridge_driver.c | 6 +-
src/network/bridge_driver_linux.c | 3 +-
src/node_device/node_device_driver.c | 21 +-
src/node_device/node_device_hal.c | 6 +-
src/node_device/node_device_udev.c | 87 +++----
src/nwfilter/nwfilter_dhcpsnoop.c | 3 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 12 +-
src/nwfilter/nwfilter_gentech_driver.c | 9 +-
src/nwfilter/nwfilter_learnipaddr.c | 3 +-
src/openvz/openvz_conf.c | 3 +-
src/openvz/openvz_driver.c | 27 +--
src/phyp/phyp_driver.c | 21 +-
src/qemu/qemu_agent.c | 3 +-
src/qemu/qemu_capabilities.c | 9 +-
src/qemu/qemu_cgroup.c | 6 +-
src/qemu/qemu_command.c | 6 +-
src/qemu/qemu_conf.c | 3 +-
src/qemu/qemu_domain.c | 3 +-
src/qemu/qemu_driver.c | 45 ++--
src/qemu/qemu_hotplug.c | 6 +-
src/qemu/qemu_migration.c | 3 +-
src/qemu/qemu_monitor_json.c | 12 +-
src/qemu/qemu_monitor_text.c | 6 +-
src/qemu/qemu_process.c | 18 +-
src/remote/remote_driver.c | 3 +-
src/rpc/virnetclient.c | 9 +-
src/rpc/virnetserver.c | 3 +-
src/rpc/virnetserverclient.c | 3 +-
src/rpc/virnetserverservice.c | 3 +-
src/security/security_manager.c | 3 +-
src/security/virt-aa-helper.c | 9 +-
src/storage/parthelper.c | 3 +-
src/storage/storage_backend.c | 9 +-
src/storage/storage_backend_disk.c | 15 +-
src/storage/storage_backend_fs.c | 6 +-
src/storage/storage_backend_mpath.c | 27 +--
src/storage/storage_backend_rbd.c | 30 +--
src/storage/storage_backend_scsi.c | 6 +-
src/storage/storage_driver.c | 9 +-
src/test/test_driver.c | 57 ++---
src/uml/uml_conf.c | 6 +-
src/uml/uml_driver.c | 9 +-
src/util/virauth.c | 12 +-
src/util/virbitmap.c | 6 +-
src/util/virbuffer.c | 3 +-
src/util/vircommand.c | 9 +-
src/util/virconf.c | 15 +-
src/util/virdbus.c | 3 +-
src/util/virdnsmasq.c | 3 +-
src/util/vireventpoll.c | 9 +-
src/util/virfile.c | 6 +-
src/util/virfirewall.c | 6 +-
src/util/viriscsi.c | 9 +-
src/util/virlockspace.c | 6 +-
src/util/virlog.c | 3 +-
src/util/virnetdev.c | 6 +-
src/util/virnetdevbridge.c | 3 +-
src/util/virnetdevmacvlan.c | 9 +-
src/util/virnetdevtap.c | 6 +-
src/util/virpci.c | 15 +-
src/util/virsexpr.c | 24 +-
src/util/virstorageencryption.c | 3 +-
src/util/virstoragefile.c | 6 +-
src/util/virsysinfo.c | 3 +-
src/util/virthreadpool.c | 3 +-
src/util/virutil.c | 9 +-
src/util/virxml.c | 18 +-
src/vbox/vbox_MSCOMGlue.c | 30 +--
src/vbox/vbox_XPCOMCGlue.c | 33 +--
src/vbox/vbox_common.c | 51 ++--
src/vbox/vbox_network.c | 15 +-
src/vbox/vbox_snapshot_conf.c | 21 +-
src/vbox/vbox_storage.c | 30 +--
src/vbox/vbox_tmpl.c | 30 +--
src/vmware/vmware_conf.c | 3 +-
src/vmware/vmware_driver.c | 6 +-
src/vmx/vmx.c | 243 +++++++------------
src/xen/block_stats.c | 3 +-
src/xen/xen_driver.c | 6 +-
src/xen/xen_hypervisor.c | 6 +-
src/xen/xend_internal.c | 18 +-
src/xen/xm_internal.c | 6 +-
src/xenapi/xenapi_driver.c | 12 +-
src/xenapi/xenapi_utils.c | 9 +-
src/xenconfig/xen_common.c | 6 +-
src/xenconfig/xen_sxpr.c | 6 +-
tests/commandhelper.c | 3 +-
tests/esxutilstest.c | 12 +-
tests/eventtest.c | 3 +-
tests/openvzutilstest.c | 6 +-
tests/securityselinuxlabeltest.c | 6 +-
tests/shunloadtest.c | 6 +-
tests/utiltest.c | 3 +-
tests/virbuftest.c | 3 +-
tests/virhashtest.c | 30 +--
tests/virtimetest.c | 3 +-
tests/vmx2xmltest.c | 12 +-
tests/xml2vmxtest.c | 27 +--
tools/virsh-console.c | 6 +-
tools/virsh-domain.c | 27 +--
tools/virsh-edit.c | 6 +-
tools/virsh-host.c | 3 +-
tools/virsh-pool.c | 6 +-
tools/virsh-volume.c | 12 +-
tools/virsh.c | 18 +-
tools/wireshark/src/packet-libvirt.c | 6 +-
156 files changed, 1050 insertions(+), 2006 deletions(-)
--
2.1.3
10 years
[libvirt] [PATCH] drvbhyve: Use boot-order for grub-bhyve boot device
by Conrad Meyer
Rather than just picking the first CD (or failing that, HDD) we come
across, if the user has picked a boot device ordering with <boot
order=''>, respect that (and just try to boot the lowest-index device).
Adds two sets of tests to bhyve2xmlargv; 'grub-bootorder' shows that we
pick a user-specified device over the first device in the domain;
'grub-bootorder2' shows that we pick the first (lowest index) device.
---
This is a follow-up to the 'Add non-FreeBSD guest support to Bhyve driver'
patch series to fix the grub-bhyve automagic configuration to respect <boot
order=''> in the domain. (Requested by both Roman and Michal, I believe.)
---
docs/drvbhyve.html.in | 9 +--
src/bhyve/bhyve_command.c | 64 ++++++++++++++++------
.../bhyvexml2argv-grub-bootorder.args | 6 ++
.../bhyvexml2argv-grub-bootorder.devmap | 1 +
.../bhyvexml2argv-grub-bootorder.ldargs | 2 +
.../bhyvexml2argv-grub-bootorder.xml | 36 ++++++++++++
.../bhyvexml2argv-grub-bootorder2.args | 6 ++
.../bhyvexml2argv-grub-bootorder2.devmap | 1 +
.../bhyvexml2argv-grub-bootorder2.ldargs | 2 +
.../bhyvexml2argv-grub-bootorder2.xml | 38 +++++++++++++
tests/bhyvexml2argvtest.c | 2 +
11 files changed, 146 insertions(+), 21 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.devmap
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.devmap
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.xml
diff --git a/docs/drvbhyve.html.in b/docs/drvbhyve.html.in
index bd4b35e..5479511 100644
--- a/docs/drvbhyve.html.in
+++ b/docs/drvbhyve.html.in
@@ -234,10 +234,11 @@ management.</p>
<p>It's possible to boot non-FreeBSD guests by specifying an explicit
bootloader, e.g. <code>grub-bhyve(1)</code>. Arguments to the bootloader may be
specified as well. If the bootloader is <code>grub-bhyve</code> and arguments
-are omitted, libvirt will try and boot the first disk in the domain (either
-<code>cdrom</code>- or <code>disk</code>-type devices). If the disk type is
-<code>disk</code>, it will attempt to boot from the first partition in the disk
-image.</p>
+are omitted, libvirt will try and infer boot ordering from user-supplied
+<boot order='N'> configuration in the domain. Failing that, it will boot
+the first disk in the domain (either <code>cdrom</code>- or
+<code>disk</code>-type devices). If the disk type is <code>disk</code>, it will
+attempt to boot from the first partition in the disk image.</p>
<pre>
...
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index 26d4797..6e3bf03 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -381,38 +381,62 @@ virBhyveUsableDisk(virConnectPtr conn, virDomainDiskDefPtr disk)
return true;
}
+static void
+virBhyveFormatGrubDevice(virBufferPtr devicemap, virDomainDiskDefPtr def)
+{
+
+ if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
+ virBufferAsprintf(devicemap, "(cd) %s\n",
+ virDomainDiskGetSource(def));
+ else
+ virBufferAsprintf(devicemap, "(hd0) %s\n",
+ virDomainDiskGetSource(def));
+}
+
static virCommandPtr
virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
virConnectPtr conn,
const char *devmap_file,
char **devicesmap_out)
{
- virDomainDiskDefPtr disk, cd;
+ virDomainDiskDefPtr hdd, cd, userdef, diskdef;
virBuffer devicemap;
virCommandPtr cmd;
+ int best_idx;
size_t i;
if (def->os.bootloaderArgs != NULL)
return virBhyveProcessBuildCustomLoaderCmd(def);
+ best_idx = INT_MAX;
devicemap = (virBuffer)VIR_BUFFER_INITIALIZER;
- /* Search disk list for CD or HDD device. */
- cd = disk = NULL;
+ /* Search disk list for CD or HDD device. We'll respect <boot order=''> if
+ * present and otherwise pick the first CD or failing that HDD we come
+ * across. */
+ cd = hdd = userdef = NULL;
for (i = 0; i < def->ndisks; i++) {
if (!virBhyveUsableDisk(conn, def->disks[i]))
continue;
+ diskdef = def->disks[i];
+
+ if (diskdef->info.bootIndex && diskdef->info.bootIndex < best_idx) {
+ userdef = diskdef;
+ best_idx = userdef->info.bootIndex;
+ continue;
+ }
+
if (cd == NULL &&
def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
- cd = def->disks[i];
- VIR_INFO("Picking %s as boot CD", virDomainDiskGetSource(cd));
+ cd = diskdef;
+ VIR_INFO("Picking %s as CD", virDomainDiskGetSource(cd));
}
- if (disk == NULL &&
+ if (hdd == NULL &&
def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
- disk = def->disks[i];
- VIR_INFO("Picking %s as HDD", virDomainDiskGetSource(disk));
+ hdd = diskdef;
+ VIR_INFO("Picking %s as HDD", virDomainDiskGetSource(hdd));
}
}
@@ -422,22 +446,28 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
if (devicesmap_out != NULL) {
/* Grub device.map (just for boot) */
- if (disk != NULL)
- virBufferAsprintf(&devicemap, "(hd0) %s\n",
- virDomainDiskGetSource(disk));
+ if (userdef != NULL) {
+ virBhyveFormatGrubDevice(&devicemap, userdef);
+ } else {
+ if (hdd != NULL)
+ virBhyveFormatGrubDevice(&devicemap, hdd);
- if (cd != NULL)
- virBufferAsprintf(&devicemap, "(cd) %s\n",
- virDomainDiskGetSource(cd));
+ if (cd != NULL)
+ virBhyveFormatGrubDevice(&devicemap, cd);
+ }
*devicesmap_out = virBufferContentAndReset(&devicemap);
}
- if (cd != NULL) {
- virCommandAddArg(cmd, "--root");
+ virCommandAddArg(cmd, "--root");
+ if (userdef != NULL) {
+ if (userdef->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
+ virCommandAddArg(cmd, "cd");
+ else
+ virCommandAddArg(cmd, "hd0,msdos1");
+ } else if (cd != NULL) {
virCommandAddArg(cmd, "cd");
} else {
- virCommandAddArg(cmd, "--root");
virCommandAddArg(cmd, "hd0,msdos1");
}
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args
new file mode 100644
index 0000000..eaba370
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args
@@ -0,0 +1,6 @@
+/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
+-s 2:0,ahci-hd,/tmp/freebsd1.img \
+-s 2:0,ahci-hd,/tmp/freebsd2.img \
+-s 2:0,ahci-hd,/tmp/freebsd3.img \
+bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.devmap b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.devmap
new file mode 100644
index 0000000..1be3b50
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.devmap
@@ -0,0 +1 @@
+(hd0) /tmp/freebsd3.img
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.ldargs
new file mode 100644
index 0000000..91c15ce
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.ldargs
@@ -0,0 +1,2 @@
+/usr/local/sbin/grub-bhyve --root hd0,msdos1 --device-map '<device.map>' \
+--memory 214 bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.xml
new file mode 100644
index 0000000..e372024
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.xml
@@ -0,0 +1,36 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <bootloader>/usr/local/sbin/grub-bhyve</bootloader>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd1.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd2.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd3.img'/>
+ <target dev='hda' bus='sata'/>
+ <boot order='1'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args
new file mode 100644
index 0000000..eaba370
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args
@@ -0,0 +1,6 @@
+/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
+-s 2:0,ahci-hd,/tmp/freebsd1.img \
+-s 2:0,ahci-hd,/tmp/freebsd2.img \
+-s 2:0,ahci-hd,/tmp/freebsd3.img \
+bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.devmap b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.devmap
new file mode 100644
index 0000000..1be3b50
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.devmap
@@ -0,0 +1 @@
+(hd0) /tmp/freebsd3.img
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.ldargs
new file mode 100644
index 0000000..91c15ce
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.ldargs
@@ -0,0 +1,2 @@
+/usr/local/sbin/grub-bhyve --root hd0,msdos1 --device-map '<device.map>' \
+--memory 214 bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.xml
new file mode 100644
index 0000000..8742a30
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.xml
@@ -0,0 +1,38 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <bootloader>/usr/local/sbin/grub-bhyve</bootloader>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd1.img'/>
+ <target dev='hda' bus='sata'/>
+ <boot order='111'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd2.img'/>
+ <target dev='hda' bus='sata'/>
+ <boot order='22'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd3.img'/>
+ <target dev='hda' bus='sata'/>
+ <boot order='3'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
index ec57160..cd3aea0 100644
--- a/tests/bhyvexml2argvtest.c
+++ b/tests/bhyvexml2argvtest.c
@@ -163,6 +163,8 @@ mymain(void)
DO_TEST("serial");
DO_TEST("console");
DO_TEST("grub-defaults");
+ DO_TEST("grub-bootorder");
+ DO_TEST("grub-bootorder2");
DO_TEST("bhyveload-explicitargs");
DO_TEST("custom-loader");
DO_TEST("disk-cdrom-grub");
--
1.9.3
10 years
[libvirt] [PATCH 0/3] libxl migration improvements
by Jim Fehlig
This series of patches fixes problems discovered in libxl migration.
The first patch fixes an issue that went undetected while testing the
initial implementation of migration. Receiving migration data occurs
in the context of an event loop callback, effectively blocking the
event loop during the entire migration process. The patch moves the
work of receiving migration data to a thread.
Interestingly, this issue manifested in a failed migration due to failed
keepalives, which would kill virsh's connection to dst host. The dst host
failed to respond to keepalives since its event loop was blocked on
receiving migration data. Ultimately the migration perform phase would
succeed leaving a running domain on dst. However, the subsequent finish
phase would fail since virsh's connection to dst had been killed by the
keepalive failure. Since finish failed, the confirm phase would resume
the domain on src. Yikes! Same domain running on two different hosts :(.
Patches 2 and 3 improve handling of errors in the event the perform or
finish phases of migration fail. See the individual patches for details.
Jim Fehlig (3):
libxl: Receive migration data in a thread
libxl: start domain paused on migration dst
libxl: destroy domain in migration finish phase on failure
src/libxl/libxl_migration.c | 75 ++++++++++++++++++++++++++++++---------------
1 file changed, 51 insertions(+), 24 deletions(-)
--
1.8.4.5
10 years
[libvirt] [PATCH v2] qemu: Don't try to parse -help for new QEMU
by Jiri Denemark
Since QEMU 1.2.0, we switched to QMP probing instead of parsing -help
(and other commands, such as -cpu ?) output. However, if QMP probing
failed, we still tried starting QEMU with various options and parsing
the output, which was guaranteed to fail because the output changed.
Let's just refuse parsing -help for QEMU >= 1.2.0.
https://bugzilla.redhat.com/show_bug.cgi?id=1160318
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Notes:
Version 2:
- fixes comparison to avoid parsing -help for 1.2.0 (> vs >=)
src/qemu/qemu_capabilities.c | 10 ++
tests/qemuhelpdata/qemu-kvm-1.2.0-device | 238 ------------------------------
tests/qemuhelptest.c | 246 ++-----------------------------
3 files changed, 24 insertions(+), 470 deletions(-)
delete mode 100644 tests/qemuhelpdata/qemu-kvm-1.2.0-device
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 74a3b24..cbdc08b 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1384,6 +1384,16 @@ int virQEMUCapsParseHelpStr(const char *qemu,
*version = (major * 1000 * 1000) + (minor * 1000) + micro;
+ /* Refuse to parse -help output for QEMU releases >= 1.2.0 that should be
+ * using QMP probing.
+ */
+ if (*version >= 1002000) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("QEMU %u.%u.%u is too new for help parsing"),
+ major, minor, micro);
+ goto cleanup;
+ }
+
if (virQEMUCapsComputeCmdFlags(help, *version, *is_kvm, *kvm_version,
qemuCaps, check_yajl) < 0)
goto cleanup;
diff --git a/tests/qemuhelpdata/qemu-kvm-1.2.0-device b/tests/qemuhelpdata/qemu-kvm-1.2.0-device
deleted file mode 100644
index f4bfd68..0000000
--- a/tests/qemuhelpdata/qemu-kvm-1.2.0-device
+++ /dev/null
@@ -1,238 +0,0 @@
-name "VGA", bus PCI
-name "usb-storage", bus usb-bus
-name "scsi-hd", bus SCSI, desc "virtual SCSI disk"
-name "i82559a", bus PCI, desc "Intel i82559A Ethernet"
-name "i82559b", bus PCI, desc "Intel i82559B Ethernet"
-name "i82559c", bus PCI, desc "Intel i82559C Ethernet"
-name "esp", bus System
-name "sysbus-ohci", bus System, desc "OHCI USB Controller"
-name "virtio-blk-pci", bus PCI, alias "virtio-blk"
-name "usb-uas", bus usb-bus
-name "qxl-vga", bus PCI, desc "Spice QXL GPU (primary, vga compatible)"
-name "ide-drive", bus IDE, desc "virtual IDE disk or CD-ROM (legacy)"
-name "x3130-upstream", bus PCI, desc "TI X3130 Upstream Port of PCI Express Switch"
-name "cirrus-vga", bus PCI, desc "Cirrus CLGD 54xx VGA"
-name "ide-hd", bus IDE, desc "virtual IDE disk"
-name "ES1370", bus PCI, desc "ENSONIQ AudioPCI ES1370"
-name "ioh3420", bus PCI, desc "Intel IOH device id 3420 PCIE Root Port"
-name "sga", bus ISA, desc "Serial Graphics Adapter"
-name "scsi-block", bus SCSI, desc "SCSI block device passthrough"
-name "usb-serial", bus usb-bus
-name "pc-sysfw", bus System, desc "PC System Firmware"
-name "usb-mouse", bus usb-bus
-name "usb-net", bus usb-bus
-name "usb-hub", bus usb-bus
-name "ccid-card-emulated", bus ccid-bus, desc "emulated smartcard"
-name "ne2k_isa", bus ISA
-name "pci-assign", bus PCI
-name "scsi-generic", bus SCSI, desc "pass through generic scsi device (/dev/sg*)"
-name "pcnet", bus PCI
-name "lsi53c895a", bus PCI, alias "lsi"
-name "scsi-disk", bus SCSI, desc "virtual SCSI disk or CD-ROM (legacy)"
-name "hda-micro", bus HDA, desc "HDA Audio Codec, duplex (speaker, microphone)"
-name "pci-ohci", bus PCI, desc "Apple USB Controller"
-name "nec-usb-xhci", bus PCI
-name "xio3130-downstream", bus PCI, desc "TI X3130 Downstream Port of PCI Express Switch"
-name "virtserialport", bus virtio-serial-bus
-name "usb-redir", bus usb-bus
-name "usb-braille", bus usb-bus
-name "scsi-cd", bus SCSI, desc "virtual SCSI CD-ROM"
-name "usb-wacom-tablet", bus usb-bus, desc "QEMU PenPartner Tablet"
-name "isa-serial", bus ISA
-name "i82550", bus PCI, desc "Intel i82550 Ethernet"
-name "i82551", bus PCI, desc "Intel i82551 Ethernet"
-name "isa-debugcon", bus ISA
-name "ide-cd", bus IDE, desc "virtual IDE CD-ROM"
-name "SUNW,fdtwo", bus System
-name "ich9-usb-uhci2", bus PCI
-name "ich9-usb-uhci3", bus PCI
-name "ich9-usb-uhci1", bus PCI
-name "isa-parallel", bus ISA
-name "virtconsole", bus virtio-serial-bus
-name "ne2k_pci", bus PCI
-name "virtio-serial-pci", bus PCI, alias "virtio-serial"
-name "hda-duplex", bus HDA, desc "HDA Audio Codec, duplex (line-out, line-in)"
-name "intel-hda", bus PCI, desc "Intel HD Audio Controller"
-name "megasas", bus PCI, desc "LSI MegaRAID SAS 1078"
-name "i82559er", bus PCI, desc "Intel i82559ER Ethernet"
-name "hda-output", bus HDA, desc "HDA Audio Codec, output-only (line-out)"
-name "i82562", bus PCI, desc "Intel i82562 Ethernet"
-name "sysbus-ahci", bus System
-name "usb-ccid", bus usb-bus, desc "CCID Rev 1.1 smartcard reader"
-name "ivshmem", bus PCI
-name "AC97", bus PCI, desc "Intel 82801AA AC97 Audio"
-name "e1000", bus PCI, desc "Intel Gigabit Ethernet"
-name "sysbus-fdc", bus System
-name "usb-bt-dongle", bus usb-bus
-name "usb-tablet", bus usb-bus
-name "isa-vga", bus ISA
-name "usb-kbd", bus usb-bus
-name "isa-applesmc", bus ISA
-name "rtl8139", bus PCI
-name "qxl", bus PCI, desc "Spice QXL GPU (secondary)"
-name "i82557a", bus PCI, desc "Intel i82557A Ethernet"
-name "i82557c", bus PCI, desc "Intel i82557C Ethernet"
-name "usb-audio", bus usb-bus
-name "ib700", bus ISA
-name "piix3-usb-uhci", bus PCI
-name "i82557b", bus PCI, desc "Intel i82557B Ethernet"
-name "piix4-usb-uhci", bus PCI
-name "ccid-card-passthru", bus ccid-bus, desc "passthrough smartcard"
-name "i82801", bus PCI, desc "Intel i82801 Ethernet"
-name "smbus-eeprom", bus i2c-bus
-name "vmware-svga", bus PCI
-name "dc390", bus PCI, desc "Tekram DC-390 SCSI adapter"
-name "isa-cirrus-vga", bus ISA
-name "sb16", bus ISA, desc "Creative Sound Blaster 16"
-name "am53c974", bus PCI, desc "AMD Am53c974 PCscsi-PCI SCSI adapter"
-name "pci-bridge", bus PCI, desc "Standard PCI Bridge"
-name "i82558a", bus PCI, desc "Intel i82558A Ethernet"
-name "i82558b", bus PCI, desc "Intel i82558B Ethernet"
-name "virtio-net-pci", bus PCI, alias "virtio-net"
-name "virtio-balloon-pci", bus PCI, alias "virtio-balloon"
-name "ich9-usb-ehci1", bus PCI
-name "isa-ide", bus ISA
-name "usb-host", bus usb-bus
-name "ich9-ahci", bus PCI, alias "ahci"
-name "vt82c686b-usb-uhci", bus PCI
-name "usb-ehci", bus PCI
-name "testdev", bus ISA
-name "i6300esb", bus PCI
-name "virtio-scsi-pci", bus PCI
-pci-assign.host=pci-host-devaddr
-pci-assign.prefer_msi=on/off
-pci-assign.share_intx=on/off
-pci-assign.bootindex=int32
-pci-assign.configfd=string
-pci-assign.addr=pci-devfn
-pci-assign.romfile=string
-pci-assign.rombar=uint32
-pci-assign.multifunction=on/off
-pci-assign.command_serr_enable=on/off
-virtio-blk-pci.class=hex32
-virtio-blk-pci.drive=drive
-virtio-blk-pci.logical_block_size=blocksize
-virtio-blk-pci.physical_block_size=blocksize
-virtio-blk-pci.min_io_size=uint16
-virtio-blk-pci.opt_io_size=uint32
-virtio-blk-pci.bootindex=int32
-virtio-blk-pci.discard_granularity=uint32
-virtio-blk-pci.cyls=uint32
-virtio-blk-pci.heads=uint32
-virtio-blk-pci.secs=uint32
-virtio-blk-pci.serial=string
-virtio-blk-pci.scsi=on/off
-virtio-blk-pci.config-wce=on/off
-virtio-blk-pci.ioeventfd=on/off
-virtio-blk-pci.vectors=uint32
-virtio-blk-pci.indirect_desc=on/off
-virtio-blk-pci.event_idx=on/off
-virtio-blk-pci.config-wce=on/off
-virtio-blk-pci.addr=pci-devfn
-virtio-blk-pci.romfile=string
-virtio-blk-pci.rombar=uint32
-virtio-blk-pci.multifunction=on/off
-virtio-blk-pci.command_serr_enable=on/off
-virtio-net-pci.ioeventfd=on/off
-virtio-net-pci.vectors=uint32
-virtio-net-pci.indirect_desc=on/off
-virtio-net-pci.event_idx=on/off
-virtio-net-pci.csum=on/off
-virtio-net-pci.guest_csum=on/off
-virtio-net-pci.gso=on/off
-virtio-net-pci.guest_tso4=on/off
-virtio-net-pci.guest_tso6=on/off
-virtio-net-pci.guest_ecn=on/off
-virtio-net-pci.guest_ufo=on/off
-virtio-net-pci.host_tso4=on/off
-virtio-net-pci.host_tso6=on/off
-virtio-net-pci.host_ecn=on/off
-virtio-net-pci.host_ufo=on/off
-virtio-net-pci.mrg_rxbuf=on/off
-virtio-net-pci.status=on/off
-virtio-net-pci.ctrl_vq=on/off
-virtio-net-pci.ctrl_rx=on/off
-virtio-net-pci.ctrl_vlan=on/off
-virtio-net-pci.ctrl_rx_extra=on/off
-virtio-net-pci.mac=macaddr
-virtio-net-pci.vlan=vlan
-virtio-net-pci.netdev=netdev
-virtio-net-pci.bootindex=int32
-virtio-net-pci.x-txtimer=uint32
-virtio-net-pci.x-txburst=int32
-virtio-net-pci.tx=string
-virtio-net-pci.addr=pci-devfn
-virtio-net-pci.romfile=string
-virtio-net-pci.rombar=uint32
-virtio-net-pci.multifunction=on/off
-virtio-net-pci.command_serr_enable=on/off
-scsi-disk.drive=drive
-scsi-disk.logical_block_size=blocksize
-scsi-disk.physical_block_size=blocksize
-scsi-disk.min_io_size=uint16
-scsi-disk.opt_io_size=uint32
-scsi-disk.bootindex=int32
-scsi-disk.discard_granularity=uint32
-scsi-disk.ver=string
-scsi-disk.serial=string
-scsi-disk.vendor=string
-scsi-disk.product=string
-scsi-disk.removable=on/off
-scsi-disk.dpofua=on/off
-scsi-disk.wwn=hex64
-scsi-disk.channel=uint32
-scsi-disk.scsi-id=uint32
-scsi-disk.lun=uint32
-PIIX4_PM.smb_io_base=uint32
-PIIX4_PM.disable_s3=uint8
-PIIX4_PM.disable_s4=uint8
-PIIX4_PM.s4_val=uint8
-PIIX4_PM.addr=pci-devfn
-PIIX4_PM.romfile=string
-PIIX4_PM.rombar=uint32
-PIIX4_PM.multifunction=on/off
-PIIX4_PM.command_serr_enable=on/off
-usb-redir.chardev=chr
-usb-redir.debug=uint8
-usb-redir.filter=string
-usb-redir.bootindex=int32
-usb-redir.port=string
-usb-redir.full-path=on/off
-ide-drive.drive=drive
-ide-drive.logical_block_size=blocksize
-ide-drive.physical_block_size=blocksize
-ide-drive.min_io_size=uint16
-ide-drive.opt_io_size=uint32
-ide-drive.bootindex=int32
-ide-drive.discard_granularity=uint32
-ide-drive.ver=string
-ide-drive.wwn=hex64
-ide-drive.serial=string
-ide-drive.model=string
-ide-drive.unit=uint32
-usb-host.hostbus=uint32
-usb-host.hostaddr=uint32
-usb-host.hostport=string
-usb-host.vendorid=hex32
-usb-host.productid=hex32
-usb-host.isobufs=uint32
-usb-host.bootindex=int32
-usb-host.pipeline=on/off
-usb-host.port=string
-usb-host.full-path=on/off
-scsi-generic.drive=drive
-scsi-generic.bootindex=int32
-scsi-generic.channel=uint32
-scsi-generic.scsi-id=uint32
-scsi-generic.lun=uint32
-usb-storage.drive=drive
-usb-storage.logical_block_size=blocksize
-usb-storage.physical_block_size=blocksize
-usb-storage.min_io_size=uint16
-usb-storage.opt_io_size=uint32
-usb-storage.bootindex=int32
-usb-storage.discard_granularity=uint32
-usb-storage.serial=string
-usb-storage.removable=on/off
-usb-storage.port=string
-usb-storage.full-path=on/off
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 7e62a50..0c68367 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -19,6 +19,7 @@ struct testInfo {
unsigned int version;
bool is_kvm;
unsigned int kvm_version;
+ int error;
};
static void printMismatchedFlags(virQEMUCapsPtr got,
@@ -58,8 +59,11 @@ static int testHelpStrParsing(const void *data)
goto cleanup;
if (virQEMUCapsParseHelpStr("QEMU", help, flags,
- &version, &is_kvm, &kvm_version, false) == -1)
+ &version, &is_kvm, &kvm_version, false) == -1) {
+ if (info->error && virGetLastError()->code == info->error)
+ ret = 0;
goto cleanup;
+ }
# ifndef WITH_YAJL
if (virQEMUCapsGet(info->flags, QEMU_CAPS_MONITOR_JSON))
@@ -132,10 +136,10 @@ mymain(void)
{
int ret = 0;
-# define DO_TEST(name, version, is_kvm, kvm_version, ...) \
+# define DO_TEST_FULL(name, version, is_kvm, kvm_version, error, ...) \
do { \
struct testInfo info = { \
- name, NULL, version, is_kvm, kvm_version \
+ name, NULL, version, is_kvm, kvm_version, error \
}; \
if (!(info.flags = virQEMUCapsNew())) \
return EXIT_FAILURE; \
@@ -146,6 +150,9 @@ mymain(void)
virObjectUnref(info.flags); \
} while (0)
+# define DO_TEST(name, version, is_kvm, kvm_version, ...) \
+ DO_TEST_FULL(name, version, is_kvm, kvm_version, VIR_ERR_OK, __VA_ARGS__)
+
DO_TEST("qemu-0.9.1", 9001, 0, 0,
QEMU_CAPS_KQEMU,
QEMU_CAPS_VNC_COLON,
@@ -849,235 +856,10 @@ mymain(void)
QEMU_CAPS_OBJECT_USB_AUDIO,
QEMU_CAPS_SPLASH_TIMEOUT,
QEMU_CAPS_DEVICE_IVSHMEM);
- DO_TEST("qemu-1.2.0", 1002000, 0, 0,
- QEMU_CAPS_VNC_COLON,
- QEMU_CAPS_NO_REBOOT,
- QEMU_CAPS_DRIVE,
- QEMU_CAPS_NAME,
- QEMU_CAPS_UUID,
- QEMU_CAPS_MIGRATE_QEMU_TCP,
- QEMU_CAPS_MIGRATE_QEMU_EXEC,
- QEMU_CAPS_DRIVE_CACHE_V2,
- QEMU_CAPS_DRIVE_CACHE_UNSAFE,
- QEMU_CAPS_DRIVE_FORMAT,
- QEMU_CAPS_DRIVE_SERIAL,
- QEMU_CAPS_XEN_DOMID,
- QEMU_CAPS_DRIVE_READONLY,
- QEMU_CAPS_VGA,
- QEMU_CAPS_0_10,
- QEMU_CAPS_MEM_PATH,
- QEMU_CAPS_SDL,
- QEMU_CAPS_MIGRATE_QEMU_UNIX,
- QEMU_CAPS_CHARDEV,
- QEMU_CAPS_ENABLE_KVM,
- QEMU_CAPS_MONITOR_JSON,
- QEMU_CAPS_BALLOON,
- QEMU_CAPS_DEVICE,
- QEMU_CAPS_SMP_TOPOLOGY,
- QEMU_CAPS_NETDEV,
- QEMU_CAPS_RTC,
- QEMU_CAPS_VHOST_NET,
- QEMU_CAPS_NO_HPET,
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_BOOT_MENU,
- QEMU_CAPS_FSDEV,
- QEMU_CAPS_NAME_PROCESS,
- QEMU_CAPS_SMBIOS_TYPE,
- QEMU_CAPS_VGA_QXL,
- QEMU_CAPS_SPICE,
- QEMU_CAPS_VGA_NONE,
- QEMU_CAPS_MIGRATE_QEMU_FD,
- QEMU_CAPS_BOOTINDEX,
- QEMU_CAPS_HDA_DUPLEX,
- QEMU_CAPS_DRIVE_AIO,
- QEMU_CAPS_CCID_EMULATED,
- QEMU_CAPS_CCID_PASSTHRU,
- QEMU_CAPS_CHARDEV_SPICEVMC,
- QEMU_CAPS_VIRTIO_TX_ALG,
- QEMU_CAPS_DEVICE_QXL_VGA,
- QEMU_CAPS_PCI_MULTIFUNCTION,
- QEMU_CAPS_VIRTIO_IOEVENTFD,
- QEMU_CAPS_SGA,
- QEMU_CAPS_VIRTIO_BLK_EVENT_IDX,
- QEMU_CAPS_VIRTIO_NET_EVENT_IDX,
- QEMU_CAPS_DRIVE_CACHE_DIRECTSYNC,
- QEMU_CAPS_PIIX3_USB_UHCI,
- QEMU_CAPS_PIIX4_USB_UHCI,
- QEMU_CAPS_USB_EHCI,
- QEMU_CAPS_ICH9_USB_EHCI1,
- QEMU_CAPS_VT82C686B_USB_UHCI,
- QEMU_CAPS_PCI_OHCI,
- QEMU_CAPS_USB_REDIR,
- QEMU_CAPS_USB_HUB,
- QEMU_CAPS_NO_SHUTDOWN,
- QEMU_CAPS_PCI_ROMBAR,
- QEMU_CAPS_ICH9_AHCI,
- QEMU_CAPS_NO_ACPI,
- QEMU_CAPS_FSDEV_READONLY,
- QEMU_CAPS_VIRTIO_BLK_SCSI,
- QEMU_CAPS_VIRTIO_BLK_SG_IO,
- QEMU_CAPS_DRIVE_COPY_ON_READ,
- QEMU_CAPS_CPU_HOST,
- QEMU_CAPS_FSDEV_WRITEOUT,
- QEMU_CAPS_DRIVE_IOTUNE,
- QEMU_CAPS_SCSI_DISK_CHANNEL,
- QEMU_CAPS_SCSI_BLOCK,
- QEMU_CAPS_SCSI_CD,
- QEMU_CAPS_IDE_CD,
- QEMU_CAPS_NO_USER_CONFIG,
- QEMU_CAPS_HDA_MICRO,
- QEMU_CAPS_NEC_USB_XHCI,
- QEMU_CAPS_NETDEV_BRIDGE,
- QEMU_CAPS_SCSI_LSI,
- QEMU_CAPS_VIRTIO_SCSI,
- QEMU_CAPS_BLOCKIO,
- QEMU_CAPS_DISABLE_S3,
- QEMU_CAPS_DISABLE_S4,
- QEMU_CAPS_USB_REDIR_FILTER,
- QEMU_CAPS_IDE_DRIVE_WWN,
- QEMU_CAPS_SCSI_DISK_WWN,
- QEMU_CAPS_SECCOMP_SANDBOX,
- QEMU_CAPS_DUMP_GUEST_CORE,
- QEMU_CAPS_VNC,
- QEMU_CAPS_MACHINE_OPT,
- QEMU_CAPS_USB_REDIR_BOOTINDEX,
- QEMU_CAPS_USB_HOST_BOOTINDEX,
- QEMU_CAPS_DEVICE_QXL,
- QEMU_CAPS_DEVICE_VGA,
- QEMU_CAPS_DEVICE_CIRRUS_VGA,
- QEMU_CAPS_DEVICE_VMWARE_SVGA,
- QEMU_CAPS_DEVICE_USB_SERIAL,
- QEMU_CAPS_DEVICE_USB_NET,
- QEMU_CAPS_DTB,
- QEMU_CAPS_SCSI_MEGASAS,
- QEMU_CAPS_IPV6_MIGRATION,
- QEMU_CAPS_DEVICE_PCI_BRIDGE,
- QEMU_CAPS_DEVICE_SCSI_GENERIC,
- QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX,
- QEMU_CAPS_VNC_SHARE_POLICY,
- QEMU_CAPS_DEVICE_USB_STORAGE,
- QEMU_CAPS_DEVICE_USB_KBD,
- QEMU_CAPS_USB_STORAGE_REMOVABLE,
- QEMU_CAPS_OBJECT_USB_AUDIO,
- QEMU_CAPS_SPLASH_TIMEOUT,
- QEMU_CAPS_DEVICE_IVSHMEM);
- DO_TEST("qemu-kvm-1.2.0", 1002000, 1, 0,
- QEMU_CAPS_VNC_COLON,
- QEMU_CAPS_NO_REBOOT,
- QEMU_CAPS_DRIVE,
- QEMU_CAPS_NAME,
- QEMU_CAPS_UUID,
- QEMU_CAPS_VNET_HDR,
- QEMU_CAPS_MIGRATE_QEMU_TCP,
- QEMU_CAPS_MIGRATE_QEMU_EXEC,
- QEMU_CAPS_DRIVE_CACHE_V2,
- QEMU_CAPS_KVM,
- QEMU_CAPS_DRIVE_CACHE_UNSAFE,
- QEMU_CAPS_DRIVE_FORMAT,
- QEMU_CAPS_DRIVE_SERIAL,
- QEMU_CAPS_XEN_DOMID,
- QEMU_CAPS_DRIVE_READONLY,
- QEMU_CAPS_VGA,
- QEMU_CAPS_0_10,
- QEMU_CAPS_MEM_PATH,
- QEMU_CAPS_SDL,
- QEMU_CAPS_MIGRATE_QEMU_UNIX,
- QEMU_CAPS_CHARDEV,
- QEMU_CAPS_ENABLE_KVM,
- QEMU_CAPS_MONITOR_JSON,
- QEMU_CAPS_BALLOON,
- QEMU_CAPS_DEVICE,
- QEMU_CAPS_SMP_TOPOLOGY,
- QEMU_CAPS_NETDEV,
- QEMU_CAPS_RTC,
- QEMU_CAPS_VHOST_NET,
- QEMU_CAPS_NO_HPET,
- QEMU_CAPS_NO_KVM_PIT,
- QEMU_CAPS_PCI_CONFIGFD,
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_BOOT_MENU,
- QEMU_CAPS_FSDEV,
- QEMU_CAPS_NAME_PROCESS,
- QEMU_CAPS_SMBIOS_TYPE,
- QEMU_CAPS_VGA_QXL,
- QEMU_CAPS_SPICE,
- QEMU_CAPS_VGA_NONE,
- QEMU_CAPS_MIGRATE_QEMU_FD,
- QEMU_CAPS_BOOTINDEX,
- QEMU_CAPS_HDA_DUPLEX,
- QEMU_CAPS_DRIVE_AIO,
- QEMU_CAPS_PCI_BOOTINDEX,
- QEMU_CAPS_CCID_EMULATED,
- QEMU_CAPS_CCID_PASSTHRU,
- QEMU_CAPS_CHARDEV_SPICEVMC,
- QEMU_CAPS_VIRTIO_TX_ALG,
- QEMU_CAPS_DEVICE_QXL_VGA,
- QEMU_CAPS_PCI_MULTIFUNCTION,
- QEMU_CAPS_VIRTIO_IOEVENTFD,
- QEMU_CAPS_SGA,
- QEMU_CAPS_VIRTIO_BLK_EVENT_IDX,
- QEMU_CAPS_VIRTIO_NET_EVENT_IDX,
- QEMU_CAPS_DRIVE_CACHE_DIRECTSYNC,
- QEMU_CAPS_PIIX3_USB_UHCI,
- QEMU_CAPS_PIIX4_USB_UHCI,
- QEMU_CAPS_USB_EHCI,
- QEMU_CAPS_ICH9_USB_EHCI1,
- QEMU_CAPS_VT82C686B_USB_UHCI,
- QEMU_CAPS_PCI_OHCI,
- QEMU_CAPS_USB_REDIR,
- QEMU_CAPS_USB_HUB,
- QEMU_CAPS_NO_SHUTDOWN,
- QEMU_CAPS_PCI_ROMBAR,
- QEMU_CAPS_ICH9_AHCI,
- QEMU_CAPS_NO_ACPI,
- QEMU_CAPS_FSDEV_READONLY,
- QEMU_CAPS_VIRTIO_BLK_SCSI,
- QEMU_CAPS_VIRTIO_BLK_SG_IO,
- QEMU_CAPS_DRIVE_COPY_ON_READ,
- QEMU_CAPS_CPU_HOST,
- QEMU_CAPS_FSDEV_WRITEOUT,
- QEMU_CAPS_DRIVE_IOTUNE,
- QEMU_CAPS_SCSI_DISK_CHANNEL,
- QEMU_CAPS_SCSI_BLOCK,
- QEMU_CAPS_SCSI_CD,
- QEMU_CAPS_IDE_CD,
- QEMU_CAPS_NO_USER_CONFIG,
- QEMU_CAPS_HDA_MICRO,
- QEMU_CAPS_NEC_USB_XHCI,
- QEMU_CAPS_NETDEV_BRIDGE,
- QEMU_CAPS_SCSI_LSI,
- QEMU_CAPS_VIRTIO_SCSI,
- QEMU_CAPS_BLOCKIO,
- QEMU_CAPS_DISABLE_S3,
- QEMU_CAPS_DISABLE_S4,
- QEMU_CAPS_USB_REDIR_FILTER,
- QEMU_CAPS_IDE_DRIVE_WWN,
- QEMU_CAPS_SCSI_DISK_WWN,
- QEMU_CAPS_SECCOMP_SANDBOX,
- QEMU_CAPS_DUMP_GUEST_CORE,
- QEMU_CAPS_VNC,
- QEMU_CAPS_MACHINE_OPT,
- QEMU_CAPS_USB_REDIR_BOOTINDEX,
- QEMU_CAPS_USB_HOST_BOOTINDEX,
- QEMU_CAPS_DEVICE_QXL,
- QEMU_CAPS_DEVICE_VGA,
- QEMU_CAPS_DEVICE_CIRRUS_VGA,
- QEMU_CAPS_DEVICE_VMWARE_SVGA,
- QEMU_CAPS_DEVICE_USB_SERIAL,
- QEMU_CAPS_DEVICE_USB_NET,
- QEMU_CAPS_DTB,
- QEMU_CAPS_SCSI_MEGASAS,
- QEMU_CAPS_IPV6_MIGRATION,
- QEMU_CAPS_DEVICE_PCI_BRIDGE,
- QEMU_CAPS_DEVICE_SCSI_GENERIC,
- QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX,
- QEMU_CAPS_VNC_SHARE_POLICY,
- QEMU_CAPS_DEVICE_USB_STORAGE,
- QEMU_CAPS_DEVICE_USB_KBD,
- QEMU_CAPS_USB_STORAGE_REMOVABLE,
- QEMU_CAPS_OBJECT_USB_AUDIO,
- QEMU_CAPS_SPLASH_TIMEOUT,
- QEMU_CAPS_DEVICE_IVSHMEM);
+ DO_TEST_FULL("qemu-1.2.0", 1002000, 0, 0, VIR_ERR_CONFIG_UNSUPPORTED,
+ QEMU_CAPS_LAST);
+ DO_TEST_FULL("qemu-kvm-1.2.0", 1002000, 1, 0, VIR_ERR_CONFIG_UNSUPPORTED,
+ QEMU_CAPS_LAST);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
2.1.3
10 years
[libvirt] [PATCH v2] qemu: add port check for host when disk type is network
by Shanzhi Yu
For network type disk, host port is not checked when start a guest,
so the error may be unclear when with invalid port. If pass -1 to port
the error will be
error: Failed to start domain rh6-i
error: An error occurred, but the cause is unknown
So make a check to make sure the port range from 0 to 65536
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1163553
Signed-off-by: Shanzhi Yu <shyu(a)redhat.com>
---
src/qemu/qemu_command.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f674ba9..66082e1 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3016,6 +3016,18 @@ qemuBuildNetworkDriveURI(int protocol,
case VIR_STORAGE_NET_PROTOCOL_FTPS:
case VIR_STORAGE_NET_PROTOCOL_TFTP:
case VIR_STORAGE_NET_PROTOCOL_ISCSI:
+ if (VIR_ALLOC(uri) < 0)
+ goto cleanup;
+
+ if (qemuNetworkDriveGetPort(protocol, hosts->port) < 0 ||
+ qemuNetworkDriveGetPort(protocol, hosts->port) > 65536) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("port should be in range 0 to 65536 for '%s' host"),
+ virStorageNetProtocolTypeToString(protocol));
+
+ goto cleanup;
+ }
+
case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
if (nhosts != 1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
--
1.9.3
10 years
[libvirt] [nova] - 'nova reboot' causes console-log truncated
by Surojit Pathak
Hi all,
[Issue observed]
If we issue 'nova reboot <server>', we get to have the console output of
the latest bootup of the server only. The console output of the previous
boot for the same server vanishes due to truncation[1]. If we do reboot
from within the VM instance [ #sudo reboot ], or reboot the instance
with 'virsh reboot <instance>' the behavior is not the same, where the
console.log keeps increasing, with the new output being appended.
This loss of history makes some debugging scenario difficult due to lack
of information being available.
Please point me to any solution/blueprint for this issue, if already
planned. Otherwise, please comment on my analysis and proposals as
solution, below -
[Analysis]
Nova's libvirt driver on compute node tries to do a graceful restart of
the server instance, by attempting a soft_reboot first. If soft_reboot
fails, it attempts a hard_reboot. As part of soft_reboot, it brings down
the instance by calling shutdown(), and then calls createWithFlags() to
bring this up. Because of this, qemu-kvm process for the instance gets
terminated and new process is launched. In QEMU, the chardev file is
opened with O_TRUNC, and thus we lose the previous content of the
console.log file.
On the other-hand, during 'virsh reboot <instance>', the same qemu-kvm
process continues, and libvirt actually does a
qemuDomainSetFakeReboot(). Thus the same file continues capturing the
new console output as a continuation into the same file.
[Proposals for solution]
1. NOVA, driven by certain configuration, will backup the console file,
before creating the domain, during reboot scenario. viz. doing a backup
of console.log as console.log.0. How many such backups of log-file to
keep, what can be the maximum size of the file, 'logrotate` to be used
or not - all these can come to NOVA as configuration parameter.
Pros - As NOVA libvirt driver is not using libvirt's reboot()
functionality knowingly, this problem can be better addressed from the
same layer.
Cons - NOVA's libvirt layer building awareness of the console files
is not clean from modularity.
2. virDomainCreateWithFlags() will have a new flag value to indicate
logs to be appended instead of truncated, if FILE option is used. This
config will be passed to QEMU, while spawning the process.
- Changes will be not in OpenStack Code, but in libvirt and QEMU.
Cons - We may have to do the similar implementation for all the
drivers of libvirt.
Pros - This feature's use-case is there in case of 'virsh shutdown
<instance>', followed by a 'virsh start <instance>' too.
Regards,
*Suro
*
Surojit Pathak
*
*Refs -
[1] Snippet
# tail -f
/opt/stack/data/nova/instances/cea9a3d9-f833-4ded-90b8-c85b7da3f758/console.log
...
[ OK ] Started udev Coldplug all Devices.
[ OK ] Started Create static device nodes in /dev.
Starting udev Kernel Device Manager...
[ 36.938075] EXT4-fs (vda1): re-mounted. Opts: (null)
[ OK ] Started Remount Root and Kernel File Systems.
Starting Load/Save Random Seed...
[ OK ] Reached target Local File Systems (Pre).
Starting Configure read-only root support...
[ OK ] Started Load/Save Random Seed.
*tail:
/opt/stack/data/nova/instances/cea9a3d9-f833-4ded-90b8-c85b7da3f758/console.log:
file truncated*
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.11.10-301.fc20.x86_64
(mockbuild(a)bkernel01.phx2.fedoraproject.org) (gcc version 4.8.2 20131017
(Red Hat 4.8.2-1) (GCC) ) #1 SMP Thu Dec 5 14:01:17 UTC 2013
[ 0.000000] Command line: ro
root=UUID=314b4a27-3885-49e8-9415-af098db4fd2a no_timer_check
console=tty1 console=ttyS0,115200n8
initrd=/boot/initramfs-3.11.10-301.fc20.x86_64.img
BOOT_IMAGE=/boot/vmlinuz-3.11.10-301.fc20.x86_64
....
10 years
[libvirt] [PATCH] qemu: Don't try to parse -help for new QEMU
by Jiri Denemark
Since QEMU 1.2.0, we switched to QMP probing instead of parsing -help
(and other commands, such as -cpu ?) output. However, if QMP probing
failed, we still tried starting QEMU with various options and parsing
the output, which was guaranteed to fail because the output changed.
Let's just refuse parsing -help for QEMU >= 1.2.0.
https://bugzilla.redhat.com/show_bug.cgi?id=1160318
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 74a3b24..bef96d5 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1384,6 +1384,16 @@ int virQEMUCapsParseHelpStr(const char *qemu,
*version = (major * 1000 * 1000) + (minor * 1000) + micro;
+ /* Refuse to parse -help output for QEMU releases >= 1.2.0 that should be
+ * using QMP probing.
+ */
+ if (*version > 1002000) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("QEMU %u.%u.%u is too new for help parsing"),
+ major, minor, micro);
+ goto cleanup;
+ }
+
if (virQEMUCapsComputeCmdFlags(help, *version, *is_kvm, *kvm_version,
qemuCaps, check_yajl) < 0)
goto cleanup;
--
2.1.3
10 years
[libvirt] [PATCH] qemu: Always set migration capabilities
by Jiri Denemark
We used to set migration capabilities only when a user asked for them in
flags. This is fine when migration succeeds since the QEMU process is
killed in the end but in case migration fails or if it's cancelled, some
capabilities may remain turned on with no way to turn them off. To fix
that, migration capabilities have to be turned on if requested but
explicitly turned off in case they were not requested but QEMU supports
them.
https://bugzilla.redhat.com/show_bug.cgi?id=1160997
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_migration.c | 42 +++++++++++++++++++++++++++++-------------
src/qemu/qemu_monitor.c | 5 +++--
src/qemu/qemu_monitor.h | 3 ++-
src/qemu/qemu_monitor_json.c | 5 +++--
src/qemu/qemu_monitor_json.h | 3 ++-
tests/qemumonitorjsontest.c | 3 ++-
6 files changed, 41 insertions(+), 20 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index c797206..ff692a5 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1804,6 +1804,7 @@ qemuMigrationSetOffline(virQEMUDriverPtr driver,
static int
qemuMigrationSetCompression(virQEMUDriverPtr driver,
virDomainObjPtr vm,
+ bool state,
qemuDomainAsyncJob job)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -1818,6 +1819,9 @@ qemuMigrationSetCompression(virQEMUDriverPtr driver,
if (ret < 0) {
goto cleanup;
+ } else if (ret == 0 && !state) {
+ /* Unsupported but we want it off anyway */
+ goto cleanup;
} else if (ret == 0) {
if (job == QEMU_ASYNC_JOB_MIGRATION_IN) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
@@ -1834,7 +1838,8 @@ qemuMigrationSetCompression(virQEMUDriverPtr driver,
ret = qemuMonitorSetMigrationCapability(
priv->mon,
- QEMU_MONITOR_MIGRATION_CAPS_XBZRLE);
+ QEMU_MONITOR_MIGRATION_CAPS_XBZRLE,
+ state);
cleanup:
qemuDomainObjExitMonitor(driver, vm);
@@ -1844,6 +1849,7 @@ qemuMigrationSetCompression(virQEMUDriverPtr driver,
static int
qemuMigrationSetAutoConverge(virQEMUDriverPtr driver,
virDomainObjPtr vm,
+ bool state,
qemuDomainAsyncJob job)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -1858,6 +1864,9 @@ qemuMigrationSetAutoConverge(virQEMUDriverPtr driver,
if (ret < 0) {
goto cleanup;
+ } else if (ret == 0 && !state) {
+ /* Unsupported but we want it off anyway */
+ goto cleanup;
} else if (ret == 0) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("Auto-Converge is not supported by "
@@ -1868,7 +1877,8 @@ qemuMigrationSetAutoConverge(virQEMUDriverPtr driver,
ret = qemuMonitorSetMigrationCapability(
priv->mon,
- QEMU_MONITOR_MIGRATION_CAPS_AUTO_CONVERGE);
+ QEMU_MONITOR_MIGRATION_CAPS_AUTO_CONVERGE,
+ state);
cleanup:
qemuDomainObjExitMonitor(driver, vm);
@@ -1879,6 +1889,7 @@ qemuMigrationSetAutoConverge(virQEMUDriverPtr driver,
static int
qemuMigrationSetPinAll(virQEMUDriverPtr driver,
virDomainObjPtr vm,
+ bool state,
qemuDomainAsyncJob job)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -1893,6 +1904,9 @@ qemuMigrationSetPinAll(virQEMUDriverPtr driver,
if (ret < 0) {
goto cleanup;
+ } else if (ret == 0 && !state) {
+ /* Unsupported but we want it off anyway */
+ goto cleanup;
} else if (ret == 0) {
if (job == QEMU_ASYNC_JOB_MIGRATION_IN) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
@@ -1909,7 +1923,8 @@ qemuMigrationSetPinAll(virQEMUDriverPtr driver,
ret = qemuMonitorSetMigrationCapability(
priv->mon,
- QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL);
+ QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL,
+ state);
cleanup:
qemuDomainObjExitMonitor(driver, vm);
@@ -2734,8 +2749,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
dataFD[1] = -1; /* 'st' owns the FD now & will close it */
}
- if (flags & VIR_MIGRATE_COMPRESSED &&
- qemuMigrationSetCompression(driver, vm,
+ if (qemuMigrationSetCompression(driver, vm,
+ flags & VIR_MIGRATE_COMPRESSED,
QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
goto stop;
@@ -2744,8 +2759,9 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
goto stop;
}
- if (flags & VIR_MIGRATE_RDMA_PIN_ALL &&
- qemuMigrationSetPinAll(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
+ if (qemuMigrationSetPinAll(driver, vm,
+ flags & VIR_MIGRATE_RDMA_PIN_ALL,
+ QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
goto stop;
if (mig->lockState) {
@@ -3568,18 +3584,18 @@ qemuMigrationRun(virQEMUDriverPtr driver,
goto cleanup;
}
- if (flags & VIR_MIGRATE_COMPRESSED &&
- qemuMigrationSetCompression(driver, vm,
+ if (qemuMigrationSetCompression(driver, vm,
+ flags & VIR_MIGRATE_COMPRESSED,
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
goto cleanup;
- if (flags & VIR_MIGRATE_AUTO_CONVERGE &&
- qemuMigrationSetAutoConverge(driver, vm,
+ if (qemuMigrationSetAutoConverge(driver, vm,
+ flags & VIR_MIGRATE_AUTO_CONVERGE,
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
goto cleanup;
- if (flags & VIR_MIGRATE_RDMA_PIN_ALL &&
- qemuMigrationSetPinAll(driver, vm,
+ if (qemuMigrationSetPinAll(driver, vm,
+ flags & VIR_MIGRATE_RDMA_PIN_ALL,
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
goto cleanup;
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 36ef4e1..d06ef28 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3928,7 +3928,8 @@ int qemuMonitorGetMigrationCapability(qemuMonitorPtr mon,
}
int qemuMonitorSetMigrationCapability(qemuMonitorPtr mon,
- qemuMonitorMigrationCaps capability)
+ qemuMonitorMigrationCaps capability,
+ bool state)
{
VIR_DEBUG("mon=%p capability=%d", mon, capability);
@@ -3944,7 +3945,7 @@ int qemuMonitorSetMigrationCapability(qemuMonitorPtr mon,
return -1;
}
- return qemuMonitorJSONSetMigrationCapability(mon, capability);
+ return qemuMonitorJSONSetMigrationCapability(mon, capability, state);
}
int qemuMonitorNBDServerStart(qemuMonitorPtr mon,
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 750b3dc..862386a 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -506,7 +506,8 @@ int qemuMonitorGetMigrationCapabilities(qemuMonitorPtr mon,
int qemuMonitorGetMigrationCapability(qemuMonitorPtr mon,
qemuMonitorMigrationCaps capability);
int qemuMonitorSetMigrationCapability(qemuMonitorPtr mon,
- qemuMonitorMigrationCaps capability);
+ qemuMonitorMigrationCaps capability,
+ bool state);
typedef enum {
QEMU_MONITOR_MIGRATE_BACKGROUND = 1 << 0,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 7870664..bc0bf56 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5557,7 +5557,8 @@ qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
int
qemuMonitorJSONSetMigrationCapability(qemuMonitorPtr mon,
- qemuMonitorMigrationCaps capability)
+ qemuMonitorMigrationCaps capability,
+ bool state)
{
int ret = -1;
@@ -5577,7 +5578,7 @@ qemuMonitorJSONSetMigrationCapability(qemuMonitorPtr mon,
qemuMonitorMigrationCapsTypeToString(capability)) < 0)
goto cleanup;
- if (virJSONValueObjectAppendBoolean(cap, "state", 1) < 0)
+ if (virJSONValueObjectAppendBoolean(cap, "state", state) < 0)
goto cleanup;
if (virJSONValueArrayAppend(caps, cap) < 0)
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 6cdaf18..0beadc9 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -142,7 +142,8 @@ int qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
int qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
qemuMonitorMigrationCaps capability);
int qemuMonitorJSONSetMigrationCapability(qemuMonitorPtr mon,
- qemuMonitorMigrationCaps capability);
+ qemuMonitorMigrationCaps capability,
+ bool state);
int qemuMonitorJSONMigrate(qemuMonitorPtr mon,
unsigned int flags,
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index b8177c0..efed06b 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1939,7 +1939,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapability(const void *data)
}
if (qemuMonitorJSONSetMigrationCapability(qemuMonitorTestGetMonitor(test),
- QEMU_MONITOR_MIGRATION_CAPS_XBZRLE) < 0)
+ QEMU_MONITOR_MIGRATION_CAPS_XBZRLE,
+ true) < 0)
goto cleanup;
ret = 0;
--
2.1.3
10 years
[libvirt] [libvirt-glib PATCH 0/2] Fix build failures caused byt macro sync
by Martin Kletzander
*BLURB*
Martin Kletzander (2):
Properly mark unused parameters
Revert back deleted glib-specific warning options
libvirt-gobject/libvirt-gobject-connection.c | 2 +-
libvirt-gobject/libvirt-gobject-domain-snapshot.c | 4 ++--
libvirt-gobject/libvirt-gobject-domain.c | 2 +-
libvirt-gobject/libvirt-gobject-storage-vol.c | 4 ++--
m4/virt-compile-warnings.m4 | 11 +++++++++++
tests/test-events.c | 8 ++++----
6 files changed, 21 insertions(+), 10 deletions(-)
--
2.1.3
10 years
[libvirt] [PATCH] lxc: fix setmem effect on a running LXC machine
by Erik Skultety
When user calls setmem on a running LXC machine, we do update its cgroup
entry (which is in odds with the original bug report, possibly resolved
by later versions), however we neither update domain's runtime XML nor
we update our internal structures and this patch fixes it.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1131919
---
src/lxc/lxc_driver.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index b3e506f..03a00a9 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -749,6 +749,10 @@ static int lxcDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
"%s", _("Failed to set memory for domain"));
goto cleanup;
}
+
+ vm->def->mem.cur_balloon = newmem;
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
+ goto cleanup;
}
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
--
1.9.3
10 years