[libvirt] [PATCH v4 0/5] Add support for migration event
by Jiri Denemark
The final version of migration event patches which got accepted upstream
had to be slightly modified -- the event is only emitted when "events"
migration capability is turned on (default is off). Thus a new patch had
to be added to libvirt. I'm resending all migration event patches for
context even though they haven't changed at all since they were ACKed.
Jiri Denemark (5):
qemu_monitor: Wire up MIGRATION event
qemu: Enable migration events on QMP monitor
qemuDomainGetJobStatsInternal: Support migration events
qemu: Update migration state according to MIGRATION event
qemu: Wait for migration events on domain condition
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_domain.h | 3 ++
src/qemu/qemu_driver.c | 27 ++++++++++++---
src/qemu/qemu_migration.c | 59 +++++++++++++++++++++++++++-----
src/qemu/qemu_monitor.c | 16 ++++++++-
src/qemu/qemu_monitor.h | 9 +++++
src/qemu/qemu_monitor_json.c | 23 +++++++++++++
src/qemu/qemu_process.c | 80 +++++++++++++++++++++++++++++++++++++-------
9 files changed, 195 insertions(+), 25 deletions(-)
--
2.4.5
9 years, 4 months
[libvirt] [java] [PATCH 0/6] Fix JNA wrapping, fix memory leaks and wrap security model / label function
by Claudio Bley
Hi.
First and foremost, this series fixes a few mistakes in the wrapping
code found by inspecting the org.libvirt.jna.Libvirt interface and the
corresponding C types of the XML API file.
The last two patches add two missing functions introduced in libvirt
0.6.1.
At the end of the day, this means libvirt-java has gained full
coverage of the libvirt functions up to and including version
0.8.5. Yay!
Claudio Bley (6):
JNA: fix wrong return type void vs. int
JNA: add CString class and fix memory leaks
JNA: simplify freeing memory for C strings
Use the CString class for Arrays of CStrings too
Implement Domain.getSecurityLabel and add SecurityLabel class
Implement Connect.getSecurityModel and add SecurityModel class
src/main/java/org/libvirt/Connect.java | 74 +++++++++--------
src/main/java/org/libvirt/Device.java | 9 +-
src/main/java/org/libvirt/Domain.java | 57 ++++++-------
src/main/java/org/libvirt/DomainSnapshot.java | 8 +-
src/main/java/org/libvirt/Interface.java | 7 +-
src/main/java/org/libvirt/Library.java | 44 +++-------
src/main/java/org/libvirt/Network.java | 14 +---
src/main/java/org/libvirt/NetworkFilter.java | 2 +-
src/main/java/org/libvirt/Secret.java | 2 +-
src/main/java/org/libvirt/SecurityLabel.java | 49 +++++++++++
src/main/java/org/libvirt/SecurityModel.java | 37 +++++++++
src/main/java/org/libvirt/StoragePool.java | 9 +-
src/main/java/org/libvirt/StorageVol.java | 16 +---
src/main/java/org/libvirt/jna/CString.java | 85 +++++++++++++++++++
src/main/java/org/libvirt/jna/Libvirt.java | 114 +++++++++++++++++---------
15 files changed, 343 insertions(+), 184 deletions(-)
create mode 100644 src/main/java/org/libvirt/SecurityLabel.java
create mode 100644 src/main/java/org/libvirt/SecurityModel.java
create mode 100644 src/main/java/org/libvirt/jna/CString.java
--
2.2.2
9 years, 4 months
[libvirt] [PATCH v2 0/4] fix ejecting removable media and some cleanup
by Pavel Hrdina
Pavel Hrdina (4):
virCondWaitUntil: add another return value
virDomainObjSignal: drop this function
monitor: detect that eject fails because the tray is locked
qemu_hotplug: try harder to eject media
src/conf/domain_conf.c | 27 ++++++++--------
src/conf/domain_conf.h | 1 -
src/libvirt_private.syms | 1 -
src/qemu/qemu_hotplug.c | 73 +++++++++++++++++++++-----------------------
src/qemu/qemu_monitor_json.c | 14 +++++++++
src/qemu/qemu_monitor_text.c | 10 ++++++
src/qemu/qemu_process.c | 6 ++--
7 files changed, 77 insertions(+), 55 deletions(-)
--
2.4.4
9 years, 4 months
[libvirt] [PATCH 0/7] Simplify qemuMigrationFinish
by Jiri Denemark
While hacking qemuMigrationFinish I found it pretty hard to follow and
revealed few bugs (patches 3 to 5) in the code.
Jiri Denemark (7):
qemu: Split qemuMigrationFinish
qemu: Simplify qemuMigrationFinish
qemu: Don't fail migration on save status failure
qemu: Kill domain when migration finish fails
qemu: Don't report false errors in migration protocol v2
qemuDomainEventQueue: Check if event is non-NULL
qemu: Queue events in migration Finish phase ASAP
src/qemu/qemu_blockjob.c | 6 +-
src/qemu/qemu_cgroup.c | 3 +-
src/qemu/qemu_domain.c | 6 +-
src/qemu/qemu_driver.c | 87 +++++++-------------
src/qemu/qemu_hotplug.c | 26 +++---
src/qemu/qemu_migration.c | 199 ++++++++++++++++++++++------------------------
src/qemu/qemu_process.c | 72 ++++++-----------
7 files changed, 167 insertions(+), 232 deletions(-)
--
2.4.5
9 years, 4 months
[libvirt] [PATCH] storage: Revert volume obj list updating after volume creation (4749d82a)
by Erik Skultety
This patch reverts commit 4749d82a which tried to tweak the logic in
volume creation. We did realloc and update our object list before we executed
volume building within a specific storage backend. If that failed, we
had to update (again) our object list to the original state as it was before the
build and delete the volume from the pool (even though it didn't exist - this
truly depends on the backend).
I misunderstood the base idea to be able to poll the status of the volume
creation using vol-info. After commit 4749d82a this wasn't possible
anymore, although no BZ has been reported yet.
Commit 4749d82a also claimed to fix
https://bugzilla.redhat.com/show_bug.cgi?id=1223177, but commit c8be606b of the
same series as 4749d82ad (which was more of a refactor than a fix)
fixes the same issue so the revert should be pretty straightforward.
Further more, BZ https://bugzilla.redhat.com/show_bug.cgi?id=1241454 can be
fixed with this revert.
---
src/storage/storage_driver.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index d3cdbc5..b67a5d8 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1803,6 +1803,9 @@ storageVolCreateXML(virStoragePoolPtr obj,
goto cleanup;
}
+ if (VIR_REALLOC_N(pool->volumes.objs,
+ pool->volumes.count+1) < 0)
+ goto cleanup;
if (!backend->createVol) {
virReportError(VIR_ERR_NO_SUPPORT,
@@ -1817,6 +1820,14 @@ storageVolCreateXML(virStoragePoolPtr obj,
if (backend->createVol(obj->conn, pool, voldef) < 0)
goto cleanup;
+ pool->volumes.objs[pool->volumes.count++] = voldef;
+ volobj = virGetStorageVol(obj->conn, pool->def->name, voldef->name,
+ voldef->key, NULL, NULL);
+ if (!volobj) {
+ pool->volumes.count--;
+ goto cleanup;
+ }
+
if (VIR_ALLOC(buildvoldef) < 0) {
voldef = NULL;
goto cleanup;
@@ -1845,18 +1856,15 @@ storageVolCreateXML(virStoragePoolPtr obj,
voldef->building = false;
pool->asyncjobs--;
- if (buildret < 0)
+ if (buildret < 0) {
+ VIR_FREE(buildvoldef);
+ storageVolDeleteInternal(volobj, backend, pool, voldef,
+ 0, false);
+ voldef = NULL;
goto cleanup;
- }
-
- if (VIR_REALLOC_N(pool->volumes.objs,
- pool->volumes.count+1) < 0)
- goto cleanup;
+ }
- pool->volumes.objs[pool->volumes.count++] = voldef;
- if (!(volobj = virGetStorageVol(obj->conn, pool->def->name, voldef->name,
- voldef->key, NULL, NULL)))
- goto cleanup;
+ }
if (backend->refreshVol &&
backend->refreshVol(obj->conn, pool, voldef) < 0)
--
1.9.3
9 years, 4 months
[libvirt] shall libvirtd validate guest's name ?
by zhang bo
linux-ZyvZnF:~ # virsh list --all
Id Name State
----------------------------------------------------
- redhat7;reboot shut off
- oscar-vm-5 shut off
As shown above,
1 we use command "virsh define a.xml" to define a guest with a name containing ';', that's 'redhat7;reboot'
2 then we start the guest: "virsh start redhat7;reboot"
3 shell consider the command as
a) run "virsh start redhat7", failed
b) run "reboot", to reboot the host
And *the host get rebooted*.
shall libvirtd do the guest-name-validation work? Or other suggustions?
--
Oscar
oscar.zhangbo(a)huawei.com
9 years, 4 months
[libvirt] [PATCH v4 0/3] Allow PCI virtio on ARM "virt" machine
by Pavel Fedin
Virt machine in qemu since v2.3.0 has PCI generic host controller, and can use
PCI devices. This provides performance improvement as well as vhost-net with
irqfd support for virtio-net. However libvirt currently does not allow ARM virt
machine to have PCI devices. This patchset adds the necessary support.
Changes since v3:
- Capability is based not on qemu version but on support of "gpex-pcihost"
device by qemu
- Added a workaround, allowing to pass "make check". The problem is that
test suite does not build capabilities cache. Unfortunately this means
that correct unit-test for the new functionality currently cannot be
written. Test suite framework needs to be improved.
Changes since v2:
Complete rework, use different approach
- Correctly model PCI Express bus on the machine. It is now possible to
explicitly specify <address-type='pci'> with attributes. This allows to
attach not only virtio, but any other PCI device to the model.
- Default is not changed and still mmio, for backwards compatibility with
existing installations. PCI bus has to be explicitly specified.
- Check for the capability in correct place, in v2 it actually did not work
Changes since v1:
- Added capability based on qemu version number
- Recognize also "virt-" prefix
Pavel Fedin (3):
Introduce QEMU_CAPS_OBJECT_GPEX
Add PCI-Express root to ARM virt machine
Build correct command line for PCI NICs on ARM
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 3 ++-
src/qemu/qemu_domain.c | 17 +++++++++++++----
4 files changed, 18 insertions(+), 5 deletions(-)
--
1.9.5.msysgit.0
9 years, 4 months
[libvirt] [PATCH] conf: Don't allow duplicated targets regardless of bus
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1142631
Commit id 'e0e290552' added a check to determine if the same bus
had the same target value. It seems that's not quite good enough
as the check should check the target name value regardless of bus type.
Also added a DO_TEST_DIFFERENT to exhibit the issue
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/conf/domain_conf.c | 3 +-
.../qemuxml2argv-disk-same-targets.xml | 35 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 3 ++
3 files changed, 39 insertions(+), 2 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-same-targets.xml
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b10f6cd..7855bcb 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -12590,8 +12590,7 @@ virDomainDiskDefDstDuplicates(virDomainDefPtr def)
for (i = 1; i < def->ndisks; i++) {
for (j = 0; j < i; j++) {
- if (def->disks[i]->bus == def->disks[j]->bus &&
- STREQ(def->disks[i]->dst, def->disks[j]->dst)) {
+ if (STREQ(def->disks[i]->dst, def->disks[j]->dst)) {
virReportError(VIR_ERR_XML_ERROR,
_("target '%s' duplicated for disk sources "
"'%s' and '%s'"),
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-same-targets.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-same-targets.xml
new file mode 100644
index 0000000..3276ce5
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-same-targets.xml
@@ -0,0 +1,35 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <source file='/tmp/usbdisk.img'/>
+ <target dev='sda' bus='usb'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <source file='/tmp/idedisk.img'/>
+ <target dev='sda' bus='ide'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <source file='/tmp/scsidisk.img'/>
+ <target dev='sda' bus='scsi'/>
+ </disk>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index be82dd2..b066681 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -882,6 +882,9 @@ mymain(void)
QEMU_CAPS_DEVICE);
DO_TEST("disk-snapshot",
QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_CACHE_V2, QEMU_CAPS_DRIVE_FORMAT);
+ DO_TEST_FAILURE("disk-same-targets",
+ QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_SCSI_LSI,
+ QEMU_CAPS_DEVICE_USB_STORAGE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("event_idx",
QEMU_CAPS_DRIVE,
QEMU_CAPS_VIRTIO_BLK_EVENT_IDX,
--
2.1.0
9 years, 4 months
[libvirt] [PATCH v3 0/4] Followup for unpriv_sgio changes
by John Ferlan
v2:
http://www.redhat.com/archives/libvir-list/2015-July/msg00204.html
I pushed the first 3 patches already since they were ACK'd
This is patches 4-8 adjusted for code review comments
Patch1 (former patch4) - change the function to use qemuCheckUnprivSGIO
not qemuCheckUnprivSGIO. Also used a -1 or -2 return value for
handling the mismatched sgio setting error which requires the caller
to have a message including the device with the issue
Former patch 5 abandoned
Patch2 (former patch6) - completely removed qemuGetSharedHostdevKey and
replaced with inline code. Although this looks odd now, a future patch
will use the device name on the add side.
Patch3 (former patch7) - restored the {} in the right place
Patch4 (former patch8) - remove val initialization - already ACK'd, but
easier for me to just keep in the current order.
Former patches 9 & 10 - keeping separate for downstream
John Ferlan (4):
qemu: Refactor qemuCheckSharedDisk to create qemuCheckUnprivSGIO
qemu: Inline qemuGetHostdevPath
qemu: Refactor qemuSetUnprivSGIO return values
qemu: Fix integer/boolean logic in qemuSetUnprivSGIO
src/qemu/qemu_conf.c | 151 ++++++++++++++++++++++++++++++---------------------
1 file changed, 89 insertions(+), 62 deletions(-)
--
2.1.0
9 years, 4 months