[libvirt] [PATCH v2 0/6] tests: qemuxml2xml: add DO_TEST_CAPS*
by Cole Robinson
v1: https://www.redhat.com/archives/libvir-list/2019-April/msg00083.html
v2 changes:
- Push first series prep work
- Split last patch into multiple pieces
- Add genid* conversion to demonstrate -active and -inactive names
- Address Andrea's review comments
Cole Robinson (6):
tests: qemuxml2xml: Set name in testQemuInfo
tests: qemuxml2xml: Add DO_TEST_CAPS*
tests: qemuxml2xml: Convert virtio-*transitional to TEST_CAPS
tests: qemuxml2xml: Convert os-firmware* to TEST_CAPS
tests: qemuxml2xml: Convert genid* to TEST_CAPS
tests: qemuxml2xml: Convert aarch64-os-firmware-efi to TEST_CAPS
...aarch64-os-firmware-efi.aarch64-latest.xml | 31 ++++
.../aarch64-os-firmware-efi.xml | 1 -
...ive.xml => genid-active.x86_64-latest.xml} | 2 +-
...ml => genid-auto-active.x86_64-latest.xml} | 2 +-
... => genid-auto-inactive.x86_64-latest.xml} | 2 +-
...e.xml => genid-inactive.x86_64-latest.xml} | 2 +-
.../os-firmware-bios.x86_64-latest.xml | 68 +++++++++
tests/qemuxml2xmloutdata/os-firmware-bios.xml | 1 -
.../os-firmware-efi-secboot.x86_64-latest.xml | 68 +++++++++
.../os-firmware-efi-secboot.xml | 1 -
.../os-firmware-efi.x86_64-latest.xml | 68 +++++++++
tests/qemuxml2xmloutdata/os-firmware-efi.xml | 1 -
...virtio-non-transitional.x86_64-latest.xml} | 0
... => virtio-transitional.x86_64-latest.xml} | 0
tests/qemuxml2xmltest.c | 132 ++++++++----------
15 files changed, 299 insertions(+), 80 deletions(-)
create mode 100644 tests/qemuxml2xmloutdata/aarch64-os-firmware-efi.aarch64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/aarch64-os-firmware-efi.xml
rename tests/qemuxml2xmloutdata/{genid-active.xml => genid-active.x86_64-latest.xml} (94%)
rename tests/qemuxml2xmloutdata/{genid-auto-active.xml => genid-auto-active.x86_64-latest.xml} (94%)
rename tests/qemuxml2xmloutdata/{genid-auto-inactive.xml => genid-auto-inactive.x86_64-latest.xml} (94%)
rename tests/qemuxml2xmloutdata/{genid-inactive.xml => genid-inactive.x86_64-latest.xml} (94%)
create mode 100644 tests/qemuxml2xmloutdata/os-firmware-bios.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/os-firmware-bios.xml
create mode 100644 tests/qemuxml2xmloutdata/os-firmware-efi-secboot.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/os-firmware-efi-secboot.xml
create mode 100644 tests/qemuxml2xmloutdata/os-firmware-efi.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/os-firmware-efi.xml
rename tests/qemuxml2xmloutdata/{virtio-non-transitional.xml => virtio-non-transitional.x86_64-latest.xml} (100%)
rename tests/qemuxml2xmloutdata/{virtio-transitional.xml => virtio-transitional.x86_64-latest.xml} (100%)
--
2.21.0
5 years, 7 months
[libvirt] [PATCH v3] libvirt-domain.c: Convert to virErrorRestore/virErrorPreserveLast
by Syed Humaid
Replaced all virSaveLastError and virSetError/virFreeError usages to
virErrorPreserveLast and virErrorRestore respectively.
Signed-off-by: Syed Humaid <syedhumaidbinharoon(a)gmail.com>
---
src/libvirt-domain.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index baf21824fe..80284a99f0 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -2894,7 +2894,7 @@ virDomainMigrateVersion2(virDomainPtr domain,
_("domainMigratePrepare2 did not set uri"));
cancelled = 1;
/* Make sure Finish doesn't overwrite the error */
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
goto finish;
}
if (uri_out)
@@ -2909,7 +2909,7 @@ virDomainMigrateVersion2(virDomainPtr domain,
/* Perform failed. Make sure Finish doesn't overwrite the error */
if (ret < 0)
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
/* If Perform returns < 0, then we need to cancel the VM
* startup on the destination
@@ -2929,10 +2929,7 @@ virDomainMigrateVersion2(virDomainPtr domain,
VIR_ERROR(_("finish step ignored that migration was cancelled"));
done:
- if (orig_err) {
- virSetError(orig_err);
- virFreeError(orig_err);
- }
+ virErrorRestore(&orig_err);
VIR_FREE(uri_out);
VIR_FREE(cookie);
return ddomain;
@@ -3076,7 +3073,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
/* Begin already started a migration job so we need to cancel it by
* calling Confirm while making sure it doesn't overwrite the error
*/
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
goto confirm;
} else {
goto done;
@@ -3091,7 +3088,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
VIR_MIGRATE_PARAM_URI,
uri_out) < 0) {
cancelled = 1;
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
goto finish;
}
} else if (!uri &&
@@ -3100,7 +3097,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare3 did not set uri"));
cancelled = 1;
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
goto finish;
}
@@ -3136,7 +3133,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
/* Perform failed. Make sure Finish doesn't overwrite the error */
if (ret < 0) {
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
/* Perform failed so we don't need to call confirm to let source know
* about the failure.
*/
@@ -3222,7 +3219,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
* one we need to preserve it in case confirm3 overwrites
*/
if (!orig_err)
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
confirm:
/*
@@ -3256,10 +3253,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
}
done:
- if (orig_err) {
- virSetError(orig_err);
- virFreeError(orig_err);
- }
+ virErrorRestore(&orig_err);
VIR_FREE(dom_xml);
VIR_FREE(uri_out);
VIR_FREE(cookiein);
--
2.20.1
5 years, 7 months
[libvirt] [PATCH 0/5] snapshot XML parse cleanups (incremental backup saga)
by Eric Blake
During my checkpoint series, one of the review comments complained
that setting the <creationTime> element during XML parsing to the
current time is non-deterministic, which in turn makes writing
testsuite additions difficult. The recommendation was to split out the
non-deterministic defaults to a post-parse handler. Of course, since
checkpoints copied from snapshots, I first need to fix snapshots to do
the same, hence this series.
Eric Blake (5):
snapshot: Refactor snapshotxml2xml test
snapshot: Don't expose testsuite-only state in snapshot XML
snapshot: Factor out post-parse code
snapshot: Allow for post-parse override
snapshot: Use post-parse instead of regex in testsuite
src/conf/domain_conf.h | 9 +
src/conf/moment_conf.h | 2 +
docs/schemas/domainsnapshot.rng | 1 -
src/conf/domain_conf.c | 24 +++
src/conf/moment_conf.c | 19 ++
src/conf/snapshot_conf.c | 22 +--
src/libvirt_private.syms | 1 +
.../disk_driver_name_null.xml | 1 +
.../disk_snapshot.xml | 1 +
tests/domainsnapshotxml2xmlout/empty.xml | 1 -
.../domainsnapshotxml2xmlout/external_vm.xml | 1 +
.../name_and_description.xml | 1 -
tests/domainsnapshotxml2xmlout/noparent.xml | 2 +-
tests/domainsnapshotxml2xmltest.c | 170 +++++++-----------
14 files changed, 137 insertions(+), 118 deletions(-)
--
2.20.1
5 years, 7 months
[libvirt] [PATCH 0/4] tests: Introduce and use TEST_QEMU_CAPS_PATH
by Andrea Bolognani
Reduce repetition by replacing reutterances with reusable references.
Andrea Bolognani (4):
tests: Make TEST_QEMU_CAPS_PATH public
tests: Drop dirname argument from testQemuGetLatestCapsForArch()
tests: Drop dirname argument from testQemuCapsIterate()
tests: Use TEST_QEMU_CAPS_PATH wherever possible
tests/domaincapstest.c | 4 ++--
tests/qemuargv2xmltest.c | 2 +-
tests/qemublocktest.c | 3 +--
tests/qemucapabilitiestest.c | 4 ++--
tests/qemucaps2xmltest.c | 4 ++--
tests/testutilsqemu.c | 25 ++++++++++---------------
tests/testutilsqemu.h | 8 ++++----
tests/testutilsqemuschema.c | 3 +--
8 files changed, 23 insertions(+), 30 deletions(-)
--
2.20.1
5 years, 7 months
[libvirt] [ANNOUNCE] virtio-fs v0.2 host<->guest file system released
by Stefan Hajnoczi
Dear QEMU, KVM, and libvirt communities,
virtio-fs is a shared file system that lets virtual machines access a
directory tree on the host. Unlike existing approaches, it is designed
to offer local file system semantics and performance. The guest can
take advantage of Linux DAX to access file contents directly from the
host page cache, eliminating the need to copy data into guest memory.
We hope virtio-fs will become widely available and easily accessible
through libvirt, Kata Containers, and popular management tools.
For more information, visit https://virtio-fs.gitlab.io/.
Mailing list: https://www.redhat.com/mailman/listinfo/virtio-fs
IRC: #virtio-fs on chat.freenode.net
The v0.2 release incorporates stabilization, performance, and sandboxing
improvements that now make virtio-fs suitable for testing and
performance evaluation.
Please do not rely on virtio-fs for production data yet. Consider it
experimental.
Guides are available for:
* Manually running QEMU with virtio-fs
https://virtio-fs.gitlab.io/howto-qemu.html
* Booting from virtio-fs (no disk images!)
https://virtio-fs.gitlab.io/howto-boot.html
* Running Kata Containers with virtio-fs
https://virtio-fs.gitlab.io/howto-kata.html
Stefan
5 years, 7 months
[libvirt] [PATCH for v5.3.0 00/17] Fix and enable owner remembering
by Michal Privoznik
The basic owner remembering is already merged but was turned off because
there were some issues. Well, this is my first attempt to fix those and
then enable the feature. Yay!
Michal Prívozník (17):
tools: Slightly rework libvirt_recover_xattrs.sh
virSecuritySELinuxRestoreAllLabel: Print @migrated in the debug
message too
virfile: Make virFileGetXAttr report errors
virFileSetXAttr: Report error on failure
virFileRemoveXAttr: Report error on failure
security: Don't skip label restore on file systems lacking XATTRs
security: Document @restore member of transaction list
security_dac: Allow caller to suppress owner remembering
security_selinux: Allow caller to suppress owner remembering
security: Remember owner only for top level image
security: Introduce virSecurityManagerMoveImageMetadata
security_util: Introduce virSecurityMoveRememberedLabel
security_dac: Implement virSecurityManagerMoveImageMetadata
security_selinux: Implement virSecurityManagerMoveImageMetadata
qemu_security: Implement qemuSecurityMoveImageMetadata
qemu: Move image security metadata on snapshot activity
Revert "qemu: Temporary disable owner remembering"
docs/news.xml | 21 +++
src/libvirt_private.syms | 2 +
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 5 +
src/qemu/qemu_blockjob.c | 6 +
src/qemu/qemu_conf.c | 4 +
src/qemu/qemu_driver.c | 17 +-
src/qemu/qemu_security.c | 19 +++
src/qemu/qemu_security.h | 5 +
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/security/security_dac.c | 149 +++++++++++++----
src/security/security_driver.h | 5 +
src/security/security_manager.c | 39 +++++
src/security/security_manager.h | 4 +
src/security/security_nop.c | 10 ++
src/security/security_selinux.c | 249 ++++++++++++++++++++---------
src/security/security_stack.c | 20 +++
src/security/security_util.c | 85 +++++++++-
src/security/security_util.h | 5 +
src/util/virfile.c | 78 +++++++--
src/util/virfile.h | 5 +
tests/qemusecuritymock.c | 6 +-
tools/libvirt_recover_xattrs.sh | 49 +++---
23 files changed, 626 insertions(+), 159 deletions(-)
--
2.19.2
5 years, 7 months
[libvirt] [PATCH] util: hash: Append to hash buckets when adding new entries
by Peter Krempa
In cases when the hash function for a name collides with other entry
already in the hash we prepend to the bucket. This creates a 'stack
effect' on the buckets if we then iterate through the hash. Normally
this is not a problem, but in tests we want deterministic results.
Since it does not matter where we add the entry and it's usually more
probable that a different entry will be accessed next change it to
append to the end of the bucket. Luckily we already iterate throught the
bucket once thus we can easily find the last entry and just connect the
new entry after it.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/util/virhash.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/util/virhash.c b/src/util/virhash.c
index 4907c1124f..0e30106041 100644
--- a/src/util/virhash.c
+++ b/src/util/virhash.c
@@ -316,6 +316,7 @@ virHashAddOrUpdateEntry(virHashTablePtr table, const void *name,
{
size_t key, len = 0;
virHashEntryPtr entry;
+ virHashEntryPtr last = NULL;
void *new_name;
if ((table == NULL) || (name == NULL))
@@ -337,6 +338,7 @@ virHashAddOrUpdateEntry(virHashTablePtr table, const void *name,
return -1;
}
}
+ last = entry;
len++;
}
@@ -347,8 +349,11 @@ virHashAddOrUpdateEntry(virHashTablePtr table, const void *name,
entry->name = new_name;
entry->payload = userdata;
- entry->next = table->table[key];
- table->table[key] = entry;
+
+ if (last)
+ last->next = entry;
+ else
+ table->table[key] = entry;
table->nbElems++;
--
2.20.1
5 years, 7 months
[libvirt] Virtual machine
by Armando Chamusse
My Ubuntu16.04.5 server is installed qemo-kvm and libvirt-manager but virt-manager is not starting. consequently when I install vncserver the keyboard does not work on the virtual machine.
But in ubuntu 14.04 it works perfectly.
can my help ??
ERRO when try run : virt-manager
Could not connect: Connection refused
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
(virt-manager:7676): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
5 years, 7 months
[libvirt] [PATCH v2 0/6] Add support for setting the emulator scheduler parameters
by Martin Kletzander
I/O threads and vCPU threads already support setting schedulers, but until now
it was impossible to do so for the main QEMU thread (emulator thread in the
libvirt naming). This is, however, requested for some very specific scenarios,
for example when vCPU threads are running at such priority that could starve the
main thread.
v2:
- news.xml addition in a separate patch
Martin Kletzander (6):
conf: Parse common scheduler attributes in separate function
conf: Format thread IDs optionally
docs: Mention iothreadsched element in the docs and reword
conf: Add support for emulatorsched
qemu: Add support for emulatorsched
docs: Add emulatorsched support to news.xml
docs/formatdomain.html.in | 25 +++--
docs/news.xml | 12 +++
docs/schemas/domaincommon.rng | 5 +
src/conf/domain_conf.c | 136 +++++++++++++++++-------
src/conf/domain_conf.h | 1 +
src/qemu/qemu_process.c | 2 +-
tests/genericxml2xmlindata/cputune.xml | 37 +++++++
tests/genericxml2xmloutdata/cputune.xml | 40 +++++++
tests/genericxml2xmltest.c | 2 +
9 files changed, 212 insertions(+), 48 deletions(-)
create mode 100644 tests/genericxml2xmlindata/cputune.xml
create mode 100644 tests/genericxml2xmloutdata/cputune.xml
--
2.21.0
5 years, 7 months