[libvirt] [PATCH 0/3] docs/Makefile.am cleanups
by Ján Tomko
The effect of 2/3 will be more apparent after apibuild.py speedups
(to be written).
Ján Tomko (3):
docs/Makefile.am: remove redundant variables
docs/Makefile.am: build hvsupport.html earlier
docs: drop todo.html
.gitignore | 1 -
docs/Makefile.am | 44 +++---------------
docs/sitemap.html.in | 4 --
docs/todo.cfg-example | 26 -----------
docs/todo.pl | 125 --------------------------------------------------
5 files changed, 7 insertions(+), 193 deletions(-)
delete mode 100644 docs/todo.cfg-example
delete mode 100755 docs/todo.pl
--
2.7.3
8 years, 3 months
[libvirt] [PATCH] 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>
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>
---
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..56dbdfb66fa2
--- /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, 3 months
[libvirt] [PATCH] util: Expose virHostCPUStatsAssign on non-Linux
by Martin Kletzander
There is nothing Linux-specific in that function. Also since commit
8c3b5bf48123783b812b97360db7ac51f1889e17 mingw build is broken due to
the fact that this function is not compiled in the library.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Pushed as trivial build-breaker fix.
src/util/virhostcpu.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index 856d83c3e49b..f68176f387ec 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -781,21 +781,6 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
return ret;
}
-int
-virHostCPUStatsAssign(virNodeCPUStatsPtr param,
- const char *name,
- unsigned long long value)
-{
- if (virStrcpyStatic(param->field, name) == NULL) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("kernel cpu time field is too long"
- " for the destination"));
- return -1;
- }
- param->value = value;
- return 0;
-}
-
# define TICK_TO_NSEC (1000ull * 1000ull * 1000ull / sysconf(_SC_CLK_TCK))
int
@@ -953,6 +938,22 @@ virHostCPUParseMapLinux(int max_cpuid, const char *path)
int
+virHostCPUStatsAssign(virNodeCPUStatsPtr param,
+ const char *name,
+ unsigned long long value)
+{
+ if (virStrcpyStatic(param->field, name) == NULL) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("kernel cpu time field is too long"
+ " for the destination"));
+ return -1;
+ }
+ param->value = value;
+ return 0;
+}
+
+
+int
virHostCPUGetInfo(virArch hostarch ATTRIBUTE_UNUSED,
unsigned int *cpus ATTRIBUTE_UNUSED,
unsigned int *mhz ATTRIBUTE_UNUSED,
--
2.10.0
8 years, 3 months
[libvirt] [PATCH v1 1/1] qemu/gluster: add option for tuning debug logging level
by Prasanna Kumar Kalever
This helps in selecting log level of the gluster gfapi, output to stderr.
The option is 'qemu_gfapi_debuglevel', can be tuned by editing
'/etc/libvirt/qemu.conf'
Debug levels ranges 0-9, with 9 being the most verbose, and 0 representing
no debugging output. The default is the same as it was before, which
is a level of 4. The current logging levels defined in the gluster
gfapi are:
0 - None
1 - Emergency
2 - Alert
3 - Critical
4 - Error
5 - Warning
6 - Notice
7 - Info
8 - Debug
9 - Trace
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever(a)redhat.com>
--
v1: Initial post
---
src/qemu/qemu.conf | 20 ++++++++++++++++++++
src/qemu/qemu_command.c | 12 +++++++++++-
src/qemu/qemu_conf.c | 3 +++
src/qemu/qemu_conf.h | 1 +
src/util/virstoragefile.h | 2 ++
5 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index e4c2aae..c6c8f3a 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -621,3 +621,23 @@
# rollover when a size limit is hit.
#
#stdio_handler = "logd"
+
+# Qemu gluster libgfapi log level, debug levels are 0-9, with 9 being the
+# most verbose, and 0 representing no debugging output.
+#
+# The current logging levels defined in the gluster GFAPI are:
+#
+# 0 - None
+# 1 - Emergency
+# 2 - Alert
+# 3 - Critical
+# 4 - Error
+# 5 - Warning
+# 6 - Notice
+# 7 - Info
+# 8 - Debug
+# 9 - Trace
+#
+# Defaults to 4
+#
+# qemu_gfapi_debuglevel = 9
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3a61863..650eedc 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -859,6 +859,7 @@ qemuBuildGlusterDriveJSON(virStorageSourcePtr src)
/* { driver:"gluster",
* volume:"testvol",
* path:"/a.img",
+ * debug:9,
* server :[{type:"tcp", host:"1.2.3.4", port:24007},
* {type:"unix", socket:"/tmp/glusterd.socket"}, ...]}
*/
@@ -866,6 +867,7 @@ qemuBuildGlusterDriveJSON(virStorageSourcePtr src)
"s:driver", protocol,
"s:volume", src->volume,
"s:path", src->path,
+ "u:debug", src->debug_level,
"a:server", servers, NULL) < 0)
virJSONValueFree(servers);
@@ -2177,6 +2179,7 @@ qemuBuildDriveDevStr(const virDomainDef *def,
static int
qemuBuildDiskDriveCommandLine(virCommandPtr cmd,
+ virQEMUDriverConfigPtr cfg,
const virDomainDef *def,
virQEMUCapsPtr qemuCaps)
{
@@ -2255,6 +2258,13 @@ qemuBuildDiskDriveCommandLine(virCommandPtr cmd,
virCommandAddArg(cmd, "-drive");
+ if (disk->src &&
+ disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_GLUSTER) {
+ if(cfg->qemuGfapiDebugLevel) {
+ disk->src->debug_level = cfg->qemuGfapiDebugLevel;
+ }
+ }
+
if (!(optstr = qemuBuildDriveStr(disk, driveBoot, qemuCaps)))
return -1;
virCommandAddArg(cmd, optstr);
@@ -9613,7 +9623,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
if (qemuBuildHubCommandLine(cmd, def, qemuCaps) < 0)
goto error;
- if (qemuBuildDiskDriveCommandLine(cmd, def, qemuCaps) < 0)
+ if (qemuBuildDiskDriveCommandLine(cmd, cfg, def, qemuCaps) < 0)
goto error;
if (qemuBuildFSDevCommandLine(cmd, def, qemuCaps) < 0)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index dad8334..d245cec 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -311,6 +311,7 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
cfg->seccompSandbox = -1;
cfg->logTimestamp = true;
+ cfg->qemuGfapiDebugLevel = 4;
cfg->stdioLogD = true;
#ifdef DEFAULT_LOADER_NVRAM
@@ -780,6 +781,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
}
}
+ if (virConfGetValueUInt(conf, "qemu_gfapi_debuglevel", &cfg->qemuGfapiDebugLevel) < 0)
+ goto cleanup;
ret = 0;
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index d8232cc..fe70d9b 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -190,6 +190,7 @@ struct _virQEMUDriverConfig {
virFirmwarePtr *firmwares;
size_t nfirmwares;
+ unsigned int qemuGfapiDebugLevel;
};
/* Main driver state */
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index 3d09468..9f3add3 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -237,6 +237,8 @@ struct _virStorageSource {
virStorageAuthDefPtr auth;
virStorageEncryptionPtr encryption;
+ unsigned int debug_level;
+
char *driverName;
int format; /* virStorageFileFormat in domain backing chains, but
* pool-specific enum for storage volumes */
--
2.7.4
8 years, 3 months
[libvirt] [PATCH v2 1/1] [WIP] qemu/gluster: add option for tuning debug logging level
by Prasanna Kumar Kalever
This helps in selecting log level of the gluster gfapi, output to stderr.
The option is 'qemu_gfapi_debuglevel', can be tuned by editing
'/etc/libvirt/qemu.conf'
Debug levels ranges 0-9, with 9 being the most verbose, and 0 representing
no debugging output. The default is the same as it was before, which
is a level of 4. The current logging levels defined in the gluster
gfapi are:
0 - None
1 - Emergency
2 - Alert
3 - Critical
4 - Error
5 - Warning
6 - Notice
7 - Info
8 - Debug
9 - Trace
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever(a)redhat.com>
--
v2:
Modify test cases and syntax check changes as suggested by Peter in v1.
Rename qemu_gfapi_debuglevel to glusterfs_debug_level as per Daniel comments.
Fix to make debug_level changes effects on URI along with JSON.
TODO:
* changes in libvirtd_qemu.aug
Which I don't understand for now
* comment on debug_level variable in storage source
Not sure what is the right place
* Capablities check
v1:
Initial post
---
src/qemu/qemu.conf | 20 ++++++++++++++++++++
src/qemu/qemu_command.c | 14 +++++++++++++-
src/qemu/qemu_conf.c | 3 +++
src/qemu/qemu_conf.h | 1 +
src/util/virstoragefile.h | 2 ++
.../qemuargv2xml-disk-drive-network-gluster.args | 7 ++++---
.../qemuxml2argv-disk-drive-network-gluster.args | 12 ++++++------
7 files changed, 49 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index e4c2aae..a6cdcf3 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -621,3 +621,23 @@
# rollover when a size limit is hit.
#
#stdio_handler = "logd"
+
+# Qemu gluster libgfapi log level, debug levels are 0-9, with 9 being the
+# most verbose, and 0 representing no debugging output.
+#
+# The current logging levels defined in the gluster GFAPI are:
+#
+# 0 - None
+# 1 - Emergency
+# 2 - Alert
+# 3 - Critical
+# 4 - Error
+# 5 - Warning
+# 6 - Notice
+# 7 - Info
+# 8 - Debug
+# 9 - Trace
+#
+# Defaults to 4
+#
+# glusterfs_debug_level = 9
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3a61863..c333795 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1383,6 +1383,11 @@ qemuBuildDriveSourceStr(virDomainDiskDefPtr disk,
}
virBufferAddLit(buf, ",");
+ if (disk->src &&
+ disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_GLUSTER) {
+ virBufferAsprintf(buf, "file.debug=%d,", disk->src->debug_level);
+ }
+
if (secinfo && secinfo->type == VIR_DOMAIN_SECRET_INFO_TYPE_AES) {
/* NB: If libvirt starts using the more modern option based
* syntax to build the command line (e.g., "-drive driver=rbd,
@@ -2177,6 +2182,7 @@ qemuBuildDriveDevStr(const virDomainDef *def,
static int
qemuBuildDiskDriveCommandLine(virCommandPtr cmd,
+ virQEMUDriverConfigPtr cfg,
const virDomainDef *def,
virQEMUCapsPtr qemuCaps)
{
@@ -2255,6 +2261,12 @@ qemuBuildDiskDriveCommandLine(virCommandPtr cmd,
virCommandAddArg(cmd, "-drive");
+ if (disk->src &&
+ disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_GLUSTER) {
+ if (cfg->glusterfsDebugLevel)
+ disk->src->debug_level = cfg->glusterfsDebugLevel;
+ }
+
if (!(optstr = qemuBuildDriveStr(disk, driveBoot, qemuCaps)))
return -1;
virCommandAddArg(cmd, optstr);
@@ -9613,7 +9625,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
if (qemuBuildHubCommandLine(cmd, def, qemuCaps) < 0)
goto error;
- if (qemuBuildDiskDriveCommandLine(cmd, def, qemuCaps) < 0)
+ if (qemuBuildDiskDriveCommandLine(cmd, cfg, def, qemuCaps) < 0)
goto error;
if (qemuBuildFSDevCommandLine(cmd, def, qemuCaps) < 0)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index dad8334..ff2b58e 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -311,6 +311,7 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
cfg->seccompSandbox = -1;
cfg->logTimestamp = true;
+ cfg->glusterfsDebugLevel = 4;
cfg->stdioLogD = true;
#ifdef DEFAULT_LOADER_NVRAM
@@ -780,6 +781,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
}
}
+ if (virConfGetValueUInt(conf, "glusterfs_debug_level", &cfg->glusterfsDebugLevel) < 0)
+ goto cleanup;
ret = 0;
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index d8232cc..89d046d 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -190,6 +190,7 @@ struct _virQEMUDriverConfig {
virFirmwarePtr *firmwares;
size_t nfirmwares;
+ unsigned int glusterfsDebugLevel;
};
/* Main driver state */
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index 3d09468..9f3add3 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -237,6 +237,8 @@ struct _virStorageSource {
virStorageAuthDefPtr auth;
virStorageEncryptionPtr encryption;
+ unsigned int debug_level;
+
char *driverName;
int format; /* virStorageFileFormat in domain backing chains, but
* pool-specific enum for storage volumes */
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-gluster.args b/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-gluster.args
index f560308..deec7a7 100644
--- a/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-gluster.args
+++ b/tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-gluster.args
@@ -16,9 +16,10 @@ QEMU_AUDIO_DRV=none \
-no-acpi \
-boot c \
-usb \
--drive file=gluster://example.org:6000/Volume1/Image,format=raw,if=virtio \
--drive 'file=gluster+unix:///Volume2/Image?socket=/path/to/sock,format=raw,\
-if=virtio' \
+-drive file=gluster://example.org:6000/Volume1/Image,file.debug=4,format=raw,\
+if=virtio \
+-drive 'file=gluster+unix:///Volume2/Image?socket=/path/to/sock,file.debug=4,\
+format=raw,if=virtio' \
-net none \
-serial none \
-parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.args
index 634ed75..cd5294e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.args
@@ -17,18 +17,18 @@ QEMU_AUDIO_DRV=none \
-no-acpi \
-boot c \
-usb \
--drive file=gluster://example.org:6000/Volume1/Image,format=raw,if=none,\
-id=drive-virtio-disk0 \
+-drive file=gluster://example.org:6000/Volume1/Image,file.debug=4,format=raw,\
+if=none,id=drive-virtio-disk0 \
-device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,\
id=virtio-disk0 \
--drive 'file=gluster+unix:///Volume2/Image?socket=/path/to/sock,format=raw,\
-if=none,id=drive-virtio-disk1' \
+-drive 'file=gluster+unix:///Volume2/Image?socket=/path/to/sock,file.debug=4,\
+format=raw,if=none,id=drive-virtio-disk1' \
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,\
id=virtio-disk1 \
-drive file.driver=gluster,file.volume=Volume3,file.path=/Image.qcow2,\
file.server.0.type=tcp,file.server.0.host=example.org,file.server.0.port=6000,\
file.server.1.type=tcp,file.server.1.host=example.org,file.server.1.port=24007,\
-file.server.2.type=unix,file.server.2.socket=/path/to/sock,format=qcow2,\
-if=none,id=drive-virtio-disk2 \
+file.server.2.type=unix,file.server.2.socket=/path/to/sock,file.debug=4,\
+format=qcow2,if=none,id=drive-virtio-disk2 \
-device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk2,\
id=virtio-disk2
--
2.7.4
8 years, 3 months
[libvirt] [PATCH 0/8] test driver: Added new functions.
by Tomáš Ryšavý
Added few functions into test driver.
Tomáš Ryšavý (8):
virhostcpu: Expose virHostCPUStatsAssign
test driver: Replaced num by a constant.
test driver: Implement virConnectGetSysinfo.
test driver: Implement virConnectGetType.
test driver: Implement testNodeGetCPUStats
test driver: Implement testNodeGetFreeMemory
test driver: added pages sizes into XML into test driver.
test driver: Implement testNodeGetFreePages.
src/libvirt_private.syms | 1 +
src/test/test_driver.c | 148 +++++++++++++++++++++++++++++++++++++++++++++--
src/util/virhostcpu.c | 2 +-
src/util/virhostcpu.h | 4 ++
4 files changed, 148 insertions(+), 7 deletions(-)
--
2.9.3
8 years, 3 months
[libvirt] [PATCH v4] virsh: use virConnectGetDomainCapabilities with maxvcpus
by Shivaprasad G Bhat
virsh maxvcpus --type kvm output is useless on PPC. Also, in
commit e6806d79 we documented not rely on virConnectGetMaxVcpus
output. Fix the maxvcpus to use virConnectGetDomainCapabilities
now to make it useful. The call is made to use the default emulator
binary and to check for the host machine and arch which is what the
command intends to show anyway.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
tools/virsh-host.c | 34 +++++++++++++++++++++++++++++++---
1 file changed, 31 insertions(+), 3 deletions(-)
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 57f0c0e..dbdf23d 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -606,18 +606,46 @@ static bool
cmdMaxvcpus(vshControl *ctl, const vshCmd *cmd)
{
const char *type = NULL;
- int vcpus;
+ int vcpus = -1;
+ char *caps = NULL;
+ const unsigned int flags = 0; /* No flags so far */
+ xmlDocPtr xml = NULL;
+ xmlXPathContextPtr ctxt = NULL;
virshControlPtr priv = ctl->privData;
if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
return false;
- if ((vcpus = virConnectGetMaxVcpus(priv->conn, type)) < 0)
+ caps = virConnectGetDomainCapabilities(priv->conn, NULL, NULL, NULL, type, flags);
+ if (!caps) {
+ if (last_error && last_error->code != VIR_ERR_NO_SUPPORT)
+ return false;
+
+ vshResetLibvirtError();
+ goto fallback;
+ }
+
+ xml = virXMLParseStringCtxt(caps, _("(domainCapabilities)"), &ctxt);
+ if (!xml) {
+ VIR_FREE(caps);
return false;
+ }
- vshPrint(ctl, "%d\n", vcpus);
+ virXPathInt("string(./vcpu[1]/@max)", ctxt, &vcpus);
+ xmlXPathFreeContext(ctxt);
+ xmlFreeDoc(xml);
+ VIR_FREE(caps);
+ if (vcpus < 0)
+ goto fallback;
+
+ exit:
+ vshPrint(ctl, "%d\n", vcpus);
return true;
+ fallback:
+ if ((vcpus = virConnectGetMaxVcpus(priv->conn, type)) < 0)
+ return false;
+ goto exit;
}
/*
8 years, 3 months
[libvirt] [PATCH] tests: Use fixedcontent variable
by Martin Kletzander
Commit ca32929908bbc94116493ad8915e7cd7ae0f57d5 added function
virTestCompareToFile(), but forgot to use a fixedcontent value for the
actual comparison. That lead to VIR_TEST_DEBUG=1 showing (for some
tests) all the actual output from the first error to the end of the
string due to the difference being an endline in the end.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Pushed as 'trivial'.
tests/testutils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/testutils.c b/tests/testutils.c
index 8ea6ab82ad5a..f87628edee68 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -709,7 +709,7 @@ virTestCompareToFile(const char *strcontent,
filecontent)) {
virTestDifferenceFull(stderr,
filecontent, filename,
- strcontent, NULL);
+ fixedcontent, NULL);
goto failure;
}
--
2.10.0
8 years, 3 months
Re: [libvirt] [PATCH 8/8] fspools: docs and tests for fspool directory backend
by Olga Krishtal
Hello again.
Please, drop the commit message for this patch.
Use the following one:
Added XML 2 XML tests for fspool and item.
________________________________
From: Olga Krishtal
Sent: Thursday, September 15, 2016 10:39:01 AM
To: openstack-devel
Cc: Maxim Nestratov; Nikolay Shirokovskiy
Subject: Re: [PATCH 8/8] fspools: docs and tests for fspool directory backend
On 26/08/16 17:17, Olga Krishtal wrote:
Pleas, drop the commit message, test is present for both: item and fspool.
> At the moment only pool test is implemented.
> You need to inplement item test.
>
> Signed-off-by: Olga Krishtal <okrishtal(a)virtuozzo.com>
> ---
> docs/schemas/fsitem.rng | 69 ++++++++++++++
> docs/schemas/fspool.rng | 83 ++++++++++++++++
> tests/fsitemxml2xmltest.c | 105 +++++++++++++++++++++
> .../dir-missing-target-path-invalid.xml | 12 +++
> tests/fspoolxml2xmlin/fspool-dir.xml | 17 ++++
> tests/fspoolxml2xmlout/fspool-dir.xml | 17 ++++
> tests/fspoolxml2xmltest.c | 82 ++++++++++++++++
> 7 files changed, 385 insertions(+)
> create mode 100644 docs/schemas/fsitem.rng
> create mode 100644 docs/schemas/fspool.rng
> create mode 100644 tests/fsitemxml2xmltest.c
> create mode 100644 tests/fspoolschemadata/dir-missing-target-path-invalid.xml
> create mode 100644 tests/fspoolxml2xmlin/fspool-dir.xml
> create mode 100644 tests/fspoolxml2xmlout/fspool-dir.xml
> create mode 100644 tests/fspoolxml2xmltest.c
>
> diff --git a/docs/schemas/fsitem.rng b/docs/schemas/fsitem.rng
> new file mode 100644
> index 0000000..a41659c
> --- /dev/null
> +++ b/docs/schemas/fsitem.rng
> @@ -0,0 +1,69 @@
> +<?xml version="1.0"?>
> +<!-- A Relax NG schema for the libvirt storage volume XML format -->
> +<grammar xmlns="http://relaxng.org/ns/structure/1.0"
> + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
> + <include href='basictypes.rng'/>
> + <start>
> + <ref name='vol'/>
> + </start>
> +
> + <include href='storagecommon.rng'/>
> +
> +
> + <define name='item'>
> + <element name='fsitem'>
> + <optional>
> + <attribute name='type'>
> + <value>dir</value>
> + </attribute>
> + </optional>
> + <interleave>
> + <element name='name'>
> + <ref name='volName'/>
> + </element>
> + <optional>
> + <element name='key'>
> + <text/>
> + </element>
> + </optional>
> + <ref name='sizing'/>
> + <ref name='target'/>
> + </interleave>
> + </element>
> + </define>
> +
> + <define name='sizing'>
> + <interleave>
> + <optional>
> + <element name='capacity'>
> + <ref name='scaledInteger'/>
> + </element>
> + </optional>
> + <optional>
> + <element name='allocation'>
> + <ref name='scaledInteger'/>
> + </element>
> + </optional>
> + </interleave>
> + </define>
> +
> + <define name='target'>
> + <element name='target'>
> + <interleave>
> + <optional>
> + <element name='path'>
> + <choice>
> + <data type='anyURI'/>
> + <ref name='absFilePath'/>
> + </choice>
> + </element>
> + </optional>
> + <ref name='permissions'/>
> + <optional>
> + <ref name='fileFormatFeatures'/>
> + </optional>
> + </interleave>
> + </element>
> + </define>
> +
> +</grammar>
> diff --git a/docs/schemas/fspool.rng b/docs/schemas/fspool.rng
> new file mode 100644
> index 0000000..132b65c
> --- /dev/null
> +++ b/docs/schemas/fspool.rng
> @@ -0,0 +1,83 @@
> +<?xml version="1.0"?>
> +<!-- A Relax NG schema for the libvirt storage pool XML format -->
> +<grammar xmlns="http://relaxng.org/ns/structure/1.0"
> + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
> + <include href='basictypes.rng'/>
> + <include href='storagecommon.rng'/>
> + <start>
> + <ref name='pool'/>
> + </start>
> +
> +
> + <define name='fspool'>
> + <element name='fspool'>
> + <choice>
> + <ref name='fspooldir'/>
> + </choice>
> + </element>
> + </define>
> +
> + <define name='fspooldir'>
> + <attribute name='type'>
> + <value>dir</value>
> + </attribute>
> + <interleave>
> + <ref name='commonmetadata'/>
> + <ref name='sizing'/>
> + <ref name='sourcedir'/>
> + <ref name='target'/>
> + </interleave>
> + </define>
> +
> + <define name='commonmetadata'>
> + <interleave>
> + <element name='name'>
> + <ref name='genericName'/>
> + </element>
> + <optional>
> + <element name='uuid'>
> + <ref name='UUID'/>
> + </element>
> + </optional>
> + </interleave>
> + </define>
> +
> + <define name='sizing'>
> + <interleave>
> + <optional>
> + <element name='capacity'>
> + <ref name='scaledInteger'/>
> + </element>
> + </optional>
> + <optional>
> + <element name='allocation'>
> + <ref name='scaledInteger'/>
> + </element>
> + </optional>
> + <optional>
> + <element name='available'>
> + <ref name='scaledInteger'/>
> + </element>
> + </optional>
> + </interleave>
> + </define>
> +
> + <define name='target'>
> + <element name='target'>
> + <interleave>
> + <element name='path'>
> + <ref name='absFilePath'/>
> + </element>
> + <ref name='permissions'/>
> + </interleave>
> + </element>
> + </define>
> +
> + <define name='sourcedir'>
> + <optional>
> + <element name='source'>
> + </element>
> + </optional>
> + </define>
> +
> +</grammar>
> diff --git a/tests/fsitemxml2xmltest.c b/tests/fsitemxml2xmltest.c
> new file mode 100644
> index 0000000..87a24e3
> --- /dev/null
> +++ b/tests/fsitemxml2xmltest.c
> @@ -0,0 +1,105 @@
> +#include <config.h>
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +#include <string.h>
> +
> +#include <sys/types.h>
> +#include <fcntl.h>
> +
> +#include "internal.h"
> +#include "testutils.h"
> +#include "storage_conf.h"
> +#include "testutilsqemu.h"
> +#include "virstring.h"
> +
> +#define VIR_FROM_THIS VIR_FROM_NONE
> +
> +static int
> +testCompareXMLToXMLFiles(const char *poolxml, const char *inxml,
> + const char *outxml, unsigned int flags)
> +{
> + char *actual = NULL;
> + int ret = -1;
> + virFSPoolDefPtr pool = NULL;
> + virFSItemDefPtr dev = NULL;
> +
> + if (!(pool = virFSPoolDefParseFile(poolxml)))
> + goto fail;
> +
> + if (!(dev = virFSItemDefParseFile(pool, inxml, flags)))
> + goto fail;
> +
> + if (!(actual = virFSItemDefFormat(pool, dev)))
> + goto fail;
> +
> + if (virTestCompareToFile(actual, outxml) < 0)
> + goto fail;
> +
> + ret = 0;
> +
> + fail:
> + VIR_FREE(actual);
> + virFSPoolDefFree(pool);
> + virFSItemDefFree(dev);
> + return ret;
> +}
> +
> +struct testInfo {
> + const char *pool;
> + const char *name;
> + unsigned int flags;
> +};
> +
> +static int
> +testCompareXMLToXMLHelper(const void *data)
> +{
> + int result = -1;
> + const struct testInfo *info = data;
> + char *poolxml = NULL;
> + char *inxml = NULL;
> + char *outxml = NULL;
> +
> + if (virAsprintf(&poolxml, "%s/storagepoolxml2xmlin/%s.xml",
> + abs_srcdir, info->pool) < 0 ||
> + virAsprintf(&inxml, "%s/storagevolxml2xmlin/%s.xml",
> + abs_srcdir, info->name) < 0 ||
> + virAsprintf(&outxml, "%s/storagevolxml2xmlout/%s.xml",
> + abs_srcdir, info->name) < 0) {
> + goto cleanup;
> + }
> +
> + result = testCompareXMLToXMLFiles(poolxml, inxml, outxml, info->flags);
> +
> + cleanup:
> + VIR_FREE(poolxml);
> + VIR_FREE(inxml);
> + VIR_FREE(outxml);
> +
> + return result;
> +}
> +
> +
> +static int
> +mymain(void)
> +{
> + int ret = 0;
> +
> +#define DO_TEST_FULL(pool, name, flags) \
> + do { \
> + struct testInfo info = { pool, name, flags }; \
> + if (virTestRun("FS Item XML-2-XML " name, \
> + testCompareXMLToXMLHelper, &info) < 0) \
> + ret = -1; \
> + } \
> + while (0);
> +
> +#define DO_TEST(pool, name) DO_TEST_FULL(pool, name, 0)
> +
> + DO_TEST("pool-dir", "vol-file");
> +
> + return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
> +}
> +
> +VIRT_TEST_MAIN(mymain)
> diff --git a/tests/fspoolschemadata/dir-missing-target-path-invalid.xml b/tests/fspoolschemadata/dir-missing-target-path-invalid.xml
> new file mode 100644
> index 0000000..a52bf49
> --- /dev/null
> +++ b/tests/fspoolschemadata/dir-missing-target-path-invalid.xml
> @@ -0,0 +1,12 @@
> +<fspool type='dir'>
> + <name>test</name>
> + <source>
> + </source>
> + <target>
> + <permissions>
> + <mode>0700</mode>
> + <owner>-1</owner>
> + <group>-1</group>
> + </permissions>
> + </target>
> +</fspool>
> diff --git a/tests/fspoolxml2xmlin/fspool-dir.xml b/tests/fspoolxml2xmlin/fspool-dir.xml
> new file mode 100644
> index 0000000..a3a1639
> --- /dev/null
> +++ b/tests/fspoolxml2xmlin/fspool-dir.xml
> @@ -0,0 +1,17 @@
> +<fspool type='dir'>
> + <name>virtfs</name>
> + <uuid>5584ee21-db40-4e98-980e-44802c47b62f</uuid>
> + <capacity unit='bytes'>0</capacity>
> + <allocation unit='bytes'>0</allocation>
> + <available unit='bytes'>0</available>
> + <source>
> + </source>
> + <target>
> + <path>///var/////lib/libvirt/fs//</path>
> + <permissions>
> + <mode>0700</mode>
> + <owner>-1</owner>
> + <group>-1</group>
> + </permissions>
> + </target>
> +</fspool>
> diff --git a/tests/fspoolxml2xmlout/fspool-dir.xml b/tests/fspoolxml2xmlout/fspool-dir.xml
> new file mode 100644
> index 0000000..30aca89
> --- /dev/null
> +++ b/tests/fspoolxml2xmlout/fspool-dir.xml
> @@ -0,0 +1,17 @@
> +<fspool type='dir'>
> + <name>virtfs</name>
> + <uuid> 5584ee21-db40-4e98-980e-44802c47b62f</uuid>
> + <capacity unit='bytes'>0</capacity>
> + <allocation unit='bytes'>0</allocation>
> + <available unit='bytes'>0</available>
> + <source>
> + </source>
> + <target>
> + <path>/var/lib/libvirt/fs</path>
> + <permissions>
> + <mode>0700</mode>
> + <owner>-1</owner>
> + <group>-1</group>
> + </permissions>
> + </target>
> +</fspool>
> diff --git a/tests/fspoolxml2xmltest.c b/tests/fspoolxml2xmltest.c
> new file mode 100644
> index 0000000..b66e959
> --- /dev/null
> +++ b/tests/fspoolxml2xmltest.c
> @@ -0,0 +1,82 @@
> +#include <config.h>
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +#include <string.h>
> +
> +#include <sys/types.h>
> +#include <fcntl.h>
> +
> +#include "internal.h"
> +#include "testutils.h"
> +#include "fs_conf.h"
> +#include "testutilsqemu.h"
> +#include "virstring.h"
> +
> +#define VIR_FROM_THIS VIR_FROM_NONE
> +
> +static int
> +testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
> +{
> + char *actual = NULL;
> + int ret = -1;
> + virFSPoolDefPtr dev = NULL;
> +
> + if (!(dev = virFSPoolDefParseFile(inxml)))
> + goto fail;
> +
> + if (!(actual = virFSPoolDefFormat(dev)))
> + goto fail;
> +
> + if (virTestCompareToFile(actual, outxml) < 0)
> + goto fail;
> +
> + ret = 0;
> +
> + fail:
> + VIR_FREE(actual);
> + virFSPoolDefFree(dev);
> + return ret;
> +}
> +
> +static int
> +testCompareXMLToXMLHelper(const void *data)
> +{
> + int result = -1;
> + char *inxml = NULL;
> + char *outxml = NULL;
> +
> + if (virAsprintf(&inxml, "%s/fspoolxml2xmlin/%s.xml",
> + abs_srcdir, (const char*)data) < 0 ||
> + virAsprintf(&outxml, "%s/fspoolxml2xmlout/%s.xml",
> + abs_srcdir, (const char*)data) < 0) {
> + goto cleanup;
> + }
> +
> + result = testCompareXMLToXMLFiles(inxml, outxml);
> +
> + cleanup:
> + VIR_FREE(inxml);
> + VIR_FREE(outxml);
> +
> + return result;
> +}
> +
> +static int
> +mymain(void)
> +{
> + int ret = 0;
> +
> +#define DO_TEST(name) \
> + if (virTestRun("FS Pool XML-2-XML " name, \
> + testCompareXMLToXMLHelper, (name)) < 0) \
> + ret = -1
> +
> + DO_TEST("pool-dir");
> +#endif
> +
> + return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
> +}
> +
> +VIRT_TEST_MAIN(mymain)
8 years, 3 months
[libvirt] [gnulib PATCH 0/2] Work around glibc 2.25 deprecation warnings
by Eric Blake
Fedora rawhide builds of libvirt.git at commit d53fa838^ failed
due to the new glibc 2.25 deprecation warning for use of major()
from just <sys/types.h>; I also found that the same warning is
provoked by gnulib's mountlist module. Libvirt commit d53fa838
was a temporary hack to work around the problem, and I will be
reverting that and updating to newer gnulib once this goes in.
I've tested that libvirt on Fedora rawhide with d53fa838 reverted
and gnulib updated to this commit was once again able to build.
Comments welcome, particularly for my choice of wording in
documentation changes. The final push will differ slightly from
this, especially if the autoconf patch going in first changes
slightly due to review there, but this should give a good idea
of the fix.
Eric Blake (2):
mountlist: include sysmacros.h for glibc
sys_types: avoid glibc 2.25 warnings about major()
ChangeLog | 15 +++++++++++++++
doc/glibc-functions/gnu_dev_major.texi | 4 ++++
doc/glibc-functions/gnu_dev_makedev.texi | 4 ++++
doc/glibc-functions/gnu_dev_minor.texi | 4 ++++
doc/posix-headers/sys_types.texi | 6 ++++++
lib/mountlist.c | 6 ++++++
m4/mountlist.m4 | 3 ++-
m4/sys_types_h.m4 | 27 ++++++++++++++++++++++++++-
8 files changed, 67 insertions(+), 2 deletions(-)
--
2.7.4
8 years, 3 months