[libvirt] [PATCH 0/3] qemu: command: clean up default cpu formatting
by Cole Robinson
Just some minor patches to do with encoding a default CPU on the
qemu command line.
Patch 1 adds a test case
Patch 2 simplifies the code
Patch 3 throws an explicit error for a confusing situation
Cole Robinson (3):
tests: add qemu x86 kvm 32-on-64 test
qemu: command: rework adding of default cpu model
qemu: command: explicitly error for non-x86 default CPU
src/qemu/qemu_command.c | 95 +++++++++-------------
.../qemuxml2argvdata/qemuxml2argv-hyperv-off.args | 1 -
.../qemuxml2argv-kvm-features-off.args | 1 -
.../qemuxml2argv-x86-kvm-32-on-64.args | 21 +++++
.../qemuxml2argv-x86-kvm-32-on-64.xml | 13 +++
tests/qemuxml2argvtest.c | 1 +
tests/testutilsqemu.c | 18 +++-
7 files changed, 90 insertions(+), 60 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml
--
2.13.3
7 years, 4 months
[libvirt] [PATCH v3 0/2] Restrict usage of unsupported clock timers
by Kothapally Madhu Pavan
hpet and kvm.pit clock timers are specific to x86 architecture and
are not to be used by unsuported architectures. Similarly sPAPR
guests only allow RTC timer. This patchset will restrict the usage
of unsupported clock timers.
Kothapally Madhu Pavan (2):
qemu: Restrict usage of hpet and kvm.pit timers by unsupported
architectures
qemu: Default hwclock source for sPAPR to RTC
src/qemu/qemu_domain.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
--
1.8.3.1
7 years, 4 months
[libvirt] [PATCH 0/8] Delete a function
by Ján Tomko
*** BLURB HERE ***
Ján Tomko (8):
Remove superfluous usage of virDomainDeviceInfoNeedsFormat
virDomainDeviceInfoFormat: delete outdated comments
Use a separate buffer for <smartcard> subelements
Use a separate buffer for <sound> subelements
Use a separate buffer for <watchdog> subelements
Use a separate buffer for <hub> subelements
conf: check for buffer errors before virBufferUse
Turn virDomainDeviceInfoFormat into void
src/conf/capabilities.c | 5 +
src/conf/cpu_conf.c | 4 +
src/conf/domain_conf.c | 237 +++++++++++++++++++++---------------------------
3 files changed, 114 insertions(+), 132 deletions(-)
--
2.13.0
7 years, 4 months
[libvirt] [PATCH 00/24] qemu: refactor node name detection
by Peter Krempa
Since query-blockstats provides full hierarchy of node names without any doubtful
matching algorithm, use it to make the node name detector reliable.
Unfortunately some of the changes are ugly when viewed as a diff since they
delete and rewrite chunks of code.
This series can be fetched at:
git fetch git://pipo.sk/pipo/libvirt.git node-name-detect-refactor-1
Peter Krempa (24):
qemu: monitor: Extract call of 'query-blockstats' and add new API for
it
tests: qemumonitorjson: Consolidate basic node name detection test
cases
tests: qemumonitor: Prepare for more test data in
testBlockNodeNameDetect
tests: qemumonitorjson: Drop redundant data from
testBlockNodeNameDetectFormat
tests: utils: Don't calculate file size in virTestLoadFile
util: buffer: Add virBufferStrcatVArgs
tests: utils: Add virTestLoadFilePath helper
tests: qemuhelp: convert to virTestLoadFilePath
tests: utils: Add virTestLoadFileJSON helper
tests: qemumonitorjson: simplify path handling in
testBlockNodeNameDetect
tests: qemumontitorjson: temporarily disable node name detection tests
qemu: block: Rename qemuBlockFillNodeData and move it to the top
util: storagefile: rename 'nodebacking' to 'nodestorage' in
virStorageSource
qemu: block: Refactor node name detection code
tests: Extract mock library for making hash table deterministic
tests: qemumonitorjson: Simplify node name detection test
qemu: block: store and test driver names for detected storage nodes
tests: qemumonitorjson: Add data and fix 'same-backing' node detection
case
tests: qemumonitorjson: Fix 'relative' node name detection test case
tests: qemumonitorjson: Fix 'gluster' node name detection test case
tests: qemumonitorjson: Add test case for node name detection with
blockjob
tests: qemumonitorjson: Old and empty test case for node name
detection
tests: qemumonitorjson: Test extraction of LUKS node names
tests: qemumonitorjson: Test extraction of iSCSI device node names
src/libvirt_private.syms | 1 +
src/qemu/qemu_block.c | 344 ++-
src/qemu/qemu_block.h | 12 +-
src/qemu/qemu_driver.c | 10 +-
src/qemu/qemu_monitor.c | 15 +
src/qemu/qemu_monitor.h | 2 +
src/qemu/qemu_monitor_json.c | 44 +-
src/qemu/qemu_monitor_json.h | 2 +
src/util/virbuffer.c | 27 +-
src/util/virbuffer.h | 2 +
src/util/virstoragefile.c | 6 +-
src/util/virstoragefile.h | 2 +-
tests/Makefile.am | 17 +-
tests/qemuhelptest.c | 14 +-
.../qemumonitorjson-nodename-1.result | 15 -
.../qemumonitorjson-nodename-2.json | 2270 --------------------
.../qemumonitorjson-nodename-2.result | 60 -
.../qemumonitorjson-nodename-basic-blockstats.json | 166 ++
...emumonitorjson-nodename-basic-named-nodes.json} | 18 +-
.../qemumonitorjson-nodename-basic.result | 16 +
...mumonitorjson-nodename-blockjob-blockstats.json | 301 +++
...umonitorjson-nodename-blockjob-named-nodes.json | 682 ++++++
.../qemumonitorjson-nodename-blockjob.result | 26 +
.../qemumonitorjson-nodename-empty-blockstats.json | 2 +
...qemumonitorjson-nodename-empty-named-nodes.json | 2 +
.../qemumonitorjson-nodename-empty.result | 1 +
...emumonitorjson-nodename-gluster-blockstats.json | 111 +
...umonitorjson-nodename-gluster-named-nodes.json} | 90 +-
.../qemumonitorjson-nodename-gluster.result | 19 +-
.../qemumonitorjson-nodename-iscsi-blockstats.json | 113 +
...qemumonitorjson-nodename-iscsi-named-nodes.json | 114 +
.../qemumonitorjson-nodename-iscsi.result | 13 +
.../qemumonitorjson-nodename-luks-blockstats.json | 58 +
.../qemumonitorjson-nodename-luks-named-nodes.json | 109 +
.../qemumonitorjson-nodename-luks.result | 6 +
.../qemumonitorjson-nodename-old-blockstats.json | 160 ++
.../qemumonitorjson-nodename-old-named-nodes.json | 2 +
.../qemumonitorjson-nodename-old.result | 1 +
...mumonitorjson-nodename-relative-blockstats.json | 329 +++
...monitorjson-nodename-relative-named-nodes.json} | 26 +-
.../qemumonitorjson-nodename-relative.result | 56 +-
...nitorjson-nodename-same-backing-blockstats.json | 221 ++
...torjson-nodename-same-backing-named-nodes.json} | 16 +-
.../qemumonitorjson-nodename-same-backing.result | 32 +-
tests/qemumonitorjsontest.c | 97 +-
tests/testutils.c | 101 +-
tests/testutils.h | 6 +
...{virmacmapmock.c => virdeterministichashmock.c} | 0
tests/virmacmaptest.c | 2 +-
49 files changed, 2961 insertions(+), 2778 deletions(-)
delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-1.result
delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-2.json
delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-2.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-1.json => qemumonitorjson-nodename-basic-named-nodes.json} (96%)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-blockstats.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-blockstats.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empty.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-gluster.json => qemumonitorjson-nodename-gluster-named-nodes.json} (89%)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-blockstats.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-luks.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old-blockstats.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old-named-nodes.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old.result
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-relative.json => qemumonitorjson-nodename-relative-named-nodes.json} (97%)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-blockstats.json
rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-same-backing.json => qemumonitorjson-nodename-same-backing-named-nodes.json} (96%)
rename tests/{virmacmapmock.c => virdeterministichashmock.c} (100%)
--
2.13.2
7 years, 4 months
[libvirt] [PATCH v3 0/2] Allow saving VM state to pipe
by Chen Hanxiao
This series introduce flag VIR_DOMAIN_SAVE_DIRECT
to enable command 'save' to write to PIPE.
This will write QEMU_SAVE_MAGIC directly.
Base upon patches from Roy Keene <rkeene(a)knightpoint.com>
with some fixes.
Change from original patch:
1) Check whether the specified path is a PIPE.
2) Rebase on upstream.
3) Add doc for virsh command
v3:
add doc/news.xml
rebase on upstream
v2-resend:
rebase on upstream
v2:
rename VIR_DOMAIN_SAVE_PIPE to VIR_DOMAIN_SAVE_DIRECT
remove S_ISFIFO check
Chen Hanxiao (2):
qemu: Allow qemuDomainSaveMemory saving VM state to a pipe
virsh: introduce flage --direct for save command
docs/news.xml | 9 +++++++
include/libvirt/libvirt-domain.h | 1 +
src/qemu/qemu_driver.c | 54 ++++++++++++++++++++++++++--------------
tools/virsh-domain.c | 6 +++++
tools/virsh.pod | 5 +++-
5 files changed, 56 insertions(+), 19 deletions(-)
--
2.7.4
7 years, 4 months
[libvirt] [dbus PATCH 0/9] code cleanup
by Pavel Hrdina
Pavel Hrdina (9):
util: move bus_path_for_domain and domain_from_bus_path
util: move and rename virDomainsFreep
domain: split domain code into separate file
events: split event code into separate file
util: rename function to follow libvirt naming rules
main: rename functions to follow libvirt naming rules
manager: rename functions and structures to follow libvirt naming
rules
domain: rename functions to follow libvirt naming rules
events: rename functions to follow libvirt naming rules
src/Makefile.am | 4 +-
src/domain.c | 549 +++++++++++++++++++++++++++++++++
src/domain.h | 10 +
src/events.c | 252 ++++++++++++++++
src/events.h | 9 +
src/main.c | 44 +--
src/manager.c | 920 ++++----------------------------------------------------
src/manager.h | 18 +-
src/util.c | 35 ++-
src/util.h | 39 ++-
10 files changed, 970 insertions(+), 910 deletions(-)
create mode 100644 src/domain.c
create mode 100644 src/domain.h
create mode 100644 src/events.c
create mode 100644 src/events.h
--
2.13.3
7 years, 4 months
[libvirt] [libvirt-php PATCH 0/7] add bindings for NWFilter APIs
by Dawid Zamirski
Hello,
This series adds support for libvirt's virNWFilter* APIs. Since it
introduces new resource type, I took the opportunity to cleanup the
driver code a little:
* in patches 1-3: added macros to take care of the differences in how
PHP5 and PHP7 handle resource types.
* in patch 4: libvirt_doman_get_connect was segfaulting when called
multiple times because it was not bumping reference count on the
resource it was returning to the calling code.
* in patch 5: added a macro to take care of the differences in how PHP5
and PHP7 initialize arrays.
* patches 6 and 7: implement the missing binding to NWFilter APIs.
Dawid Zamirski (7):
move macros to header file.
add wrappers for PHP resource handling.
update code to use resource handling macros
fix libvirt_doman_get_connect implementation.
add and use VIRT_ARRAY_INIT macro
add nwfilter resource type
implement NWFilter API bindings.
src/libvirt-php.c | 923 +++++++++++++++++++++++++++++++-----------------------
src/libvirt-php.h | 150 ++++++++-
2 files changed, 672 insertions(+), 401 deletions(-)
--
2.13.0
7 years, 4 months
[libvirt] [PATCH v2] tools: virsh: Adding unix socket support to 'domdisplay' command.
by Julio Faracco
This commit adds the unix socket URL support to 'domdisplay' command.
Before, even if an user was using unix socket to define a spice graphics,
the command 'domdisplay' showed that the settings were not supported. Now,
the command shows the proper URL: spice+unix://foo/bar.sock.
Settings:
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<graphics type='spice'>
<listen type='socket' socket='/tmp/spice.sock'/>
</graphics>
Before:
virsh # domdisplay --all Windows7
vnc://127.0.0.1:0
After:
virsh # domdisplay --all Windows7
vnc://127.0.0.1:0
spice+unix:///tmp/spice.sock
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1336720
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
tools/virsh-domain.c | 52 +++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 41 insertions(+), 11 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 0684979..935ef8a 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10948,6 +10948,8 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
char *xpath = NULL;
char *listen_addr = NULL;
int port, tls_port = 0;
+ char *type_conn = NULL;
+ char *socket = NULL;
char *passwd = NULL;
char *output = NULL;
const char *scheme[] = { "vnc", "spice", "rdp", NULL };
@@ -11008,9 +11010,6 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
if (tmp)
tls_port = 0;
- if (!port && !tls_port)
- continue;
-
/* Create our XPATH lookup for the current display's address */
if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "@listen") < 0)
goto cleanup;
@@ -11021,6 +11020,29 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
listen_addr = virXPathString(xpath, ctxt);
VIR_FREE(xpath);
+ /* Create our XPATH lookup for the current spice type. */
+ if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "listen/@type") < 0)
+ goto cleanup;
+
+ /* Attempt to get the type of spice connection */
+ VIR_FREE(type_conn);
+ type_conn = virXPathString(xpath, ctxt);
+ VIR_FREE(xpath);
+
+ if (STREQ_NULLABLE(type_conn, "socket")) {
+ if (!socket) {
+ if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "listen/@socket") < 0)
+ goto cleanup;
+
+ socket = virXPathString(xpath, ctxt);
+
+ VIR_FREE(xpath);
+ }
+ }
+
+ if (!port && !tls_port && !socket)
+ continue;
+
if (!listen_addr) {
/* The subelement address - <listen address='xyz'/> -
* *should* have been automatically backfilled into its
@@ -11035,11 +11057,9 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
listen_addr = virXPathString(xpath, ctxt);
VIR_FREE(xpath);
- }
-
- /* If listen_addr is 0.0.0.0 or [::] we should try to parse URI and set
- * listen_addr based on current URI. */
- if (listen_addr) {
+ } else {
+ /* If listen_addr is 0.0.0.0 or [::] we should try to parse URI and set
+ * listen_addr based on current URI. */
if (virSocketAddrParse(&addr, listen_addr, AF_UNSPEC) > 0 &&
virSocketAddrIsWildcard(&addr)) {
@@ -11078,20 +11098,28 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
VIR_FREE(xpath);
/* Build up the full URI, starting with the scheme */
- virBufferAsprintf(&buf, "%s://", scheme[iter]);
+ if (socket)
+ virBufferAsprintf(&buf, "%s+unix://", scheme[iter]);
+ else
+ virBufferAsprintf(&buf, "%s://", scheme[iter]);
/* There is no user, so just append password if there's any */
if (STREQ(scheme[iter], "vnc") && passwd)
virBufferAsprintf(&buf, ":%s@", passwd);
/* Then host name or IP */
- if (!listen_addr)
+ if (!listen_addr && !socket)
virBufferAddLit(&buf, "localhost");
- else if (strchr(listen_addr, ':'))
+ else if (!socket && strchr(listen_addr, ':'))
virBufferAsprintf(&buf, "[%s]", listen_addr);
+ else if (socket)
+ virBufferAsprintf(&buf, "%s", socket);
else
virBufferAsprintf(&buf, "%s", listen_addr);
+ /* Free socket to prepare the pointer for the next iteration */
+ VIR_FREE(socket);
+
/* Add the port */
if (port) {
if (STREQ(scheme[iter], "vnc")) {
@@ -11148,6 +11176,8 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
cleanup:
VIR_FREE(xpath);
+ VIR_FREE(type_conn);
+ VIR_FREE(socket);
VIR_FREE(passwd);
VIR_FREE(listen_addr);
VIR_FREE(output);
--
2.7.4
7 years, 4 months
[libvirt] [PATCH 0/7] Misc improvements
by Michal Privoznik
As I started to turn more object into using RW locks, I've found couple of
areas for improvement too.
Michal Privoznik (7):
virConnect: Update comment for @privateData
Report error if virMutexInit fails
virnetworkobj: Make virNetworkObjFindBy{UUID,Name}Locked() static
again
virNetworkObjList: Derive from virObjectRWLockable
virNodeDeviceObjList: Derive from virObjectRWLockable
virConnect: Derive from virObjectRWLockable
storageDriver: Use RW locks
src/bhyve/bhyve_driver.c | 1 +
src/conf/virnetworkobj.c | 42 ++++++++++----------------------
src/conf/virnetworkobj.h | 8 -------
src/conf/virnodedeviceobj.c | 16 ++++++-------
src/conf/virstorageobj.h | 2 +-
src/datatypes.c | 6 +++--
src/datatypes.h | 6 ++---
src/libvirt_private.syms | 2 --
src/lxc/lxc_driver.c | 1 +
src/lxc/lxc_fuse.c | 4 +++-
src/network/bridge_driver.c | 1 +
src/node_device/node_device_hal.c | 1 +
src/nwfilter/nwfilter_dhcpsnoop.c | 12 +++++++---
src/nwfilter/nwfilter_driver.c | 5 +++-
src/nwfilter/nwfilter_gentech_driver.c | 4 +++-
src/secret/secret_driver.c | 2 ++
src/storage/storage_driver.c | 44 +++++++++++++++++++---------------
src/uml/uml_driver.c | 1 +
src/util/virerror.c | 2 +-
src/util/virnetlink.c | 1 +
src/util/virthreadpool.c | 4 +++-
src/vmware/vmware_driver.c | 5 +++-
src/vz/vz_driver.c | 4 +++-
tools/virsh-console.c | 4 +++-
24 files changed, 94 insertions(+), 84 deletions(-)
--
2.13.0
7 years, 4 months
[libvirt] [PATCH 0/7] Some virObjectRW* adjustments
by John Ferlan
As indicated in a couple of recent reviews, the new virObjectRWLockable
object and API's I believe needed a few adjustments in order to make
them better. So I present those thoughts in patch format to be hopefully
dicussed and dissected.
Essentially this series, will modify the newly added virObjectLockRead
to return a status and to have that status managed. Since there were only
9 new callers, this was straightforward. None of the callers actually
needed any sort of "divert logic" in order to jump around code that
shouldn't do the Unlock now. Although that could be a problem if ever
changing other more deeply nested type locks. That's someone else's
headache though.
Next, introduce and use virObjectLockWrite to be only for the new
style RWLocks. This too will return status. Only the vir*Remove caller
has a code path that I'm not happy with, but since these type locks
have been processing along anyway without technically ensuring they
have the lock before doing so, well no harm, no foul.
Next, introduce and use virObjectRWUnlock. Rather than overloading the
virObjectUnlock, let's just keep each caller doing it's one thing to
be sure that the calling code is doing the "right thing". In this case,
returning a failure status is just not going to work. We've gone too
far down the path in order for a failure to cause some failure in the
caller. We'll just treat it like virObjectUnlock and if the resource
remains locked, well we'll find out relatively soon as the next time
someone goes to read/write the list they'll be waiting for an unlock
that will never happen because of some coding mistake. But that will
save us from perhaps other dire consequences involving corruption.
Finally, revert the virObjectLock and virObjectUnlock code to just
manage virObjectLockable locks. No worse than what happened before
the RWLock was introduced. Leaving the consumers to handle things
as they would before - which probably ends up in some sort of awful
state leading to memory corruption and a quick death as opposed to
abort()'g in the void() function which has been deemed a don't do
that type operation for libvirt.
The last 2 patches actually have appeared before in various common
object series postings, so they could be a v2 or 3 type logic, but
I see them more related to this than that, so I present them here
again.
John Ferlan (7):
util: Alter virObjectLockRead to return status
util: Introduce and use virObjectLockWrite
util: Only have virObjectLock handle virObjectLockable
util: Introduce virObjectGetRWLockableObj
util: Introduce and use virObjectRWUnlock
util: Create common error path for invalid object
util: Add safety net of checks to ensure valid object
src/conf/virdomainobjlist.c | 81 +++++++++++++---------
src/libvirt_private.syms | 2 +
src/util/virobject.c | 160 +++++++++++++++++++++++++++++++++-----------
src/util/virobject.h | 10 ++-
4 files changed, 181 insertions(+), 72 deletions(-)
--
2.9.4
7 years, 4 months