[libvirt] [dbus PATCH v2 0/9] Remove all enum->string and string->enum code
by Katerina Koukiou
Changes from v1:
* Added the three last patches
Katerina Koukiou (9):
Abandon usage of all *TypeToString functions in domain.c
Abandon usage of all *TypeToString functions in connect.c
Abandon usage of all *TypeToString functions in network.c
Change DomainEvent argument from string to unsigned int
Change NetworkEvent argument from string to unsigned int
Remove virtDBusUtilEnum{From,From}String functions
Remove reason to string translation in virtDBusEventsDomainTrayChange
Remove state to string translation in virtDBusDomainGetState
Remove reason to string translation in virtDBusEventsDomainDiskChange
data/org.libvirt.Connect.xml | 6 +-
data/org.libvirt.Domain.xml | 20 ++---
data/org.libvirt.Network.xml | 6 +-
src/connect.c | 18 +---
src/domain.c | 203 ++++---------------------------------------
src/events.c | 72 ++-------------
src/network.c | 66 +-------------
src/util.c | 27 ------
src/util.h | 28 ------
tests/libvirttest.py | 32 +++++++
tests/test_connect.py | 24 +++--
tests/test_domain.py | 46 ++++++----
tests/test_network.py | 20 +++--
13 files changed, 131 insertions(+), 437 deletions(-)
--
2.15.0
6 years, 6 months
[libvirt] [perl PATCH] spec: Drop %{extra_release}
by Andrea Bolognani
It was mainly meant to be used for automatic builds through
Test::AutoBuild, so it can be removed now.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
perl-Sys-Virt.spec.PL | 2 +-
prepare-release.sh | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/perl-Sys-Virt.spec.PL b/perl-Sys-Virt.spec.PL
index dbb749d..ffa6c86 100644
--- a/perl-Sys-Virt.spec.PL
+++ b/perl-Sys-Virt.spec.PL
@@ -24,7 +24,7 @@ __DATA__
Name: perl-Sys-Virt
Version: @VERSION@
-Release: 1%{?dist}%{?extra_release}
+Release: 1%{?dist}
Summary: Represent and manage a libvirt hypervisor connection
License: GPLv2+ or Artistic
Group: Development/Libraries
diff --git a/prepare-release.sh b/prepare-release.sh
index 9de67fe..fea03f4 100755
--- a/prepare-release.sh
+++ b/prepare-release.sh
@@ -52,7 +52,5 @@ rm -f $NAME-*.tar.gz
make dist
if [ -f /usr/bin/rpmbuild ]; then
- NOW=`date +"%s"`
- EXTRA_RELEASE=".$USER$NOW"
- rpmbuild --nodeps -ta --define "extra_release $EXTRA_RELEASE" --clean $NAME-*.tar.gz
+ rpmbuild --nodeps -ta --clean $NAME-*.tar.gz
fi
--
2.17.0
6 years, 6 months
[libvirt] [PATCH 0/2] adding virHas/GetLastErrorCode/Domain to paritally replace virGetLastError
by ramyelkest
Many places in the code call virGetLastError() just to check the
raised error code, or domain. However virGetLastError() can return
NULL, so the code has to check for that as well.
So Instead we create functions virGetLastErrorCode and virGetLastErrorDomain
(in addition to the existing virGetLastErrorMessage) that always return a
valid error code/domain/message, to simplify callers.
Also created virHasLastErrorCode for completion
This is my first commit, for:
https://wiki.libvirt.org/page/BiteSizedTasks#Add_and_use_virGetLastErrorC...
Notes:
* There are a few instances of virGetLastErrorCode() left where we use multiple
fields from the error, which makes sense to keep it.
* I didn't manage to use virGetLastErrorDomain() (due to the above) so I'm inclined
to remove it.
* virHasLastError is more or less only a semantic improvement over virGetLastError,
so I'm happy to revert it if needed
Signed-off-by: Ramy Elkest <ramyelkest(a)gmail.com>
ramyelkest (2):
util: adding virHasLastError and virGetLastErrorCode/Domain
all: replacing virGetLastError with virHas/GetLastErrorCode/Domain
include/libvirt/virterror.h | 3 ++
src/libvirt_public.syms | 7 +++++
src/locking/lock_driver_lockd.c | 3 +-
src/lxc/lxc_controller.c | 4 +--
src/qemu/qemu_agent.c | 3 +-
src/qemu/qemu_conf.c | 3 +-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_driver.c | 12 ++++----
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_migration.c | 4 +--
src/qemu/qemu_monitor.c | 5 ++--
src/qemu/qemu_monitor_json.c | 2 +-
src/qemu/qemu_process.c | 2 +-
src/remote/remote_driver.c | 3 +-
src/rpc/virnetclient.c | 2 +-
src/util/virerror.c | 63 +++++++++++++++++++++++++++++++++++++++++
src/util/virfilecache.c | 3 +-
src/util/virxml.c | 4 +--
tests/commandtest.c | 2 +-
tests/testutils.c | 6 ++--
tests/virhostcputest.c | 2 +-
tests/virstoragetest.c | 8 +++---
tools/virsh-domain-monitor.c | 7 ++---
tools/virsh-domain.c | 4 +--
tools/virsh-util.c | 3 +-
tools/vsh.c | 2 +-
26 files changed, 110 insertions(+), 51 deletions(-)
--
2.7.4
6 years, 6 months
[libvirt] [jenkins-ci PATCH] guests: Update vault
by Pavel Hrdina
Renaming node in Jenkins changes the secret as well so we cannot reuse
the same secret as for the old node.
This updates the libvirt-fedora-28 secret to correct one.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed under trivial rule.
guests/vars/vault.yml | 90 +++++++++++++++++++++++++--------------------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/guests/vars/vault.yml b/guests/vars/vault.yml
index 403bd9b..5bf89dc 100644
--- a/guests/vars/vault.yml
+++ b/guests/vars/vault.yml
@@ -1,46 +1,46 @@
$ANSIBLE_VAULT;1.1;AES256
-37663961316238333332643164623861363938613135376161343231383739663836313130363538
-3136326161376136376332636534643437626530316439650a636134636561333962376564626635
-31306539613534653133383161313834633133316361303539646234356335386639303332323063
-3937626336326131650a373737396639373063316131633634393961393634663961613532353134
-32623065373438336561643538666536666665323536643730386364653162323939616131313634
-38653936663937613765663465353166656363356336636362353432636537633836623930653437
-30353239303435613536636333386436336638636462626537623766343237376331643334633433
-37353531616466386234376639306261303561373035383338383366646537373231386362313562
-66663965366438383833653631386236356163653835303664666539326362383362343838653333
-39623535616361653838626164306666626634373237626638373131303439356164646361613838
-64333165393935636162613638626461313661623963626664366361366364643136313236306636
-61633665393630356133306338343563636332386539626366383133326662633638306330323437
-34613034326465346338633538363231386430363932656430346634663437333734363234346533
-35303962333032626435343030653338656133323932386264346562323133326164623961623466
-62643763333563336362666439653038653335373531303930313239393166623539386239323337
-39393337313563656131646130633330313230366462306636363535386663666131613662363566
-63643030633262336263316134636136616430636536363464386436616530336264396264393762
-36646531636238343763376438666163376166613231306363633536623166356437386333383665
-37353962383238346132633230373666366638386162663263663134303936633034643737386362
-36393537373864323632376632376134303866393966336536376139393334613163356234623863
-36353837616535313266326538376663316366616561613833393037316264396532306430623338
-33636339623861313536323835326464636265386536646263643765306432626462363533373434
-32343961613563613734633736396139623463653230303337333862393836393533363637626662
-35376236613436323736643533613436646136373436363862383933323231663237343838313262
-34343337343031326139366636346632303738366439346433633738313464366438366235356462
-65376165396532623566663335396332333635346661613431343237366166376462393732373532
-62616631643564653865386133663666313366313336323432316236336165386234323165366461
-35343238336235386364363732343862393039326234653539643861383832393465343536353739
-33633134333836393965343935316564653866363130343234633566643463343331306135386334
-39316166616463383964613432373437623964343164383638666531303064313063663330366566
-33643930396232626266396634366564633163333837373062636131623463613061656138363534
-39383830626136636563663233376237626565643661656430336462626436386235643239646365
-34303938323237626362613765326138376130666466373033626338363161383432623465353131
-39373230336330666337393161306437313035373164366330333533636662313266336333626261
-37353638623362643138356434323864346265613835306665383564323139333539336231323534
-38323664396438663664343436333133656336663633396234303034633163643534346139663632
-34633364373066303363306366653566353338326566616138643761343166343536333239653966
-39626639383762653439643631663161303333323330313063336532303531393830646532343261
-65363434373538653337306233333238653465313266643838333862616337323063626432393939
-34663838363931353561396164623138366538376230333738373962356337366533643866343863
-37633366323334323936303962653462353831386262336233336339633366336164623766653862
-32653262373433343136386363386231373938636661373363393331663365636333633164353563
-38643966373261356131666432313934313038363034306162373262353666303936666564303935
-62383432633763623864323263616632396166363165336331363434316430626334616537376132
-63666665336362373265363462343666356434323365633632626632666130356431
+66646139336431653964363035353762363664313738393832356132333835616363373032656335
+3439633266356532316564643762623935643736613839390a616631363336393962633464326264
+31373235323236303134356165386638663865353331353362386538386233363438623035343462
+3864656136376430360a646235373734636666373934616463363234316262376534633865616632
+32643566633531323162366134333562363463336237646130393965646335316561393565663664
+36343164373564336233363963393031363937336137303433396265323261663632373534613365
+31613838363562366564646333646638303837626638323065326237623665646264633233633537
+39373432363962396463323532353434623631383763346234343462333565383333366439393835
+30356437393232363432313334616462346164393437303330343562356461626464633935376239
+39626464316662333736643962623961343662396236306239333335373033366535623730353538
+66346164333839626563366666373432363331343030663537663536623965303333393534316538
+66623737363431303632363237323562306134376336393564366138626435343539613239623539
+39653331623466333535356166653036356564373138623461643862346161383062623738626266
+32613337323038646134336333613266386332353431656263353463656162393732343730393736
+34373033653933656565613063316463373535333836353234333536643639323037373333376338
+65666632623161326538333263626264373535633462306361633835323439663536326433616263
+66373532633865653834323565333536313731643837393834666464626565373938336537363633
+33323335633261643638643038623631633362633366393564316632383030656262383931656262
+65306265316264373732623466393935666633353730346632336262663766333833393961353565
+36383336313062363930633335346430306138656538633637623266383461323735643635613531
+38613265353736303336616638303333343739313033383363303638346266663830613534666464
+33383538303562643232626333303065313364386336366165316263363135396637623739316261
+32376332373539616334646130366262343837323832623965376566343366336563386639326333
+36653365383162623333373766393166656463393331663035616636386238396365663535383334
+39663634386133613138333730366331653262383761633462633239666132343239643735303732
+37343239383038343332656565313465666261646436333536363532376361636461336133336465
+65663561336430336664636262356362636635623961386462313437373863366134343164643762
+64653236616435326432363137646362646433316535393135353333336331313832623461623536
+35653739613834323564313163383563383633343336316533356535623838313663623464353238
+66333862623762316363636439613430363038633062663439383032393934313266316131323836
+30396163303038323564663639656161353336356435633635306538313032626566306366666135
+36383234353161313534343962336536313763306337393239626330396363396235643239306436
+31386631383666363365313434366538616130636164363536343364653861666662343065346663
+31356430653831653962333333396436626630333831343537366636336462373865643164326637
+65623237373561616164333238336463666239306564626538383666303562623632303630303335
+36386665346135623334646336663831666136323231376131383263343631643962643962336466
+38376264376662383263373562313263613866316138653862643833666134316338343863363631
+32663961366635353461303633366364333836636639386537396565333737353164616165323238
+66656666323265323361613162353835313763656637633464363131343361366435313565326664
+63663064336231633865663665666564366264366638356265396236326436623133653836376665
+30383436353663663637363337313232373430356261316465326261656161356436373265653939
+63356538663134386438666638386563393961373265363532653733373263623932613737613234
+61643536663036633132623161343935376633313364616436626561396262303765393662346632
+62353432646234383764366235623062636536666537323831316133636537306334616266363164
+64613735653731626231313931633839326663343262316362383763653832356163
--
2.14.3
6 years, 6 months
[libvirt] [PATCH] Qemu driver: Support network-backed pflash disks.
by Prerna Saxena
This implements support for firmware loader & NVRAM disks over network-backed disks.
As discussed in https://www.redhat.com/archives/libvir-list/2018-March/msg01721.html,
the patch embeds the <source> spec for disks in <loader> and <nvram> elements as well.
Currently, the source type is annotated by introducing a new attribute "backing" for both
'loader' and 'nvram' elements. Hence, a sample XML with new annotation looks like this:
<loader readonly='yes' type='pflash' backing='file'>
<source file='/usr/share/OVMF/OVMF_CODE.fd'/>
</loader>
<nvram backing='network'> <source protocol='iscsi' name='iqn.2013-07.com.example:iscsi-nopool/0'>
<host name='example.com' port='6000'/>
</source>
The patche automatically re-formats any older-stype declaration into this new style.
Templates can be used to create a new NVRAM only if the nvram backing = 'file'.
6 years, 6 months
[libvirt] [dbus PATCH v2 0/2] improve annotation of properties
by Pavel Hrdina
Pavel Hrdina (2):
Change the default annotation for emitting changed properties to false
Annotate properties that will never change during the object lifecycle
data/org.libvirt.Connect.xml | 3 +++
data/org.libvirt.Domain.xml | 2 ++
data/org.libvirt.Network.xml | 3 +++
3 files changed, 8 insertions(+)
--
2.14.3
6 years, 6 months
[libvirt] [dbus PATCH 0/4] various fixes
by Pavel Hrdina
Pavel Hrdina (4):
configure: Bump required libvirt version
Revert "Implement BridgeName property for Network interface."
Annotate properties for which we will not emit changed signal
Annotate properties that will never change during the object lifecycle
configure.ac | 2 +-
data/org.libvirt.Connect.xml | 5 +++++
data/org.libvirt.Domain.xml | 10 ++++++++++
data/org.libvirt.Network.xml | 9 +++++----
src/network.c | 23 -----------------------
tests/test_network.py | 1 -
6 files changed, 21 insertions(+), 29 deletions(-)
--
2.14.3
6 years, 6 months
[libvirt] [dbus PATCH] Implement SetGuestVcpus method for Domain Interface
by Katerina Koukiou
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Domain.xml | 7 +++++
src/domain.c | 62 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+)
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index db43b1c..eae6d97 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -463,6 +463,13 @@
<arg name="params" type="a{sv}" direction="in"/>
<arg name="flags" type="u" direction="in"/>
</method>
+ <method name="SetGuestVcpus">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetGuestVcpus"/>
+ <arg name="vcpumap" type="ab" direction="in"/>
+ <arg name="state" type="i" direction="in"/>
+ <arg name="flags" type="u" direction="in"/>
+ </method>
<method name="SetInterfaceParameters">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetInterfac..."/>
diff --git a/src/domain.c b/src/domain.c
index e305fa3..bbc4ead 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -72,6 +72,39 @@ VIRT_DBUS_ENUM_IMPL(virtDBusDomainMetadata,
"title",
"element")
+static gchar *
+virtDBusDomainConvertBoolArrayToGuestVcpumap(GVariantIter *iter)
+{
+ g_autoptr(GVariantIter) tmpIter = NULL;
+ gboolean set;
+ gint intervalCnt = 0;
+ guint intervalStart = 0;
+ gboolean setPrev = 0;
+ g_autofree GString *ret = NULL;
+
+ ret = g_string_new("");
+ for (guint i = 0; ; i++) {
+ gboolean next = g_variant_iter_loop(iter, "b", &set);
+
+ if (set && !setPrev)
+ intervalStart = i;
+ else if ((!set && setPrev) || next) {
+ if (intervalCnt > 0)
+ g_string_append_printf(ret, ",");
+ if (intervalStart != i - 1)
+ g_string_append_printf(ret, "%d-%d", intervalStart, i - 1);
+ else
+ g_string_append_printf(ret, "%d", intervalStart);
+ intervalCnt++;
+ }
+ setPrev = set;
+ if (!next)
+ break;
+ }
+
+ return ret->str;
+}
+
struct _virtDBusDomainFSInfoList {
virDomainFSInfoPtr *info;
gint count;
@@ -2490,6 +2523,34 @@ virtDBusDomainSetBlockIOTune(GVariant *inArgs,
}
}
+static void
+virtDBusDomainSetGuestVcpus(GVariant *inArgs,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath,
+ gpointer userData,
+ GVariant **outArgs G_GNUC_UNUSED,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+{
+ virtDBusConnect *connect = userData;
+ g_autoptr(virDomain) domain = NULL;
+ g_autoptr(GVariantIter) iter = NULL;
+ gint state;
+ guint flags;
+ g_autofree gchar *ret = NULL;
+
+ g_variant_get(inArgs, "(abiu)", &iter, &state, &flags);
+
+ domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+ if (!domain)
+ return;
+
+ ret = virtDBusDomainConvertBoolArrayToGuestVcpumap(iter);
+
+ if (virDomainSetGuestVcpus(domain, ret, state, flags) < 0)
+ virtDBusUtilSetLastVirtError(error);
+}
+
static void
virtDBusDomainSetInterfaceParameters(GVariant *inArgs,
GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -2988,6 +3049,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
{ "SendProcessSignal", virtDBusDomainSendProcessSignal },
{ "SetBlkioParameters", virtDBusDomainSetBlkioParameters },
{ "SetBlockIOTune", virtDBusDomainSetBlockIOTune },
+ { "SetGuestVcpus", virtDBusDomainSetGuestVcpus },
{ "SetInterfaceParameters", virtDBusDomainSetInterfaceParameters },
{ "SetVcpus", virtDBusDomainSetVcpus },
{ "SetMemory", virtDBusDomainSetMemory },
--
2.15.0
6 years, 6 months
[libvirt] [PATCH 03/12] virsh: Create macros for VSH_OT_STRING "domain" option
by Lin Ma
Signed-off-by: Lin Ma <lma(a)suse.com>
---
tools/virsh-domain-monitor.c | 3 +++
tools/virsh-domain.c | 3 +++
tools/virsh-snapshot.c | 3 +++
tools/virsh.h | 8 ++++++++
4 files changed, 17 insertions(+)
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 8e071779b4..8ad651626b 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -43,6 +43,9 @@
#define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \
VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags)
+#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \
+ VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), cflags)
+
VIR_ENUM_DECL(virshDomainIOError)
VIR_ENUM_IMPL(virshDomainIOError,
VIR_DOMAIN_DISK_ERROR_LAST,
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 6601f94a12..8a63761fab 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -68,6 +68,9 @@
#define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \
VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags)
+#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \
+ VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), cflags)
+
#define VIRSH_COMMON_OPT_DOMAIN_PERSISTENT \
{.name = "persistent", \
.type = VSH_OT_BOOL, \
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index e4908eea70..3d86ac84d1 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -45,6 +45,9 @@
#define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \
VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags)
+#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \
+ VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), cflags)
+
/* Helper for snapshot-create and snapshot-create-as */
static bool
virshSnapshotCreate(vshControl *ctl, virDomainPtr dom, const char *buffer,
diff --git a/tools/virsh.h b/tools/virsh.h
index f2213ebb57..9dcf104cc4 100644
--- a/tools/virsh.h
+++ b/tools/virsh.h
@@ -107,6 +107,14 @@
.help = _helpstr \
}
+# define VIRSH_COMMON_OPT_DOMAIN_OT_STRING(_helpstr, cflags) \
+ {.name = "domain", \
+ .type = VSH_OT_STRING, \
+ .help = _helpstr, \
+ .completer = virshDomainNameCompleter, \
+ .completer_flags = cflags, \
+ }
+
typedef struct _virshControl virshControl;
typedef virshControl *virshControlPtr;
--
2.15.1
6 years, 6 months