[libvirt] [PATCH] qemu: Hide virQEMUCapsNewForBinary
by Jiri Denemark
Since virQEMUCapsNewForBinaryInternal was introduced,
virQEMUCapsNewForBinary is no longer used outside qemu_capabilities.c.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_capabilities.h | 5 -----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 6e6010d..4ed5b71 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3801,7 +3801,7 @@ virQEMUCapsNewForBinaryInternal(const char *binary,
return NULL;
}
-virQEMUCapsPtr
+static virQEMUCapsPtr
virQEMUCapsNewForBinary(const char *binary,
const char *libDir,
const char *cacheDir,
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 651f962..affb639 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -382,11 +382,6 @@ typedef virQEMUCapsCache *virQEMUCapsCachePtr;
virQEMUCapsPtr virQEMUCapsNew(void);
virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps);
-virQEMUCapsPtr virQEMUCapsNewForBinary(const char *binary,
- const char *libDir,
- const char *cacheDir,
- uid_t runUid,
- gid_t runGid);
int virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
qemuMonitorPtr mon);
--
2.9.0
8 years, 4 months
[libvirt] [PATCH 00/17] qemu: Assign addresses to USB devices
by Ján Tomko
Technically a v2, but it's been too long:
https://www.redhat.com/archives/libvir-list/2015-August/msg00521.html
With apologies to anyone who had read v1.
https://bugzilla.redhat.com/show_bug.cgi?id=1215968
Ján Tomko (17):
Format CCID controllers after USB hubs
Fix USB port in input-usbmouse test
Add a USB hub to controller order test
Add a test for long USB port paths
Split out USB port parsing
Use for instead of code duplication when parsing USB port
Store USB port path as an array of integers
Do not call postParse with ABI_UPDATE when parsing cmdline
Add newDomain parameter to qemuDomainAssignAddresses
Introduce virDomainUSBAddressSet
Add functions for adding USB controllers to addrs
Add functions for adding USB hubs to addrs
Reserve existing USB addresses
Assign addresses to USB devices
Auto-add one hub if there are too many USB devices
Add USB disk to hotplug-base
Assign addresses on USB device hotplug
src/conf/device_conf.h | 5 +-
src/conf/domain_addr.c | 481 +++++++++++++++++++++
src/conf/domain_addr.h | 55 +++
src/conf/domain_conf.c | 125 +++++-
src/conf/domain_conf.h | 6 +
src/libvirt_private.syms | 11 +
src/qemu/qemu_command.c | 33 +-
src/qemu/qemu_domain.c | 3 +-
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_domain_address.c | 126 +++++-
src/qemu/qemu_domain_address.h | 3 +-
src/qemu/qemu_hotplug.c | 27 ++
src/qemu/qemu_parse_command.c | 3 +-
src/qemu/qemu_process.c | 7 +-
tests/qemuhotplugtest.c | 2 +-
...otplug-console-compat-2-live+console-virtio.xml | 1 +
.../qemuhotplug-hotplug-base-live+disk-usb.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-bios-nvram.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-bios.args | 2 +-
.../qemuxml2argv-console-compat-2-live.xml | 1 +
.../qemuxml2argv-console-compat-2.xml | 4 +-
.../qemuxml2argv-controller-order.args | 7 +-
.../qemuxml2argv-controller-order.xml | 1 +
.../qemuxml2argv-disk-usb-device-removable.args | 3 +-
.../qemuxml2argv-disk-usb-device.args | 2 +-
.../qemuxml2argv-graphics-spice-timeout.args | 2 +-
...muxml2argv-hostdev-usb-address-device-boot.args | 2 +-
.../qemuxml2argv-hostdev-usb-address-device.args | 2 +-
.../qemuxml2argv-hostdev-usb-address.args | 2 +-
.../qemuxml2argv-hotplug-base.args | 5 +-
.../qemuxml2argvdata/qemuxml2argv-hotplug-base.xml | 8 +
.../qemuxml2argv-hugepages-numa.args | 2 +-
.../qemuxml2argv-input-usbmouse-addr.args | 2 +-
.../qemuxml2argv-input-usbmouse-addr.xml | 2 +-
.../qemuxml2argv-input-usbmouse.args | 2 +-
.../qemuxml2argv-input-usbtablet.args | 2 +-
.../qemuxml2argv-pseries-usb-kbd.args | 2 +-
.../qemuxml2argv-serial-spiceport.args | 2 +-
.../qemuxml2argv-smartcard-controller.args | 2 +-
.../qemuxml2argv-smartcard-host-certificates.args | 2 +-
.../qemuxml2argv-smartcard-host.args | 2 +-
...emuxml2argv-smartcard-passthrough-spicevmc.args | 2 +-
.../qemuxml2argv-smartcard-passthrough-tcp.args | 2 +-
.../qemuxml2argv-sound-device.args | 2 +-
.../qemuxml2argv-usb-hub-autoadd.args | 28 ++
.../qemuxml2argv-usb-hub-autoadd.xml | 23 +
.../qemuxml2argv-usb-hub-conflict.xml | 22 +
.../qemuxml2argv-usb-long-port-path.args | 27 ++
.../qemuxml2argv-usb-long-port-path.xml | 30 ++
.../qemuxml2argv-usb-port-autoassign.args | 28 ++
.../qemuxml2argv-usb-port-autoassign.xml | 27 ++
...qemuxml2argv-usb-too-long-port-path-invalid.xml | 33 ++
tests/qemuxml2argvtest.c | 20 +-
53 files changed, 1139 insertions(+), 58 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-hub-autoadd.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-hub-autoadd.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-hub-conflict.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-long-port-path.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-long-port-path.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-port-autoassign.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-port-autoassign.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-too-long-port-path-invalid.xml
--
2.7.3
8 years, 4 months
[libvirt] [PATCH 2/2] Add new elements source, access and allocation
by Safka, JaroslavX
This change introduces support for preallocated shared file descriptor based memory backing.
It allows vhost-user to be used without hugepages. This is achieved by introducing 3 new sub elements to the memoryBacking element: source, access & allocation which will configure qemu commandline during VM startup accordingly.
First patch adds parsing of elements and storing the values in mem structure.
Second patch configures the qemu commandline on the base of values in mem structure.
--------------------------------------------------------------
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.
8 years, 4 months
[libvirt] [PATCH 0/7] Add APIs for individual vCPU state modification using the guest agent
by Peter Krempa
As a first step, add the guest-agent part. The real hotplug stuff will follow
shortly. Please note that the setter API will be used as template for the real
stuff too.
Peter Krempa (7):
rpcgen: Add support for generating funcs returning alloc'd typed
params
lib: Add API to query guest vcpu info using guest agent
lib: Add API to set individual vcpu usage in the guest via guest agent
virsh: Add command 'guestvcpus' implementing virDomain(GS)etGuestVcpus
qemu: agent: Make setting of vcpus more robust
qemu: Implement virDomainGetGuestVcpus
qemu: Implement virDomainSetGuestVcpus
include/libvirt/libvirt-domain.h | 10 ++
src/driver-hypervisor.h | 14 +++
src/libvirt-domain.c | 105 ++++++++++++++++++++
src/libvirt_public.syms | 2 +
src/qemu/qemu_agent.c | 83 +++++++++++++---
src/qemu/qemu_agent.h | 2 +
src/qemu/qemu_driver.c | 210 ++++++++++++++++++++++++++++++++++++---
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 39 +++++++-
src/remote_protocol-structs | 18 ++++
src/rpc/gendispatch.pl | 45 ++++++++-
tests/qemuagenttest.c | 44 ++++----
tools/virsh-domain.c | 93 +++++++++++++++++
tools/virsh.pod | 10 ++
14 files changed, 625 insertions(+), 52 deletions(-)
--
2.8.3
8 years, 4 months
[libvirt] [PATCH v2] There are several cases where we do not handle transient pool destroy and cleanup correctly. For example:
by Jovanka Gulicoska
https://bugzilla.redhat.com/show_bug.cgi?id=1227475
Move the pool cleanup logic to a new function storagePoolSetInactive and
use it consistently.
---
src/storage/storage_driver.c | 43 +++++++++++++++++++++++--------------------
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index e2d729f..2f29292 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -77,6 +77,21 @@ static void storageDriverUnlock(void)
}
static void
+storagePoolSetInactive(virStoragePoolObjPtr *pool)
+{
+ (*pool)->active = false;
+
+ if ((*pool)->configFile == NULL) {
+ virStoragePoolObjRemove(&driver->pools, (*pool));
+ *pool = NULL;
+ } else if ((*pool)->newDef) {
+ virStoragePoolDefFree((*pool)->def);
+ (*pool)->def = (*pool)->newDef;
+ (*pool)->newDef = NULL;
+ }
+}
+
+static void
storagePoolUpdateState(virStoragePoolObjPtr pool)
{
bool active;
@@ -115,16 +130,19 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
if (backend->refreshPool(NULL, pool) < 0) {
if (backend->stopPool)
backend->stopPool(NULL, pool);
+ active = false;
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to restart storage pool '%s': %s"),
pool->def->name, virGetLastErrorMessage());
goto error;
}
+ active = true;
}
- pool->active = active;
ret = 0;
error:
+ if (!active)
+ storagePoolSetInactive(&pool);
if (ret < 0) {
if (stateFile)
unlink(stateFile);
@@ -198,6 +216,7 @@ storageDriverAutostart(void)
unlink(stateFile);
if (backend->stopPool)
backend->stopPool(conn, pool);
+ storagePoolSetInactive(&pool);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to autostart storage pool '%s': %s"),
pool->def->name, virGetLastErrorMessage());
@@ -737,8 +756,7 @@ storagePoolCreateXML(virConnectPtr conn,
unlink(stateFile);
if (backend->stopPool)
backend->stopPool(conn, pool);
- virStoragePoolObjRemove(&driver->pools, pool);
- pool = NULL;
+ storagePoolSetInactive(&pool);
goto cleanup;
}
@@ -1068,16 +1086,7 @@ storagePoolDestroy(virStoragePoolPtr obj)
VIR_STORAGE_POOL_EVENT_STOPPED,
0);
- pool->active = false;
-
- if (pool->configFile == NULL) {
- virStoragePoolObjRemove(&driver->pools, pool);
- pool = NULL;
- } else if (pool->newDef) {
- virStoragePoolDefFree(pool->def);
- pool->def = pool->newDef;
- pool->newDef = NULL;
- }
+ storagePoolSetInactive(&pool);
ret = 0;
@@ -1197,13 +1206,7 @@ storagePoolRefresh(virStoragePoolPtr obj,
pool->def->uuid,
VIR_STORAGE_POOL_EVENT_STOPPED,
0);
- pool->active = false;
-
- if (pool->configFile == NULL) {
- virStoragePoolObjRemove(&driver->pools, pool);
- pool = NULL;
- }
- goto cleanup;
+ storagePoolSetInactive(&pool);
}
event = virStoragePoolEventLifecycleNew(pool->def->name,
--
2.5.5
8 years, 4 months
[libvirt] [PATCH 0/8] Add --in-place and --check to test-wrap-argv
by Ján Tomko
The --in-place parameter makes the invocation in testutils slightly nicer
and --check makes syntax-check faster.
Ján Tomko (8):
test-wrap-argv: split out rewrap_line
test-wrap-argv: split out rewrap_arg
test-wrap-argv: return a string in rewrap_arg
test-wrap-argv: use map and join instead of a for cycle
test-wrap-argv: return a string in rewrap_line
test-wrap-argv: hold a copy of the original file in an array
test-wrap-argv: add --in-place parameter
test-wrap-argv: add --check parameter
cfg.mk | 12 +---
tests/test-wrap-argv.pl | 170 ++++++++++++++++++++++++++++++------------------
tests/testutils.c | 8 +--
3 files changed, 108 insertions(+), 82 deletions(-)
--
2.7.3
8 years, 4 months
[libvirt] libvirt and VIR_WARN("cannot parse process status data")
by Vasiliy Tolstov
I have system with 3.19.3 kernel and libvirt 1.3.3 (version not matter
because part of code not changed).
When i'm try to get cpu stats via libvirt i have error in libvirt
log, that says "cannot parse process status data"
relevant code in src/qemu/qemu_driver.c
in function qemuGetProcessInfo
i'm add debut test to this function and in my case i have always fscanf != 4
qemu pid 7977
cat /proc/7977/stat
7977 (qemu-system-x86) S 1 7976 7976 0 -1 138420608 12728 0 0 0 4819
8249 0 0 20 0 7 0 51378692 4783886336 75779 18446744073709551615
139849472311296 139849478294132 140732912418880 140732912417952
139849400618495 0 268444224 4096 16963 18446744073709551615 0 0 17 5 0
0 15624 744 0 139849480394624 139849482248448 139849496641536
140732912421083 140732912422775 140732912422775 140732912422876 0
cat /proc/7977/task/7977/stat
7977 (qemu-system-x86) S 1 7976 7976 0 -1 138420608 12537 0 0 0 3917
7799 0 0 20 0 7 0 51378692 4783886336 75779 18446744073709551615
139849472311296 139849478294132 140732912418880 140732912417952
139849400618495 0 268444224 4096 16963 0 0 0 17 3 0 0 15624 0 0
139849480394624 139849482248448 139849496641536 140732912421083
140732912422775 140732912422775 140732912422876 0
cat /proc/7977/task/7979/stat
7979 (qemu-system-x86) S 1 7976 7976 0 -1 1077944384 20 0 0 0 0 0 0 0
20 0 7 0 51378696 4783886336 75779 18446744073709551615
139849472311296 139849478294132 140732912418880 139849260591832
139849400637449 0 2147221247 4096 16963 0 0 0 -1 6 0 0 0 0 0
139849480394624 139849482248448 139849496641536 140732912421083
140732912422775 140732912422775 140732912422876 0
cat /proc/7977/task/7982/stat
7982 (CPU 0/KVM) S 1 7976 7976 0 -1 138420416 22 0 0 0 226 118 0 0 20
0 7 0 51378697 4783886336 75779 18446744073709551615 139849472311296
139849478294132 140732912418880 139849222842936 139849400624151 0
2147220671 4096 16963 0 0 0 -1 5 0 0 0 196 0 139849480394624
139849482248448 139849496641536 140732912421083 140732912422775
140732912422775 140732912422876 0
Does somebody have time to fix this ?
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)yoctocloud.net
8 years, 4 months
[libvirt] [PATCH 0/3] Remove unused macros
by Ján Tomko
Ján Tomko (3):
Remove unused SOL_NETLINK macro
vbox: remove duplicate macros
vsh: remove namespace poisoning
src/util/virnetlink.c | 4 ----
src/vbox/vbox_driver.c | 2 --
src/vbox/vbox_network.c | 43 -------------------------------------------
tools/vsh.c | 6 ------
tools/vsh.h | 10 ----------
5 files changed, 65 deletions(-)
--
2.7.3
8 years, 4 months
[libvirt] [PATCH v5 0/3] qemu: expand domain memory statistics
by Maxim Nestratov
Changes since v1:
* Enum numeration fixed
* Macro getting "usage" field fixed
Changes since v2:
* previous patches were on wrong branch
* qemu's stat name was "stat-available-memory"
Changes since v3:
* 3rd patch added
Changes since v4:
* Formatted and rephrased commit messages
* fixed libvirt crash, caused by simultaneous incorrect QUERY job execution
Derbyshev Dmitry (3):
qemu: expand domain memory statistics with 'usable'
qemu: expand domain memory statistics with 'last-update' timestamp
qemu: return balloon statistics when all domain statistics reported
include/libvirt/libvirt-domain.h | 11 ++++-
src/libvirt-domain.c | 5 +++
src/qemu/qemu_driver.c | 95 +++++++++++++++++++++++++++++++---------
src/qemu/qemu_monitor_json.c | 24 ++++++----
tools/virsh-domain-monitor.c | 4 ++
5 files changed, 108 insertions(+), 31 deletions(-)
--
2.4.3
8 years, 4 months
[libvirt] qemu: cpu model definition problem
by Maxim Nestratov
Hi all,
I've just encountered a problem with ability to live migrate a VM
between hosts using the following cpu section in VM's xml:
<cpu mode='custom' match='exact'>
<model fallback='allow'>Haswell-noTSX</model>
...
<feature policy='disable' name='rdrand'/>
</cpu>
The problem is that a VM with such a config crashes when it migrates
from a host where 'rdrand' presents to a host where it is absent.
This happens due to the fact that QEMU and libvirt have pretty different
view on what 'Haswell-noTSX' is. Libvirt's description lacks some
features, which present in QEMU description of this cpu model (e.g.
'rdrand'). It is impossible to disable features present on the host and
different from QEMU's ones by current libvirt code, i.e. libvirt thinks
that no use to disable something that doesn't exist.
Of course, the problem in this case can be fixed just by adding missed
features to 'Haswell-noTSX' model in cpu_map.xml to match what QEMU has,
but it doesn't seem right because it will help just in this particular
case, and in general, it will not be a solution because QEMU can change
its cpu model definitions at any time and it does this from time to time.
What libvirt might have done is:
- either ask QEMU for cpu model definition and work with it,
- or construct a command line for QEMU with required and disabled
features without taking into account libvirt cpu_map.xml, i.e. always
add '+xx' and '-yy' for features mentioned explicitly in domain xml.
What do you think?
Maxim
8 years, 4 months