[libvirt] [PATCH 0/3] Followup fix for CVE-2013-4311
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The initial fix for CVE-2013-4311 had a flaw which affected
the ACL code only. The first patch fixes that flaw, the next
two add a test suite for the code in question.
Daniel P. Berrange (3):
Fix typo in identity code which is pre-requisite for CVE-2013-4311
Add a virNetSocketNewConnectSockFD method
Add test case for virNetServerClient object identity code
cfg.mk | 2 +-
src/libvirt_private.syms | 1 +
src/rpc/virnetserverclient.c | 2 +-
src/rpc/virnetsocket.c | 18 +++++
src/rpc/virnetsocket.h | 2 +
tests/Makefile.am | 14 +++-
tests/virnetserverclientmock.c | 64 +++++++++++++++++
tests/virnetserverclienttest.c | 159 +++++++++++++++++++++++++++++++++++++++++
8 files changed, 259 insertions(+), 3 deletions(-)
create mode 100644 tests/virnetserverclientmock.c
create mode 100644 tests/virnetserverclienttest.c
--
1.8.3.1
11 years, 3 months
[libvirt] [PATCH] build: ensure 'make check' sees up-to-date config.h
by Eric Blake
Nehal J. Wani reported on IRC a rather interesting build failure:
In file included from util/virnetdevbridge.c:53:0:
/usr/include/linux/in6.h:30:8: error: redefinition of 'struct in6_addr'
struct in6_addr {
^
I traced it to the fact that he ran 'git pull; make check' across
commit e62e0094. What happened is that the configure changes
result in a new variable that was set to be defined on his system,
but config.h was not regenerated to contain the value of that
variable. Running 'make' instead of 'make check' cleaned up the
problem. A bit more investigation, and I see that in Makefile.am,
automake sticks rules that rebuild config.h as part of 'make all',
and that we also had a dependency 'check-local: all'; BUT the
rule for check-local is run only at the point when the top-level
directory is visited. Automake documents that SUBDIRS should
contain an explicit '.' at the point the top-level should be
visited (defaulting to last, if it doesn't appear). Sure enough,
with this patch, 'make check' now does the top-level 'all' rules,
which regenerates 'config.h' BEFORE compiling any code that might
depend on changed content of that file.
* Makefile.am (SUBDIRS): Put '.' first, not last.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Tough to argue the build-breaker rule on this one, since a
fresh checkout doesn't hit it (only a 'make check' without
a 'make', across an incremental build that happened to need
new configure substitutions). So I'll wait for a review
for my one-liner.
Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 4e24ecf..66cb677 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@
LCOV = lcov
GENHTML = genhtml
-SUBDIRS = gnulib/lib include src daemon tools docs gnulib/tests \
+SUBDIRS = . gnulib/lib include src daemon tools docs gnulib/tests \
python tests po examples/domain-events/events-c examples/hellolibvirt \
examples/dominfo examples/domsuspend examples/python examples/apparmor \
examples/xml/nwfilter examples/openauth examples/systemtap
--
1.7.1
11 years, 3 months
Re: [libvirt] [PATCH 6/6] qemu: Add support for emulated CPU features
by Eduardo Habkost
(CCing qemu-devel and libvir-list)
On Sun, Sep 22, 2013 at 04:44:55PM +0200, Borislav Petkov wrote:
> From: Borislav Petkov <bp(a)suse.de>
>
> Add support for the KVM_GET_EMULATED_CPUID ioctl and leave feature bits
> enabled, when requested by userspace, if kvm emulates them.
>
> Signed-off-by: Borislav Petkov <bp(a)suse.de>
This will break some assumptions about the semantics of "-cpu host",
that today means "enable every single feature that can be enabled in the
host". This, in turn, breaks the assumption that "-cpu host" can be used
by libvirt to get information about all CPU features supported by the
host.
So, I have two questions:
1) Should "-cpu host" enable GET_EMULATED_CPUID features? (I believe the
answer is "no");
2) If not, we need a new mechanism to let libvirt know which features
can be enabled on a host (in a way that would allow libvirt to
easily calculate the set of possible destination hosts to which a VM
can be migrated, before deciding to migrate it).
This interface is getting complex enough for me to consider simply
asking libvirt developers to call GET_EMULATED_CPUID and
GET_SUPPORTED_CPUID directly, instead of asking QEMU for information.
But if libvirt does that, it needs a way to know if it's running a QEMU
version that supports GET_EMULATED_CPUID, or an old version that
supports only GET_SUPPORTED_CPUID.
Another alternative is to simply let libvirt ignore GET_EMULATED_CPUID
by now, and treat GET_EMULATED_CPUID features as not supported by the
host. But then it will break the use cases that prompted the creation of
GET_EMULATED_CPUID in the first place.
> ---
> include/sysemu/kvm.h | 4 ++++
> linux-headers/linux/kvm.h | 4 ++++
> target-i386/cpu.c | 7 +++++++
> target-i386/kvm.c | 38 ++++++++++++++++++++++++++++++++++----
> 4 files changed, 49 insertions(+), 4 deletions(-)
>
> diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
> index 9bbe3db1464e..8eda1ada848a 100644
> --- a/include/sysemu/kvm.h
> +++ b/include/sysemu/kvm.h
> @@ -265,6 +265,10 @@ int kvm_check_extension(KVMState *s, unsigned int extension);
>
> uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
> uint32_t index, int reg);
> +
> +uint32_t kvm_arch_get_emulated_cpuid(KVMState *env, uint32_t function,
> + uint32_t index, int reg);
> +
> void kvm_cpu_synchronize_state(CPUState *cpu);
>
> /* generic hooks - to be moved/refactored once there are more users */
> diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
> index c614070662e1..edc8f2db1f8d 100644
> --- a/linux-headers/linux/kvm.h
> +++ b/linux-headers/linux/kvm.h
> @@ -541,6 +541,7 @@ struct kvm_ppc_smmu_info {
> #define KVM_TRACE_ENABLE __KVM_DEPRECATED_MAIN_W_0x06
> #define KVM_TRACE_PAUSE __KVM_DEPRECATED_MAIN_0x07
> #define KVM_TRACE_DISABLE __KVM_DEPRECATED_MAIN_0x08
> +#define KVM_GET_EMULATED_CPUID _IOWR(KVMIO, 0x09, struct kvm_cpuid2)
>
> /*
> * Extension capability list.
> @@ -666,6 +667,9 @@ struct kvm_ppc_smmu_info {
> #define KVM_CAP_IRQ_MPIC 90
> #define KVM_CAP_PPC_RTAS 91
> #define KVM_CAP_IRQ_XICS 92
> +#define KVM_CAP_ARM_EL1_32BIT 93
> +#define KVM_CAP_SPAPR_MULTITCE 94
> +#define KVM_CAP_EXT_EMUL_CPUID 95
>
> #ifdef KVM_CAP_IRQ_ROUTING
>
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index c36345e426d7..5406348ceb4a 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -1850,7 +1850,14 @@ static void filter_features_for_kvm(X86CPU *cpu)
> wi->cpuid_ecx,
> wi->cpuid_reg);
> uint32_t requested_features = env->features[w];
> +
> + uint32_t emul_features = kvm_arch_get_emulated_cpuid(s, wi->cpuid_eax,
> + wi->cpuid_ecx,
> + wi->cpuid_reg);
> +
> env->features[w] &= host_feat;
> + env->features[w] |= (requested_features & emul_features);
> +
I find the above logic confusing: you remove a few bits just to re-add
them later. Isn't easier and simpler to simply do:
env->features[w] &= (host_feat | emul_features);
?
> cpu->filtered_features[w] = requested_features & ~env->features[w];
> }
> }
> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> index 749aa09a21a6..7f598f01bda5 100644
> --- a/target-i386/kvm.c
> +++ b/target-i386/kvm.c
> @@ -80,7 +80,7 @@ bool kvm_allows_irq0_override(void)
> return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing();
> }
>
> -static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max)
> +static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int ioctl, int max)
> {
> struct kvm_cpuid2 *cpuid;
> int r, size;
> @@ -88,7 +88,7 @@ static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max)
> size = sizeof(*cpuid) + max * sizeof(*cpuid->entries);
> cpuid = (struct kvm_cpuid2 *)g_malloc0(size);
> cpuid->nent = max;
> - r = kvm_ioctl(s, KVM_GET_SUPPORTED_CPUID, cpuid);
> + r = kvm_ioctl(s, ioctl, cpuid);
> if (r == 0 && cpuid->nent >= max) {
> r = -E2BIG;
> }
> @@ -97,7 +97,10 @@ static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max)
> g_free(cpuid);
> return NULL;
> } else {
> - fprintf(stderr, "KVM_GET_SUPPORTED_CPUID failed: %s\n",
> + fprintf(stderr, "%s failed: %s\n",
> + (ioctl == (int)KVM_GET_SUPPORTED_CPUID
> + ? "KVM_GET_SUPPORTED_CPUID"
> + : "KVM_GET_EMULATED_CPUID"),
> strerror(-r));
> exit(1);
> }
> @@ -112,7 +115,17 @@ static struct kvm_cpuid2 *get_supported_cpuid(KVMState *s)
> {
> struct kvm_cpuid2 *cpuid;
> int max = 1;
> - while ((cpuid = try_get_cpuid(s, max)) == NULL) {
> + while ((cpuid = try_get_cpuid(s, KVM_GET_SUPPORTED_CPUID, max)) == NULL) {
> + max *= 2;
> + }
> + return cpuid;
> +}
> +
> +static struct kvm_cpuid2 *get_emulated_cpuid(KVMState *s)
> +{
> + struct kvm_cpuid2 *cpuid;
> + int max = 1;
> + while ((cpuid = try_get_cpuid(s, KVM_GET_EMULATED_CPUID, max)) == NULL) {
> max *= 2;
> }
> return cpuid;
> @@ -241,6 +254,23 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
> return ret;
> }
>
> +uint32_t kvm_arch_get_emulated_cpuid(KVMState *s, uint32_t function,
> + uint32_t index, int reg)
> +{
> + struct kvm_cpuid2 *cpuid __attribute__((unused));
> +
> + if (!kvm_check_extension(s, KVM_CAP_EXT_EMUL_CPUID))
> + return 0;
> +
> + cpuid = get_emulated_cpuid(s);
> +
> + struct kvm_cpuid_entry2 *entry = cpuid_find_entry(cpuid, function, index);
> + if (entry)
> + return cpuid_entry_get_reg(entry, reg);
> +
> + return 0;
> +}
> +
> typedef struct HWPoisonPage {
> ram_addr_t ram_addr;
> QLIST_ENTRY(HWPoisonPage) list;
> --
> 1.8.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo(a)vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Eduardo
11 years, 3 months
[libvirt] [PATCH 1/2] VMware: Support more than 2 driver backends
by Doug Goldstein
Currently the VMware version check code only supports two types of
VMware backends, Workstation and Player. But in the near future we will
have an additional one so we need to support more. Additionally, we
discover and cache the path to the vmrun binary so we should use that
path when using the cooresponding binary from the VMware VIX SDK.
---
src/vmware/vmware_conf.c | 23 ++++++++++++++++++++---
src/vmware/vmware_driver.c | 20 ++++++++++++++++++--
2 files changed, 38 insertions(+), 5 deletions(-)
diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index 261a4f6..d7ea8c4 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -257,10 +257,25 @@ vmwareExtractVersion(struct vmware_driver *driver)
{
unsigned long version = 0;
int ret = -1;
- virCommandPtr cmd;
+ virCommandPtr cmd = NULL;
char * outbuf = NULL;
- const char * bin = (driver->type == VMWARE_DRIVER_PLAYER) ?
- "vmplayer" : "vmware";
+ char *bin = NULL;
+ char *vmwarePath = NULL;
+
+ if ((vmwarePath = mdir_name(driver->vmrun)) == NULL)
+ goto cleanup;
+
+ switch (driver->type) {
+ case VMWARE_DRIVER_PLAYER:
+ if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmplayer"))
+ goto cleanup;
+ break;
+
+ case VMWARE_DRIVER_WORKSTATION:
+ if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmware"))
+ goto cleanup;
+ break;
+ }
cmd = virCommandNewArgList(bin, "-v", NULL);
virCommandSetOutputBuffer(cmd, &outbuf);
@@ -276,6 +291,8 @@ vmwareExtractVersion(struct vmware_driver *driver)
cleanup:
virCommandFree(cmd);
VIR_FREE(outbuf);
+ VIR_FREE(bin);
+ VIR_FREE(vmwarePath);
return ret;
}
diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c
index 4e56971..01d65ed 100644
--- a/src/vmware/vmware_driver.c
+++ b/src/vmware/vmware_driver.c
@@ -93,6 +93,7 @@ vmwareConnectOpen(virConnectPtr conn,
{
struct vmware_driver *driver;
size_t i;
+ char *tmp;
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
@@ -144,8 +145,23 @@ vmwareConnectOpen(virConnectPtr conn,
if (virMutexInit(&driver->lock) < 0)
goto cleanup;
- driver->type = STRNEQ(conn->uri->scheme, "vmwareplayer") ?
- VMWARE_DRIVER_WORKSTATION : VMWARE_DRIVER_PLAYER;
+ if ((tmp = STRSKIP(conn->uri->scheme, "vmware")) == NULL) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, _("unable to parse URI "
+ "scheme '%s'"), conn->uri->scheme);
+ goto cleanup;
+ }
+
+ driver->type = -1;
+ for (i = 0; i < VMWARE_DRIVER_LAST; i++) {
+ if (STREQ(tmp, vmwareDriverTypeToString(i)))
+ driver->type = i;
+ }
+
+ if (driver->type == -1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, _("unable to find valid "
+ "requested VMware backend '%s'"), tmp);
+ goto cleanup;
+ }
if (!(driver->domains = virDomainObjListNew()))
goto cleanup;
--
1.8.1.5
11 years, 3 months
[libvirt] Libvirt ESX: Image file not getting copied to ESX server
by varun bhatnagar
Hi,
I am trying to start a node using libvirt on ESX hypervisor. Before
starting I am performing the following steps:
1) vol-create datastore1 /local/new_volume.xml (Creating a volume in pool)
2) define /local/esxdomain.xml (Defining a node)
3) start MyNode (Starting a node)
I tried to get the status of my node and it is showing *running *but I am
not able to ping my node (as it is in network). I later got the console of
my node and found out that my node is not even getting started. It says
"Operating System Not Found". I guess this is because my vmdk image file is
not getting copied and the first command is just placing two files .vmdk
and *-flat.vmdk (these are dummy files I guess). But it is not placing my
original .vmdk files. How to place the original vmdk file in datastore. If
I place it using scp command then libvirt pops out a message saying "Could
not start domain: GenericVmConfigFault". How to resolve this error. I am
pasting my xml files below.
Any help is appreciated... :)
*new_volume.xml:*
*<volume>
<name>test/MyNode.vmdk</name>
<allocation>0</allocation>
<capacity unit='G'>3</capacity>
<target>
<path>/local/vmdk/MyNode.vmdk</path>
<format type='vmdk'/>
</target>
</volume>*
*esxdomain.xml:
*
*<domain type='vmware'>
<name>test</name>
<memory>1048576</memory>
<currentMemory>1048576</currentMemory>
<vcpu>1</vcpu>
<console>/dev/console</console>
<os>
<type arch='x86_64'>hvm</type>
</os>
<devices>
<disk type='file' device='disk'>
<source file='[datastore1] test/MyNode.vmdk'/>
<target dev='sda' bus='scsi'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='lsilogic'/>
<!--controller type='scsi' index='0'/-->
<interface type='bridge'>
<mac address='00:50:56:0f:01:01'/>
<source bridge='VM Network'/>
</interface>
<interface type='bridge'>
<mac address='00:50:56:0f:01:02'/>
<source bridge='dummyPortGroup1'/>
</interface>
<interface type='bridge'>
<mac address='00:50:56:0f:01:03'/>
<source bridge='dummyPortGroup2'/>
</interface>
</devices>
</domain>*
Regards,
Varun
11 years, 3 months
[libvirt] [PATCH] docs: Load libvirt_access*.xml from build dir
by Jiri Denemark
The xml files are generated in build directory and thus docs/newapi.xsl
was not able to find them in a VPATH build.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
docs/Makefile.am | 1 +
docs/newapi.xsl | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index c6a3ead..faf2a32 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -242,6 +242,7 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
$(XSLTPROC) --nonet -o $(srcdir)/ \
+ --stringparam builddir $(abs_top_builddir) \
$(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \
if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
diff --git a/docs/newapi.xsl b/docs/newapi.xsl
index 606d244..b1728ee 100644
--- a/docs/newapi.xsl
+++ b/docs/newapi.xsl
@@ -25,18 +25,20 @@
<!-- Build keys for all symbols -->
<xsl:key name="symbols" match="/api/symbols/*" use="@name"/>
+ <xsl:param name="builddir" select=".."/>
+
<!-- the target directory for the HTML output -->
<xsl:variable name="htmldir">html</xsl:variable>
<xsl:variable name="href_base">../</xsl:variable>
<xsl:variable name="acls">
- <xsl:copy-of select="document('../src/libvirt_access.xml')/aclinfo/api"/>
+ <xsl:copy-of select="document('{$builddir}/src/libvirt_access.xml')/aclinfo/api"/>
</xsl:variable>
<xsl:variable name="qemuacls">
- <xsl:copy-of select="document('../src/libvirt_access_qemu.xml')/aclinfo/api"/>
+ <xsl:copy-of select="document('{$builddir}/src/libvirt_access_qemu.xml')/aclinfo/api"/>
</xsl:variable>
<xsl:variable name="lxcacls">
- <xsl:copy-of select="document('../src/libvirt_access_lxc.xml')/aclinfo/api"/>
+ <xsl:copy-of select="document('{$builddir}/src/libvirt_access_lxc.xml')/aclinfo/api"/>
</xsl:variable>
<xsl:template name="aclinfo">
--
1.8.3.2
11 years, 3 months
[libvirt] Libvirt not able to attach console to VM on ESX hypervisor
by varun bhatnagar
Hi,
I have started a virtual machine on my ESXi server. I was trying to attach
a console to it but when I executed the command I got a message saying that
*"Attaching a console is not supported in the current hypervisor." *Is
there any way (patch or something) through which I can attach a console to
my VM.
The ESX version is 5.1 and I am using latest version of libvirt.
Regards,
Varun
11 years, 3 months
[libvirt] [PATCH]LXC: Check the existence of dir before resolving symlinks
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
If dir does not exist, raise a proper error in logs
and don't let virFileResolveAllLinks throw itself's exceptions
in logs, which may be misleading.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index a979452..c60f5d8 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1696,6 +1696,7 @@ static int lxcContainerResolveSymlinks(virDomainDefPtr vmDef)
{
char *newroot;
size_t i;
+ char ebuf[1024];
VIR_DEBUG("Resolving symlinks");
@@ -1703,6 +1704,13 @@ static int lxcContainerResolveSymlinks(virDomainDefPtr vmDef)
virDomainFSDefPtr fs = vmDef->fss[i];
if (!fs->src)
continue;
+
+ if (access(fs->src, F_OK)) {
+ VIR_DEBUG("Failed to access '%s': %s", fs->src,
+ virStrerror(errno, ebuf, sizeof(ebuf)));
+ return -1;
+ }
+
VIR_DEBUG("Resolving '%s'", fs->src);
if (virFileResolveAllLinks(fs->src, &newroot) < 0) {
VIR_DEBUG("Failed to resolve symlink at %s", fs->src);
--
1.8.2.1
11 years, 3 months
[libvirt] [PATCH]LXC: follow the unit style of /proc/meminfo
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
If we start libvirt_lxc with fuse complied, we could see
an isolate /proc/meminfo based on fuse.
Part of this were modified based on container's mem cgroup,
with the unit style of "KB";
rest of them were copied from /proc/meminfo, with another
unit style of "kB".
It looks a little strange.
We should keep pace with the style of
kernel function meminfo_proc_show,
and change all "KB" to "kB".
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
src/lxc/lxc_fuse.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c
index e672b0f..9d12832 100644
--- a/src/lxc/lxc_fuse.c
+++ b/src/lxc/lxc_fuse.c
@@ -165,43 +165,43 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def,
if (STREQ(line, "MemTotal") &&
(def->mem.hard_limit || def->mem.max_balloon))
- virBufferAsprintf(new_meminfo, "MemTotal: %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "MemTotal: %8llu kB\n",
meminfo.memtotal);
else if (STREQ(line, "MemFree") &&
(def->mem.hard_limit || def->mem.max_balloon))
- virBufferAsprintf(new_meminfo, "MemFree: %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "MemFree: %8llu kB\n",
(meminfo.memtotal - meminfo.memusage));
else if (STREQ(line, "Buffers"))
- virBufferAsprintf(new_meminfo, "Buffers: %8d KB\n", 0);
+ virBufferAsprintf(new_meminfo, "Buffers: %8d kB\n", 0);
else if (STREQ(line, "Cached"))
- virBufferAsprintf(new_meminfo, "Cached: %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "Cached: %8llu kB\n",
meminfo.cached);
else if (STREQ(line, "Active"))
- virBufferAsprintf(new_meminfo, "Active: %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "Active: %8llu kB\n",
(meminfo.active_anon + meminfo.active_file));
else if (STREQ(line, "Inactive"))
- virBufferAsprintf(new_meminfo, "Inactive: %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "Inactive: %8llu kB\n",
(meminfo.inactive_anon + meminfo.inactive_file));
else if (STREQ(line, "Active(anon)"))
- virBufferAsprintf(new_meminfo, "Active(anon): %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "Active(anon): %8llu kB\n",
meminfo.active_anon);
else if (STREQ(line, "Inactive(anon)"))
- virBufferAsprintf(new_meminfo, "Inactive(anon): %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "Inactive(anon): %8llu kB\n",
meminfo.inactive_anon);
else if (STREQ(line, "Active(file)"))
- virBufferAsprintf(new_meminfo, "Active(file): %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "Active(file): %8llu kB\n",
meminfo.active_file);
else if (STREQ(line, "Inactive(file)"))
- virBufferAsprintf(new_meminfo, "Inactive(file): %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "Inactive(file): %8llu kB\n",
meminfo.inactive_file);
else if (STREQ(line, "Unevictable"))
- virBufferAsprintf(new_meminfo, "Unevictable: %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "Unevictable: %8llu kB\n",
meminfo.unevictable);
else if (STREQ(line, "SwapTotal") && def->mem.swap_hard_limit)
- virBufferAsprintf(new_meminfo, "SwapTotal: %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "SwapTotal: %8llu kB\n",
(meminfo.swaptotal - meminfo.memtotal));
else if (STREQ(line, "SwapFree") && def->mem.swap_hard_limit)
- virBufferAsprintf(new_meminfo, "SwapFree: %8llu KB\n",
+ virBufferAsprintf(new_meminfo, "SwapFree: %8llu kB\n",
(meminfo.swaptotal - meminfo.memtotal -
meminfo.swapusage + meminfo.memusage));
else {
--
1.8.2.1
11 years, 3 months
[libvirt] [PATCH 0/5] Change preference of default PCI passthrough type
by Peter Krempa
Change the default type to VFIO if available.
Please note that the majority of the code here is only compile tested as
I don't have appropriate hardware to test it.
Peter Krempa (5):
qemu: hostdev: Refactor PCI passhrough handling
qemu: hostdev: Add checks if PCI passthrough is availabe in the host
qemu: hotplug: Verify that the selected pci passhtrough option is
present
qemu: Check if PCI passhtrough is available in the host when starting
qemu: Prefer VFIO for PCI device passthrough
docs/formatdomain.html.in | 9 ++-
src/conf/domain_conf.h | 2 +-
src/qemu/qemu_command.c | 27 +++++---
src/qemu/qemu_hostdev.c | 76 ++++++++++++++++++++++
src/qemu/qemu_hostdev.h | 3 +
src/qemu/qemu_hotplug.c | 63 +++++++++++++++---
src/qemu/qemu_process.c | 57 ++++++++++++++++
.../qemuxml2argv-hostdev-pci-address-device.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-net-hostdev.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-pci-rom.args | 4 +-
10 files changed, 216 insertions(+), 29 deletions(-)
--
1.8.3.2
11 years, 3 months