[libvirt] [PATCHv5 0/4] Add support for memory backing with file source
by Jaroslav Safka
Hi,
we would like to introduce 3 new elements source,access and allocation in memoryBacking element.
For now it was made for numa topology.
<memoryBacking>
<source type="file|anonymous"/>
<access mode="shared|private"/>
<allocation mode="immediate|ondemand"/>
</memoryBacking>
If allocation is immediate then -mem-prealloc should be added to the qemu commanline.
If source is file then
-object memory-backend-file,id=mem,size=1024M,mem-path=*lib dir path* -numa node,memdev=mem Will be added to the qemu commandline
If access is shared then the "share=on" parameter will be added to the memory-backend-file e.g.
-object memory-backend-file,id=mem,size=1024M,mem-path=/var/lib/libvirt/qemu,share=on
The access mode can be overriden by specifying token memAccess in numa cell.
The mem-path can be defined by new config parameter memory_backing_dir.
PS: the sometime failing test qemuhotplug was failing also before this patch :)
Jaroslav Safka (4):
qemu,conf: Rename virNumaMemAccess to virDomainMemoryAccess
qemu_conf: Add param memory_backing_dir
conf: Add new xml elements for file memorybacking support
qemu: Add args generation for file memory backing
docs/formatdomain.html.in | 9 ++
docs/schemas/domaincommon.rng | 30 +++++
src/conf/domain_conf.c | 133 ++++++++++++++++-----
src/conf/domain_conf.h | 22 ++++
src/conf/numa_conf.c | 15 +--
src/conf/numa_conf.h | 14 +--
src/qemu/libvirtd_qemu.aug | 3 +
src/qemu/qemu.conf | 4 +
src/qemu/qemu_command.c | 55 ++++++---
src/qemu/qemu_conf.c | 9 ++
src/qemu/qemu_conf.h | 2 +
src/qemu/qemu_process.c | 2 +-
src/qemu/test_libvirtd_qemu.aug.in | 1 +
.../qemuxml2argv-fd-memory-no-numa-topology.args | 21 ++++
.../qemuxml2argv-fd-memory-no-numa-topology.xml | 27 +++++
.../qemuxml2argv-fd-memory-numa-topology.args | 24 ++++
.../qemuxml2argv-fd-memory-numa-topology.xml | 30 +++++
.../qemuxml2argv-fd-memory-numa-topology2.args | 27 +++++
.../qemuxml2argv-fd-memory-numa-topology2.xml | 31 +++++
.../qemuxml2argv-fd-memory-numa-topology3.args | 30 +++++
.../qemuxml2argv-fd-memory-numa-topology3.xml | 32 +++++
.../qemuxml2argv-memorybacking-set.xml | 24 ++++
.../qemuxml2argv-memorybacking-unset.xml | 24 ++++
tests/qemuxml2argvtest.c | 13 ++
.../qemuxml2xmlout-memorybacking-set.xml | 32 +++++
.../qemuxml2xmlout-memorybacking-unset.xml | 32 +++++
tests/qemuxml2xmltest.c | 3 +
27 files changed, 584 insertions(+), 65 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-no-numa-topology.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-no-numa-topology.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memorybacking-set.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memorybacking-unset.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-memorybacking-set.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-memorybacking-unset.xml
--
2.7.4
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
7 years, 10 months
[libvirt] [PATCH v2] cpu: fix typo: rename __kvm_hv_spinlock to __kvm_hv_spinlocks
by Maxim Nestratov
Strings associated with virDomainHyperv values in domain_conf.c are used to
construct HyperV CPU features names to be compared with names defined in
cpu_x86_data.h and the names for HyperV "spinlocks" feature don't match.
This leads to a misleading warning:
"host doesn't support hyperv 'spinlocks' feature" even when it's supported.
Let's fix it and rename along with it VIR_CPU_x86_KVM_HV_SPINLOCK to
VIR_CPU_x86_KVM_HV_SPINLOCKS.
Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
---
src/cpu/cpu_x86.c | 4 ++--
src/cpu/cpu_x86_data.h | 8 +++++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 23a519e..40d98ee 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -100,7 +100,7 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_STIMER,
0x40000003, 0x00000008);
KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RELAXED,
0x40000003, 0x00000020);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SPINLOCK,
+KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SPINLOCKS,
0x40000003, 0x00000022);
KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VAPIC,
0x40000003, 0x00000030);
@@ -124,7 +124,7 @@ static virCPUx86Feature x86_kvm_features[] =
KVM_FEATURE(VIR_CPU_x86_KVM_HV_SYNIC),
KVM_FEATURE(VIR_CPU_x86_KVM_HV_STIMER),
KVM_FEATURE(VIR_CPU_x86_KVM_HV_RELAXED),
- KVM_FEATURE(VIR_CPU_x86_KVM_HV_SPINLOCK),
+ KVM_FEATURE(VIR_CPU_x86_KVM_HV_SPINLOCKS),
KVM_FEATURE(VIR_CPU_x86_KVM_HV_VAPIC),
KVM_FEATURE(VIR_CPU_x86_KVM_HV_VPINDEX),
KVM_FEATURE(VIR_CPU_x86_KVM_HV_RESET),
diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h
index 4660ab6..4c51e43 100644
--- a/src/cpu/cpu_x86_data.h
+++ b/src/cpu/cpu_x86_data.h
@@ -49,11 +49,17 @@ struct _virCPUx86CPUID {
# define VIR_CPU_x86_KVM_PV_EOI "__kvm_pv_eoi"
# define VIR_CPU_x86_KVM_PV_UNHALT "__kvm_pv_unhalt"
# define VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT "__kvm_clocksource_stable"
+
+/*
+ * The following HyperV feature names suffixes must exactly match corresponding
+ * ones defined in domain_conf.c. E.g "__kvm_runtime" -> "runtime",
+ * "__kvm_hv_spinlocks" -> "spinlocks" etc.
+*/
# define VIR_CPU_x86_KVM_HV_RUNTIME "__kvm_hv_runtime"
# define VIR_CPU_x86_KVM_HV_SYNIC "__kvm_hv_synic"
# define VIR_CPU_x86_KVM_HV_STIMER "__kvm_hv_stimer"
# define VIR_CPU_x86_KVM_HV_RELAXED "__kvm_hv_relaxed"
-# define VIR_CPU_x86_KVM_HV_SPINLOCK "__kvm_hv_spinlock"
+# define VIR_CPU_x86_KVM_HV_SPINLOCKS "__kvm_hv_spinlocks"
# define VIR_CPU_x86_KVM_HV_VAPIC "__kvm_hv_vapic"
# define VIR_CPU_x86_KVM_HV_VPINDEX "__kvm_hv_vpindex"
# define VIR_CPU_x86_KVM_HV_RESET "__kvm_hv_reset"
--
2.4.11
7 years, 10 months
[libvirt] [PATCH] cpu_x86: Fix memory leak in virCPUx86Translate
by Jiri Denemark
virCPUDefStealModel is called with keepVendor == true which means the
cpu structure will keep its original vendor/vendor_id values. Thus it
makes no sense to copy them to the translated definition as they won't
be used there anyway. Except that the translated->vendor pointer might
get lost in x86Decode.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/cpu/cpu_x86.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 23a519ec0..9e22f896e 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -2709,10 +2709,6 @@ virCPUx86Translate(virCPUDefPtr cpu,
if (!(translated = virCPUDefCopyWithoutModel(cpu)))
goto cleanup;
- if (VIR_STRDUP(translated->vendor, cpu->vendor) < 0 ||
- VIR_STRDUP(translated->vendor_id, cpu->vendor_id) < 0)
- goto cleanup;
-
if (x86Decode(translated, &model->data, models, nmodels, NULL, 0) < 0)
goto cleanup;
--
2.11.1
7 years, 10 months
[libvirt] [PATCH 00/11] qemu: Big namespace cleanup
by Michal Privoznik
Couple of these patches were requested in reviews to my previous namespace
patches, couple of them are my own idea. At the same time, 3 bugs are fixed:
1) qemuSecurity wrappers are preferred over virSecurityManager
2) corresponding /dev entry is not created when attaching vhost scsi device
3) corresponding /dev entry is not created when doing blockjobs
Michal Privoznik (11):
qemuDomainAttachSCSIVHostDevice: Prefer qemuSecurity wrappers
syntax-check: Enforce qemuSecurity
qemuDomainAttachSCSIVHostDevice: manage /dev entry
qemu_security: Kill code duplication
qemu_security: Drop qemuSecuritySetRestoreAllLabelData struct
qemu_domain: Don't pass virDomainDeviceDefPtr to ns helpers
qemuDomainNamespaceSetupDisk: Drop useless @src variable
qemuDomainNamespace{Setup,Teardown}Disk: Don't pass pointer to full
disk
qemuDomainDiskChainElement{Prepare,Revoke}: manage /dev entry
qemu_security: Introduce ImageLabel APIs
qemuDomainNamespaceSetupDisk: Simplify disk check
cfg.mk | 8 ++
src/qemu/qemu_domain.c | 65 ++++++----------
src/qemu/qemu_domain.h | 4 +-
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_hotplug.c | 20 +++--
src/qemu/qemu_security.c | 189 ++++++++++++-----------------------------------
src/qemu/qemu_security.h | 8 ++
7 files changed, 102 insertions(+), 194 deletions(-)
--
2.11.0
7 years, 10 months
[libvirt] [PATCH] qemu_command: Fix check for gluster disks
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0767c6649..1880bd386 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1419,7 +1419,7 @@ qemuBuildDriveSourceStr(virDomainDiskDefPtr disk,
}
virBufferAddLit(buf, ",");
- if (disk->src &&
+ if (disk->src->type == VIR_STORAGE_TYPE_NETWORK &&
disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_GLUSTER) {
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_GLUSTER_DEBUG_LEVEL))
virBufferAsprintf(buf, "file.debug=%d,", cfg->glusterDebugLevel);
--
2.11.1
7 years, 10 months
[libvirt] [PATCH] vz: cleanup: remove unused constant
by Maxim Nestratov
PARALLELS_STATISTICS_DROP_COUNT isn't used anymore
Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
---
src/vz/vz_sdk.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 614dca1..30eb743 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -2187,8 +2187,6 @@ prlsdkHandleVmRemovedEvent(vzDriverPtr driver,
return;
}
-#define PARALLELS_STATISTICS_DROP_COUNT 3
-
static void
prlsdkHandlePerfEvent(vzDriverPtr driver,
PRL_HANDLE event,
--
2.4.11
7 years, 10 months
[libvirt] [PATCH 0/2] vz: fix two handle leaks
by Maxim Nestratov
Maxim Nestratov (2):
vz: fix handle leak in prlsdkHandleVmStateEvent
vz: fix event handle leak in prlsdkHandlePerfEvent
src/vz/vz_sdk.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--
2.4.11
7 years, 10 months
[libvirt] [PATCH] qemu_blockjob: Avoid dereferencing NULL on OOM
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_blockjob.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 4ada4cd27..985fae1e9 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -123,7 +123,8 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver,
if ((persistDisk = virDomainDiskByName(vm->newDef,
disk->dst, false))) {
copy = virStorageSourceCopy(disk->mirror, false);
- if (virStorageSourceInitChainElement(copy,
+ if (!copy ||
+ virStorageSourceInitChainElement(copy,
persistDisk->src,
true) < 0) {
VIR_WARN("Unable to update persistent definition "
--
2.11.1
7 years, 10 months
Re: [libvirt] [PATCHv5 0/4] UPDATE Add support for memory backing with file source
by Safka, JaroslavX
I updated a little the description
diff --git a/docs/news.xml b/docs/news.xml
index f408293..5f37592 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -23,6 +23,16 @@
built-in replication and disaster recovery.
</description>
</change>
+ <change>
+ <summary>
+ qemu: Add support for memory backing with file source
+ </summary>
+ <description>
+ Add support in numa topology for file source inside memory backing (hugepages are not needed)
+ Three new elements <source>,<access> and <allocation> were added to <memoryBacking> element.
+ Also new configuration parameter "memory_backing_dir" was added.
+ </description>
+ </change>
</section>
<section title="Improvements">
<change>
> -----Original Message-----
> From: Michal Privoznik [mailto:mprivozn@redhat.com]
> Sent: Thursday, February 09, 2017 9:58 AM
> To: Safka, JaroslavX <jaroslavx.safka(a)intel.com>; libvir-list(a)redhat.com
> Cc: Mooney, Sean K <sean.k.mooney(a)intel.com>; Ptacek, MichalX
> <michalx.ptacek(a)intel.com>
> Subject: Re: [libvirt] [PATCHv5 0/4] Add support for memory backing with file
> source
>
> On 02/02/2017 02:27 PM, Jaroslav Safka wrote:
> > Hi,
> > we would like to introduce 3 new elements source,access and allocation in
> memoryBacking element.
> > For now it was made for numa topology.
> >
> > <memoryBacking>
> > <source type="file|anonymous"/>
> > <access mode="shared|private"/>
> > <allocation mode="immediate|ondemand"/> </memoryBacking>
> >
> > If allocation is immediate then -mem-prealloc should be added to the qemu
> commanline.
> > If source is file then
> > -object memory-backend-file,id=mem,size=1024M,mem-path=*lib dir path*
> > -numa node,memdev=mem Will be added to the qemu commandline
> >
> > If access is shared then the "share=on" parameter will be added to the
> memory-backend-file e.g.
> > -object
> > memory-backend-file,id=mem,size=1024M,mem-path=/var/lib/libvirt/qemu,s
> > hare=on
> >
> > The access mode can be overriden by specifying token memAccess in numa
> cell.
> > The mem-path can be defined by new config parameter
> memory_backing_dir.
> >
> > PS: the sometime failing test qemuhotplug was failing also before this
> > patch :)
> >
> > Jaroslav Safka (4):
> > qemu,conf: Rename virNumaMemAccess to virDomainMemoryAccess
> > qemu_conf: Add param memory_backing_dir
> > conf: Add new xml elements for file memorybacking support
> > qemu: Add args generation for file memory backing
> >
> > docs/formatdomain.html.in | 9 ++
> > docs/schemas/domaincommon.rng | 30 +++++
> > src/conf/domain_conf.c | 133 ++++++++++++++++-----
> > src/conf/domain_conf.h | 22 ++++
> > src/conf/numa_conf.c | 15 +--
> > src/conf/numa_conf.h | 14 +--
> > src/qemu/libvirtd_qemu.aug | 3 +
> > src/qemu/qemu.conf | 4 +
> > src/qemu/qemu_command.c | 55 ++++++---
> > src/qemu/qemu_conf.c | 9 ++
> > src/qemu/qemu_conf.h | 2 +
> > src/qemu/qemu_process.c | 2 +-
> > src/qemu/test_libvirtd_qemu.aug.in | 1 +
> > .../qemuxml2argv-fd-memory-no-numa-topology.args | 21 ++++
> > .../qemuxml2argv-fd-memory-no-numa-topology.xml | 27 +++++
> > .../qemuxml2argv-fd-memory-numa-topology.args | 24 ++++
> > .../qemuxml2argv-fd-memory-numa-topology.xml | 30 +++++
> > .../qemuxml2argv-fd-memory-numa-topology2.args | 27 +++++
> > .../qemuxml2argv-fd-memory-numa-topology2.xml | 31 +++++
> > .../qemuxml2argv-fd-memory-numa-topology3.args | 30 +++++
> > .../qemuxml2argv-fd-memory-numa-topology3.xml | 32 +++++
> > .../qemuxml2argv-memorybacking-set.xml | 24 ++++
> > .../qemuxml2argv-memorybacking-unset.xml | 24 ++++
> > tests/qemuxml2argvtest.c | 13 ++
> > .../qemuxml2xmlout-memorybacking-set.xml | 32 +++++
> > .../qemuxml2xmlout-memorybacking-unset.xml | 32 +++++
> > tests/qemuxml2xmltest.c | 3 +
> > 27 files changed, 584 insertions(+), 65 deletions(-) create mode
> > 100644
> > tests/qemuxml2argvdata/qemuxml2argv-fd-memory-no-numa-topology.args
> > create mode 100644
> > tests/qemuxml2argvdata/qemuxml2argv-fd-memory-no-numa-topology.xml
> > create mode 100644
> > tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args
> > create mode 100644
> > tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.xml
> > create mode 100644
> > tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args
> > create mode 100644
> > tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.xml
> > create mode 100644
> > tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args
> > create mode 100644
> > tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.xml
> > create mode 100644
> > tests/qemuxml2argvdata/qemuxml2argv-memorybacking-set.xml
> > create mode 100644
> > tests/qemuxml2argvdata/qemuxml2argv-memorybacking-unset.xml
> > create mode 100644
> > tests/qemuxml2xmloutdata/qemuxml2xmlout-memorybacking-set.xml
> > create mode 100644
> > tests/qemuxml2xmloutdata/qemuxml2xmlout-memorybacking-unset.xml
> >
>
> Looking good. ACK to all of them. However, please send a patch (as a reply to
> this cover letter) that updates docs/news.xml. Only after that it is possible to
> push these.
>
> Michal
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
7 years, 10 months
[libvirt] [PATCH 0/2] libxl: a few domain maximum memory fixes
by Jim Fehlig
Patch 1 fixes reporting of domain maximum memory for running domains.
When creating a virDomainDef object to represent dom0, max memory was
not set correctly, which is fixed by patch2.
Jim Fehlig (2):
libxl: fix reporting of maximum memory
libxl: fix dom0 maximum memory setting
src/libxl/libxl_conf.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++
src/libxl/libxl_conf.h | 3 ++
src/libxl/libxl_driver.c | 7 ++---
3 files changed, 81 insertions(+), 4 deletions(-)
--
2.9.2
7 years, 10 months