[libvirt] [PATCH 00/20] 20 crazy IVSHMEM patches you won't believe compile
by Martin Kletzander
Let's see if the subject works if one is in need of reviews =)
Yet another qemu device, right? We even have an existing device for
that, right? That should be pretty straight-forward and easy, right?
Well, let's see... I, at least, tried splitting the patches for you
to be as easy to review as possible.
Just in case you're trying out the hot-(un)plug on an upstream QEMU,
make sure you do it on i440fx machine, not on q35 one, otherwise it
will not work nicely (or rather at all).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1347049
Martin Kletzander (20):
qemuhotplugtest: Only read result_filename if used
schema: Allow shmem to have alias
conf: Allow copying of shmem defs
conf: Add support for shmem model
conf: Add support for shmem role
qemu: Add support for shmem role
qemu: Add newer shmem models
qemu: Add capabilities for ivshmem-{plain,doorbell}
qemu: Save various defaults for shmem
qemu: Disable migration for shmem with peer role
qemu: Make qemuBuildShmemDevStr static
qemu: Rename qemuBuildShmemDevStr to qemuBuildShmemDevLegacyStr
qemu: Move common checks outside qemuBuildShmemDevLegacyStr
qemu: Reorder shmem params nicely
qemu: Abstract shmem socket path preparation
qemu: Rename qemuBuildShmemBackendStr to qemuBuildShmemBackendChrStr
qemu: Support newer ivshmem device variants
qemu: Add qemuAssignDeviceShmemAlias and use it
conf: Add some shmem helpers for future use
qemu: Add support for hot/cold-(un)plug of shmem devices
docs/formatdomain.html.in | 10 +-
docs/schemas/domaincommon.rng | 22 ++
src/conf/domain_conf.c | 154 ++++++++++++-
src/conf/domain_conf.h | 30 +++
src/libvirt_private.syms | 9 +
src/qemu/qemu_alias.c | 32 ++-
src/qemu/qemu_alias.h | 4 +
src/qemu/qemu_capabilities.c | 4 +
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 245 ++++++++++++++++----
src/qemu/qemu_command.h | 14 +-
src/qemu/qemu_domain.c | 46 ++++
src/qemu/qemu_domain.h | 3 +
src/qemu/qemu_driver.c | 39 +++-
src/qemu/qemu_hotplug.c | 247 ++++++++++++++++++++-
src/qemu/qemu_hotplug.h | 6 +
src/qemu/qemu_migration.c | 13 ++
.../caps_2.6.0-gicv2.aarch64.xml | 2 +
.../caps_2.6.0-gicv3.aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 2 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 2 +
tests/qemuhotplugtest.c | 23 +-
.../qemuhotplug-ivshmem-doorbell-detach.xml | 7 +
.../qemuhotplug-ivshmem-doorbell.xml | 4 +
.../qemuhotplug-ivshmem-plain-detach.xml | 6 +
.../qemuhotplug-ivshmem-plain.xml | 3 +
...muhotplug-base-live+ivshmem-doorbell-detach.xml | 1 +
.../qemuhotplug-base-live+ivshmem-doorbell.xml | 65 ++++++
.../qemuhotplug-base-live+ivshmem-plain-detach.xml | 1 +
.../qemuhotplug-base-live+ivshmem-plain.xml | 58 +++++
.../qemuxml2argv-shmem-plain-doorbell.args | 46 ++++
...m.xml => qemuxml2argv-shmem-plain-doorbell.xml} | 15 +-
tests/qemuxml2argvdata/qemuxml2argv-shmem.args | 16 +-
tests/qemuxml2argvdata/qemuxml2argv-shmem.xml | 6 +-
tests/qemuxml2argvtest.c | 3 +
...xml => qemuxml2xmlout-shmem-plain-doorbell.xml} | 24 +-
tests/qemuxml2xmloutdata/qemuxml2xmlout-shmem.xml | 15 +-
tests/qemuxml2xmltest.c | 2 +
39 files changed, 1092 insertions(+), 93 deletions(-)
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ivshmem-doorbell-detach.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ivshmem-doorbell.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ivshmem-plain-detach.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ivshmem-plain.xml
create mode 120000 tests/qemuhotplugtestdomains/qemuhotplug-base-live+ivshmem-doorbell-detach.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-live+ivshmem-doorbell.xml
create mode 120000 tests/qemuhotplugtestdomains/qemuhotplug-base-live+ivshmem-plain-detach.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-live+ivshmem-plain.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-shmem-plain-doorbell.args
copy tests/qemuxml2argvdata/{qemuxml2argv-shmem.xml => qemuxml2argv-shmem-plain-doorbell.xml} (78%)
copy tests/qemuxml2xmloutdata/{qemuxml2xmlout-shmem.xml => qemuxml2xmlout-shmem-plain-doorbell.xml} (78%)
--
2.10.0
8 years, 7 months
[libvirt] [PATCH] qemu-migration: Disallow migration of read only disk
by Corey S. McQuay
Currently Libvirt allows attempts to migrate read only disks. Qemu cannot handle this as read only
disks cannot be written to on the destination system. The end result is a cryptic error message
and a failed migration.
This patch causes migration to fail earlier and provides a meaningful error message stating that
migrating read only disks is not supported.
Signed-off-by: Corey S. McQuay <csmcquay(a)linux.vnet.ibm.com>
Reviewed-by: Jason J. Herne <jjherne(a)linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
---
src/qemu/qemu_migration.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index e451ef6..3311711 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2392,6 +2392,28 @@ qemuMigrationIsSafe(virDomainDefPtr def,
return true;
}
+static bool
+qemuMigrationAreAllDisksRW(virDomainDefPtr def,
+ size_t nmigrate_disks,
+ const char **migrate_disks)
+{
+ size_t i;
+
+ for (i = 0; i < def->ndisks; i++) {
+ virDomainDiskDefPtr disk = def->disks[i];
+
+ if (qemuMigrateDisk(disk, nmigrate_disks, migrate_disks) &&
+ disk->src->readonly) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("Cannot migrate read-only disk %s"),
+ disk->dst);
+ return false;
+ }
+ }
+
+ return true;
+}
+
/** qemuMigrationSetOffline
* Pause domain for non-live migration.
*/
@@ -3137,6 +3159,9 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver,
!qemuMigrationIsSafe(vm->def, nmigrate_disks, migrate_disks))
goto cleanup;
+ if (!qemuMigrationAreAllDisksRW(vm->def, nmigrate_disks, migrate_disks))
+ goto cleanup;
+
if (flags & VIR_MIGRATE_POSTCOPY &&
(!(flags & VIR_MIGRATE_LIVE) ||
flags & VIR_MIGRATE_PAUSED)) {
--
2.7.4
8 years, 7 months
[libvirt] [PATCH 1/2] libxl: add support for PVH
by Marek Marczykowski-Górecki
Since this is something between PV and HVM, it makes sense to put the
setting in place where domain type is specified.
To enable it, use <os><type machine="xenpvh">...</type></os>. It is
also included in capabilities.xml, for every supported HVM guest type - it
doesn't seems to be any other requirement (besides new enough Xen).
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
src/libxl/libxl_capabilities.c | 40 +++++++++++++++++++++++++++++++---------
src/libxl/libxl_conf.c | 2 ++
src/libxl/libxl_driver.c | 6 ++++--
3 files changed, 37 insertions(+), 11 deletions(-)
diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c
index 0145116..c443353 100644
--- a/src/libxl/libxl_capabilities.c
+++ b/src/libxl/libxl_capabilities.c
@@ -45,11 +45,16 @@ VIR_LOG_INIT("libxl.libxl_capabilities");
/* see xen-unstable.hg/xen/include/asm-x86/cpufeature.h */
#define LIBXL_X86_FEATURE_PAE_MASK 0x40
+enum machine_type {
+ machine_hvm,
+ machine_pvh,
+ machine_pv,
+};
struct guest_arch {
virArch arch;
int bits;
- int hvm;
+ enum machine_type machine;
int pae;
int nonpae;
int ia64_be;
@@ -296,7 +301,7 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
/* Search for existing matching (model,hvm) tuple */
for (i = 0; i < nr_guest_archs; i++) {
if ((guest_archs[i].arch == arch) &&
- guest_archs[i].hvm == hvm)
+ guest_archs[i].machine == (hvm ? machine_hvm : machine_pv))
break;
}
@@ -308,7 +313,7 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
nr_guest_archs++;
guest_archs[i].arch = arch;
- guest_archs[i].hvm = hvm;
+ guest_archs[i].machine = hvm ? machine_hvm : machine_pv;
/* Careful not to overwrite a previous positive
setting with a negative one here - some archs
@@ -320,23 +325,40 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
guest_archs[i].nonpae = nonpae;
if (ia64_be)
guest_archs[i].ia64_be = ia64_be;
+
+ /* On Xen >= 4.4 add PVH for each HVM guest, and do it only once */
+ if ((ver_info->xen_version_major > 4 ||
+ (ver_info->xen_version_major == 4 &&
+ ver_info->xen_version_minor >= 4)) &&
+ hvm && i == nr_guest_archs-1) {
+ i = nr_guest_archs;
+ /* Too many arch flavours - highly unlikely ! */
+ if (i >= ARRAY_CARDINALITY(guest_archs))
+ continue;
+ nr_guest_archs++;
+ guest_archs[i].arch = arch;
+ guest_archs[i].machine = machine_pvh;
+ }
}
}
regfree(®ex);
for (i = 0; i < nr_guest_archs; ++i) {
virCapsGuestPtr guest;
- char const *const xen_machines[] = {guest_archs[i].hvm ? "xenfv" : "xenpv"};
+ char const *const xen_machines[] = {
+ guest_archs[i].machine == machine_hvm ? "xenfv" :
+ (guest_archs[i].machine == machine_pvh ? "xenpvh" : "xenpv")};
virCapsGuestMachinePtr *machines;
if ((machines = virCapabilitiesAllocMachines(xen_machines, 1)) == NULL)
return -1;
if ((guest = virCapabilitiesAddGuest(caps,
- guest_archs[i].hvm ? VIR_DOMAIN_OSTYPE_HVM : VIR_DOMAIN_OSTYPE_XEN,
+ guest_archs[i].machine == machine_hvm ?
+ VIR_DOMAIN_OSTYPE_HVM : VIR_DOMAIN_OSTYPE_XEN,
guest_archs[i].arch,
LIBXL_EXECBIN_DIR "/qemu-system-i386",
- (guest_archs[i].hvm ?
+ (guest_archs[i].machine == machine_hvm ?
LIBXL_FIRMWARE_DIR "/hvmloader" :
NULL),
1,
@@ -375,7 +397,7 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
0) == NULL)
return -1;
- if (guest_archs[i].hvm) {
+ if (guest_archs[i].machine != machine_pv) {
if (virCapabilitiesAddGuestFeature(guest,
"acpi",
1,
@@ -390,7 +412,7 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
if (virCapabilitiesAddGuestFeature(guest,
"hap",
1,
- 1) == NULL)
+ guest_archs[i].machine == machine_hvm) == NULL)
return -1;
}
}
@@ -409,7 +431,7 @@ libxlMakeDomainOSCaps(const char *machine,
os->supported = true;
- if (STREQ(machine, "xenpv"))
+ if (STREQ(machine, "xenpv") || STREQ(machine, "xenpvh"))
return 0;
capsLoader->supported = true;
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 5202ca1..aa06586 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -173,6 +173,8 @@ libxlMakeDomCreateInfo(libxl_ctx *ctx,
}
} else {
c_info->type = LIBXL_DOMAIN_TYPE_PV;
+ if (STREQ(def->os.machine, "xenpvh"))
+ libxl_defbool_set(&c_info->pvh, true);
}
if (VIR_STRDUP(c_info->name, def->name) < 0)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 4957072..fa58346 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -6321,9 +6321,11 @@ libxlConnectGetDomainCapabilities(virConnectPtr conn,
emulatorbin = "/usr/bin/qemu-system-x86_64";
if (machine) {
- if (STRNEQ(machine, "xenpv") && STRNEQ(machine, "xenfv")) {
+ if (STRNEQ(machine, "xenpv") &&
+ STRNEQ(machine, "xenpvh") &&
+ STRNEQ(machine, "xenfv")) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("Xen only supports 'xenpv' and 'xenfv' machines"));
+ _("Xen only supports 'xenpv', 'xenpvh' and 'xenfv' machines"));
goto cleanup;
}
} else {
--
2.5.5
>From marmarek(a)invisiblethingslab.com Fri Aug 5 20:06:26 2016
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
To: libvir-list(a)redhat.com
Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek(a)invisiblethingslab.com>
Subject: [PATCH 2/2] libxl: set shadow memory for any guest type, not only HVM
Date: Fri, 5 Aug 2016 20:05:44 +0200
Message-Id: <1470420344-7693-2-git-send-email-marmarek(a)invisiblethingslab.com>
X-Mailer: git-send-email 2.5.5
In-Reply-To: <1470420344-7693-1-git-send-email-marmarek(a)invisiblethingslab.com>
References: <1470420344-7693-1-git-send-email-marmarek(a)invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Organization: Invisible Things Lab
Content-Transfer-Encoding: 8bit
Otherwise starting PVH guest will result in "arch_setup_bootlate:
mapping shared_info failed (pfn=..., rc=-1, errno: 12): Internal error".
After this change the behaviour is the same as in `xl`.
Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
src/libxl/libxl_conf.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index aa06586..155934c 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -494,11 +494,6 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
}
}
}
-
- /* Allow libxl to calculate shadow memory requirements */
- b_info->shadow_memkb =
- libxl_get_required_shadow_memory(b_info->max_memkb,
- b_info->max_vcpus);
} else {
/*
* For compatibility with the legacy xen toolstack, default to pygrub
@@ -528,6 +523,11 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
return -1;
}
+ /* Allow libxl to calculate shadow memory requirements */
+ b_info->shadow_memkb =
+ libxl_get_required_shadow_memory(b_info->max_memkb,
+ b_info->max_vcpus);
+
return 0;
}
--
2.5.5
8 years, 7 months
[libvirt] [PATCH 00/41] Enhance guest CPU configuration code
by Jiri Denemark
This patch series does several things:
- fixes tests to avoid relying on bugs in our code
- adds support for advertising supported CPU modes and models in domain
capabilities
- starts adding better and higher level APIs to our cpu driver (the old
low level APIs will be removed once this process is over)
- prepares qemu driver for asking QEMU what a host CPU looks like and
what CPU models can be run on it
- makes QEMU CPU command line builder build command line and nothing
else
The added part of domain capabilities XML looks like this:
<cpu>
<mode name='host-passthrough' supported='yes'/>
<mode name='host-model' supported='yes'>
<model fallback='allow'>Broadwell</model>
<vendor>Intel</vendor>
<feature policy='disable' name='aes'/>
<feature policy='require' name='vmx'/>
</mode>
<mode name='custom' supported='yes'>
<model>Broadwell</model>
<model>Broadwell-noTSX</model>
...
</mode>
</cpu>
and host-passthrough is only advertised as supported for KVM domains,
host-model is only supported when guest architecture is compatible with
host and overall it should just work the way one would expect (in
contrast to the current state of the code).
Big thanks for any comments and review in advance and...
Enjoy my PTO :-)
Jiri Denemark (41):
cpuGetModels: Switch to virArch
domcaps: Add support for listing supported CPU models
qemu: Use virDomainCapsCPUModels for cpuDefinitions
qemuxml2argvtest: Rename extraFlags as qemuCaps
qemuxml2argvtest: Rename "out" labels as "cleanup"
qemuxml2argvtest: Get rid of testCompareXMLToArgvHelper
qemuxml2argvtest: Reorder functions
qemuxml2argvtest: Update qemuCaps after parsing domain XML
qemuxml2argvtest: Properly initialize qemuCaps->arch
testutilsqemu: Helpers for changing host CPU and arch
qemu: Separate guest CPU validation from command line creation
qemuxml2argvtest: Properly setup CPU models in qemuCaps
qemuxml2argvtest: Set correct architecture for KVM guests
qemuxml2argvtest: Reorder CPU features
qemu: Introduce virQEMUCapsGuestIsNative
qemu: Fill in CPU domain capabilities
cpu: Special case models == NULL in cpuGetModels
cpu: Don't overwrite errors in cpuGetModels
domcaps: Show only CPU models supported by libvirt
domcaps: Add CPU usable flag
schema: Separate CPU related definitions into cputypes.rng
qemu: Propagate virCapsPtr to virQEMUCapsNewForBinaryInternal
conf: Introduce virCPUDefCopyWithoutModel
conf: Introduce virCPUDefMoveModel
conf: Introduce virCPUDefCopyModelFilter
qemu: Store host-model CPU in qemu capabilities
cpu: Drop false support for ARM cpu-model
Show host model in domain capabilities
qemu: Introduce virQEMUCapsGetHostModel
qemu: Introduce virQEMUCapsIsCPUModeSupported
cpu: Make x86ModelFromCPU easier to read
cpu: Make x86ModelFromCPU a bit smarter
cpu: Report error for unknown features in x86HasFeature
cpu: Add x86FeatureInData
cpu: Rework cpuUpdate
cpu: Set nfeatures_max correctly in x86Decode
cpu: Introduce virCPUTranslate
cpu: Rework cpuHasFeature
cpu: Rework cpuCompare* APIs
qemu: Update guest CPU def in live XML
Move CMT feature filtering to QEMU driver
docs/formatdomaincaps.html.in | 65 +++
docs/schemas/cputypes.rng | 135 ++++++
docs/schemas/domaincaps.rng | 60 +++
docs/schemas/domaincommon.rng | 129 +-----
po/POTFILES.in | 1 +
src/conf/cpu_conf.c | 64 ++-
src/conf/cpu_conf.h | 19 +
src/conf/domain_capabilities.c | 209 ++++++++++
src/conf/domain_capabilities.h | 47 +++
src/cpu/cpu.c | 247 ++++++++---
src/cpu/cpu.h | 72 +++-
src/cpu/cpu_arm.c | 79 ++--
src/cpu/cpu_ppc64.c | 48 ++-
src/cpu/cpu_s390.c | 1 -
src/cpu/cpu_x86.c | 463 +++++++++++++--------
src/driver-hypervisor.h | 2 +-
src/libvirt-host.c | 3 +-
src/libvirt_private.syms | 20 +-
src/qemu/qemu_capabilities.c | 387 ++++++++++++-----
src/qemu/qemu_capabilities.h | 24 +-
src/qemu/qemu_capspriv.h | 13 +-
src/qemu/qemu_command.c | 216 +++-------
src/qemu/qemu_domain.c | 32 +-
src/qemu/qemu_driver.c | 41 +-
src/qemu/qemu_monitor.c | 12 +-
src/qemu/qemu_monitor.h | 10 +-
src/qemu/qemu_monitor_json.c | 24 +-
src/qemu/qemu_monitor_json.h | 2 +-
src/qemu/qemu_parse_command.c | 2 +-
src/qemu/qemu_process.c | 95 ++++-
src/test/test_driver.c | 12 +-
src/vmware/vmware_conf.c | 6 +-
tests/cputest.c | 24 +-
.../cputestdata/x86-host+host-model-nofallback.xml | 2 +-
tests/cputestdata/x86-host+host-model.xml | 2 +-
.../x86-host+host-passthrough-features.xml | 4 +
tests/cputestdata/x86-host+host-passthrough.xml | 19 +-
tests/cputestdata/x86-host+min.xml | 27 +-
tests/cputestdata/x86-host+pentium3.xml | 39 +-
tests/cputestdata/x86-host-invtsc+host-model.xml | 2 +-
.../cputestdata/x86-host-passthrough-features.xml | 4 +
tests/domaincapsschemadata/basic.xml | 5 +
tests/domaincapsschemadata/full.xml | 12 +
tests/domaincapsschemadata/libxl-xenfv-usb.xml | 5 +
tests/domaincapsschemadata/libxl-xenfv.xml | 5 +
tests/domaincapsschemadata/libxl-xenpv-usb.xml | 5 +
tests/domaincapsschemadata/libxl-xenpv.xml | 5 +
tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml | 32 ++
.../qemu_2.6.0-gicv2-virt.aarch64.xml | 36 ++
.../qemu_2.6.0-gicv3-virt.aarch64.xml | 36 ++
tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 36 ++
tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml | 10 +
tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml | 36 ++
tests/domaincapstest.c | 78 +++-
tests/qemucapabilitiestest.c | 2 +-
tests/qemucapsprobe.c | 2 +-
tests/qemumonitorjsontest.c | 8 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-Haswell2.xml | 2 +-
.../qemuxml2argv-cpu-Haswell3.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml | 12 +-
.../qemuxml2argv-cpu-exact2-nofallback.args | 3 +-
.../qemuxml2argv-cpu-exact2-nofallback.xml | 14 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-exact2.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml | 14 +-
.../qemuxml2argv-cpu-fallback.args | 2 +-
.../qemuxml2argv-cpu-host-model-cmt.args | 2 +-
.../qemuxml2argv-cpu-host-model-fallback.args | 2 +-
.../qemuxml2argv-cpu-minimum2.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml | 6 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-strict1.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml | 20 +-
.../qemuxml2argv-graphics-spice-timeout.xml | 24 +-
.../qemuxml2argv-pseries-cpu-exact.args | 2 +-
.../qemuxml2argv-pseries-cpu-exact.xml | 2 +-
tests/qemuxml2argvtest.c | 312 +++++++-------
.../qemuxml2xmlout-graphics-spice-timeout.xml | 24 +-
tests/testutilsqemu.c | 126 ++++--
tests/testutilsqemu.h | 11 +-
tools/virsh-host.c | 10 +-
79 files changed, 2455 insertions(+), 1119 deletions(-)
create mode 100644 docs/schemas/cputypes.rng
create mode 100644 tests/cputestdata/x86-host+host-passthrough-features.xml
create mode 100644 tests/cputestdata/x86-host-passthrough-features.xml
--
2.9.2
8 years, 7 months
[libvirt] [PATCH v1 0/4] libxl: host cpu element in capabilities
by Joao Martins
Hey,
This small series implements host cpu description in caps, by getting
topology and xen hwcaps parsing done, followed by having
cpu-{compare,baseline} APIs implemented. Last thing missing I think it
would be to libxl_cpuid_set the features to enable/disable whichever
format we choose plus the appropriate XML convertion to/from XM and XL
config formats.
Note that since RFC[0] I removed the Get CPU model names API since it
would make more sense having it exported once we do support guest
cpu model/features setting. Changelog included in individual patches
(only second patch got changed)
Cheers,
Joao
[0] http://www.redhat.com/archives/libvir-list/2016-July/msg00245.html
Joao Martins (4):
libxl: describe host topology in capabilities
libxl: describe host cpu features based on hwcaps
libxl: implement virConnectCompareCPU
libxl: implement virConnectBaselineCPU
src/libxl/libxl_capabilities.c | 168 ++++++++++++++++++++++++++++++++++++++---
src/libxl/libxl_driver.c | 60 +++++++++++++++
2 files changed, 218 insertions(+), 10 deletions(-)
--
2.1.4
8 years, 7 months
[libvirt] [PATCH][RFC] enable modification of xml in case of a restore forthe combination of xen/libvirt
by Guido.Rossmueller@gdata.de
Hello everybody,
the modification of the xml-decription of an vm is disabled in libvirt for the combination of xen/libvirt.
The following patches will enabled it.
a possible use case is the restore of a vm , whose virtuell disk is on an LVM, and it should use for the restore a snapshot of this LVM
all the best
guido
---
src/libxl/libxl_domain.c | 14 +++++++++++---
src/libxl/libxl_domain.h | 3 ++-
src/libxl/libxl_driver.c | 9 +--------
3 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 0e26b91..98992a5 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -630,7 +630,8 @@ libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver,
libxlDriverConfigPtr cfg,
const char *from,
virDomainDefPtr *ret_def,
- libxlSavefileHeaderPtr ret_hdr)
+ libxlSavefileHeaderPtr ret_hdr,
+ const char *xmlin )
{
int fd;
virDomainDefPtr def = NULL;
@@ -675,10 +676,17 @@ libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver,
goto error;
}
- if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
+ if (xmlin != NULL) {
+ if (!(def = virDomainDefParseString(xmlin, cfg->caps, driver->xmlopt,
+ VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
+ goto error;
+ } else {
+ if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
goto error;
+ }
VIR_FREE(xml);
@@ -1072,7 +1080,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
managed_save_fd = libxlDomainSaveImageOpen(driver, cfg,
managed_save_path,
- &def, &hdr);
+ &def, &hdr, NULL);
if (managed_save_fd < 0)
goto cleanup;
diff --git a/src/libxl/libxl_domain.h b/src/libxl/libxl_domain.h
index af11a2c..863473d 100644
--- a/src/libxl/libxl_domain.h
+++ b/src/libxl/libxl_domain.h
@@ -106,7 +106,8 @@ libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver,
libxlDriverConfigPtr cfg,
const char *from,
virDomainDefPtr *ret_def,
- libxlSavefileHeaderPtr ret_hdr)
+ libxlSavefileHeaderPtr ret_hdr,
+ const char *xmlin)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
int
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index cb501cf..4683fe7 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1828,14 +1828,7 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
return -1;
#endif
- virCheckFlags(VIR_DOMAIN_SAVE_PAUSED, -1);
- if (dxml) {
- virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("xml modification unsupported"));
- return -1;
- }
-
- fd = libxlDomainSaveImageOpen(driver, cfg, from, &def, &hdr);
+ fd = libxlDomainSaveImageOpen(driver, cfg, from, &def, &hdr, dxml);
if (fd < 0)
goto cleanup;
--
2.6.6
____________
Virus checked by G Data MailSecurity
Version: AVA 25.8250 dated 12.09.2016
Virus news: www.antiviruslab.com
8 years, 7 months
[libvirt] [PATCH v2a] HyperV: Improve 2008, introduce 2012
by Jason Miesionczek
Second round of patches based on recently complete code review. Going
to submit patches in much smaller chunks, starting with this one. Future
patches will be submitted as each previous patch is reviewed and merged.
Jason Miesionczek (1):
hyperv: add new WMI classes and improve generator
src/hyperv/hyperv_wmi_generator.input | 485 ++++++++++++++++++++++++++++++++++
src/hyperv/hyperv_wmi_generator.py | 57 +++-
2 files changed, 539 insertions(+), 3 deletions(-)
--
2.7.4
8 years, 7 months
[libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012
by Jason Miesionczek
The following patches include work originally done by Yves Vinter back
in 2014. The last patch introduces support for Hyper-V 2012, while still
supporting 2008. I am not sure that the method I used to include the 2012
support is the best approach, mainly due to code duplication, but I am
open to suggestions on how to do this better.
Jason Miesionczek (16):
hyperv: additional server 2008 wmi classes
hyperv: add cim types support to code generator
hyperv: add get capabilities
hyperv: implement connectGetVersion
hyperv: implement vcpu functions
hyperv: implement nodeGetFreeMemory
hyperv: implement ability to send xml soap requests
hyperv: introduce basic network driver
hyperv: add domain shutdown function
hyperv: add get scheduler functions
hyperv: add set memory functions
hyperv: set vpcu functions
hyperv: domain undefine functions
hyperv: domain define and associated functions
hyperv: network list functions
hyperv: introduce 2012 support
src/Makefile.am | 2 +
src/hyperv/hyperv_driver.c | 1989 ++++++++++++++++++++++++++++++++-
src/hyperv/hyperv_driver_2012.c | 299 +++++
src/hyperv/hyperv_driver_2012.h | 55 +
src/hyperv/hyperv_network_driver.c | 280 +++++
src/hyperv/hyperv_network_driver.h | 30 +
src/hyperv/hyperv_private.h | 8 +
src/hyperv/hyperv_wmi.c | 709 +++++++++++-
src/hyperv/hyperv_wmi.h | 78 ++
src/hyperv/hyperv_wmi_generator.input | 518 ++++++++-
src/hyperv/hyperv_wmi_generator.py | 68 +-
src/hyperv/openwsman.h | 4 +
12 files changed, 3989 insertions(+), 51 deletions(-)
create mode 100644 src/hyperv/hyperv_driver_2012.c
create mode 100644 src/hyperv/hyperv_driver_2012.h
create mode 100644 src/hyperv/hyperv_network_driver.c
create mode 100644 src/hyperv/hyperv_network_driver.h
--
2.7.4
8 years, 7 months
[libvirt] [PATCH v2] qemu: map "virtio" video model to "virt" machtype correctly (arm/aarch64)
by Laszlo Ersek
Most of QEMU's PCI display device models, such as:
libvirt video/model/@type QEMU -device
------------------------- ------------
cirrus cirrus-vga
vga VGA
qxl qxl-vga
virtio virtio-vga
come with a linear framebuffer (sometimes called "VGA compatibility
framebuffer"). This linear framebuffer lives in one of the PCI device's
MMIO BARs, and allows guest code (primarily: firmware drivers, and
non-accelerated OS drivers) to display graphics with direct memory access.
Due to architectural reasons on aarch64/KVM hosts, this kind of
framebuffer doesn't / can't work in
qemu-system-(arm|aarch64) -M virt
machines. Cache coherency issues guarantee a corrupted / unusable display.
The problem has been researched by several people, including kvm-arm
maintainers, and it's been decided that the best way (practically the only
way) to have boot time graphics for such guests is to consolidate on
QEMU's "virtio-gpu-pci" device.
>From <https://bugzilla.redhat.com/show_bug.cgi?id=1195176>, libvirt
supports
<devices>
<video>
<model type='virtio'/>
</video>
</devices>
but libvirt unconditionally maps @type='virtio' to QEMU's "virtio-vga"
device model. (See the qemuBuildDeviceVideoStr() function and the
"qemuDeviceVideo" enum impl.)
According to the above, this is not right for the "virt" machine type; the
qemu-system-(arm|aarch64) binaries don't even recognize the "virtio-vga"
device model (justifiedly). Whereas "virtio-gpu-pci", which is a pure
virtio device without a compatibility framebuffer, is available, and works
fine.
(The ArmVirtQemu ("AAVMF") platform of edk2 -- that is, the UEFI firmware
for "virt" -- supports "virtio-gpu-pci", as of upstream commit
3ef3209d3028. See
<https://tianocore.acgmultimedia.com/show_bug.cgi?id=66>.)
Override the default mapping of "virtio", from "virtio-vga" to
"virtio-gpu-pci", if qemuDomainMachineIsVirt() evaluates to true.
Cc: Andrea Bolognani <abologna(a)redhat.com>
Cc: Drew Jones <drjones(a)redhat.com>
Cc: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Cc: Martin Kletzander <mkletzan(a)redhat.com>
Suggested-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1372901
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
Acked-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
v2:
- rewrap "qemuxml2argv-aarch64-video-virtio-gpu-pci.args" with
"test-wrap-argv.pl" [Martin]
- pick up Martin's ACK
src/qemu/qemu_command.c | 4 ++
tests/qemuxml2argvtest.c | 5 +++
tests/qemuxml2xmltest.c | 5 +++
tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args | 26 +++++++++++
tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml | 36 ++++++++++++++++
tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml | 45 ++++++++++++++++++++
6 files changed, 121 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3a61863b9abb..038c38f2217c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4325,6 +4325,10 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
virDomainVideoTypeToString(video->type));
goto error;
}
+ if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
+ qemuDomainMachineIsVirt(def)) {
+ model = "virtio-gpu-pci";
+ }
} else {
if (video->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index dbb0e4d56142..e8540779a4b5 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1872,6 +1872,11 @@ mymain(void)
QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_VIRTIO_SCSI);
+ DO_TEST("aarch64-video-virtio-gpu-pci",
+ QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_OBJECT_GPEX,
+ QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420,
+ QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_BOOTINDEX);
DO_TEST("aarch64-aavmf-virtio-mmio",
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
QEMU_CAPS_DEVICE_VIRTIO_MMIO,
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 14c2b0ccf2ce..fb05c8571411 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -831,6 +831,11 @@ mymain(void)
QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_VIRTIO_SCSI);
+ DO_TEST("aarch64-video-virtio-gpu-pci",
+ QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_OBJECT_GPEX,
+ QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420,
+ QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_BOOTINDEX);
DO_TEST_FULL("aarch64-gic-none", WHEN_BOTH, GIC_NONE, NONE);
DO_TEST_FULL("aarch64-gic-none-v2", WHEN_BOTH, GIC_V2, NONE);
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args
new file mode 100644
index 000000000000..76ee977a3ca2
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args
@@ -0,0 +1,26 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/opt/qemu-installed/bin/qemu-system-aarch64 \
+-name aarch64-vgpu \
+-S \
+-M virt \
+-cpu cortex-a57 \
+-m 1024 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid f3197c89-6457-44fe-b26d-897090ba6541 \
+-nographic \
+-nodefconfig \
+-nodefaults \
+-monitor unix:/tmp/lib/domain--1-aarch64-vgpu/monitor.sock,server,nowait \
+-device ioh3420,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
+addr=0x1 \
+-device ioh3420,port=0x9,chassis=2,id=pci.2,bus=pcie.0,multifunction=on,\
+addr=0x1.0x1 \
+-device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:73:34:53,bus=pci.1,addr=0x0,\
+bootindex=1 \
+-net user,vlan=0,name=hostnet0 \
+-device virtio-gpu-pci,id=video0,bus=pci.2,addr=0x0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml
new file mode 100644
index 000000000000..4b52a731b043
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>aarch64-vgpu</name>
+ <uuid>f3197c89-6457-44fe-b26d-897090ba6541</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='aarch64' machine='virt'>hvm</type>
+ </os>
+ <features>
+ <acpi/>
+ </features>
+ <cpu mode='custom' match='exact'>
+ <model fallback='allow'>cortex-a57</model>
+ </cpu>
+ <devices>
+ <emulator>/opt/qemu-installed/bin/qemu-system-aarch64</emulator>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1' model='pcie-root-port'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='pci' index='2' model='pcie-root-port'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1' multifunction='on'/>
+ </controller>
+ <interface type='user'>
+ <mac address='52:54:00:73:34:53'/>
+ <model type='virtio'/>
+ <boot order='1'/>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+ </interface>
+ <video>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+ </video>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml
new file mode 100644
index 000000000000..26f6a51622ef
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml
@@ -0,0 +1,45 @@
+<domain type='qemu'>
+ <name>aarch64-vgpu</name>
+ <uuid>f3197c89-6457-44fe-b26d-897090ba6541</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='aarch64' machine='virt'>hvm</type>
+ </os>
+ <features>
+ <acpi/>
+ <gic version='2'/>
+ </features>
+ <cpu mode='custom' match='exact'>
+ <model fallback='allow'>cortex-a57</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/opt/qemu-installed/bin/qemu-system-aarch64</emulator>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='1' port='0x8'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='pci' index='2' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='2' port='0x9'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1' multifunction='on'/>
+ </controller>
+ <interface type='user'>
+ <mac address='52:54:00:73:34:53'/>
+ <model type='virtio'/>
+ <boot order='1'/>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+ </interface>
+ <video>
+ <model type='virtio' heads='1' primary='yes'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+ </video>
+ </devices>
+</domain>
--
2.9.2
8 years, 7 months