[libvirt] [dbus PATCH] Add detail argument to DomainEvent signal
by Katerina Koukiou
Adjust all DomainEvent tests to do detail type checking.
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
This commit is rebased on top of unmerged patches for removing enum<->string
translation.
data/org.libvirt.Connect.xml | 1 +
src/events.c | 4 ++--
tests/libvirttest.py | 55 ++++++++++++++++++++++++++++++++++++++++++++
tests/test_connect.py | 6 +++--
tests/test_domain.py | 15 ++++++++----
5 files changed, 72 insertions(+), 9 deletions(-)
diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
index 8272da6..0f1456f 100644
--- a/data/org.libvirt.Connect.xml
+++ b/data/org.libvirt.Connect.xml
@@ -171,6 +171,7 @@
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEven..."/>
<arg name="domain" type="o"/>
<arg name="event" type="u"/>
+ <arg name="detail" type="u"/>
</signal>
<signal name="NetworkEvent">
<annotation name="org.gtk.GDBus.DocString"
diff --git a/src/events.c b/src/events.c
index b432535..ea55180 100644
--- a/src/events.c
+++ b/src/events.c
@@ -8,7 +8,7 @@ static gint
virtDBusEventsDomainLifecycle(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
gint event,
- gint detail G_GNUC_UNUSED,
+ gint detail,
gpointer opaque)
{
virtDBusConnect *connect = opaque;
@@ -21,7 +21,7 @@ virtDBusEventsDomainLifecycle(virConnectPtr connection G_GNUC_UNUSED,
connect->connectPath,
VIRT_DBUS_CONNECT_INTERFACE,
"DomainEvent",
- g_variant_new("(ou)", path, event),
+ g_variant_new("(ouu)", path, event, detail),
NULL);
return 0;
diff --git a/tests/libvirttest.py b/tests/libvirttest.py
index 06ac0e4..eee67a0 100644
--- a/tests/libvirttest.py
+++ b/tests/libvirttest.py
@@ -100,6 +100,61 @@ class DomainEvent(IntEnum):
CRASHED = 8
+class DomainEventDefinedDetailType(IntEnum):
+ ADDED = 0
+ UPDATED = 1
+ RENAMED = 2
+ FROM_SNAPSHOT = 3
+ LAST = 4
+
+
+class DomainEventResumedDetailType(IntEnum):
+ UNPAUSED = 0
+ MIGRATED = 1
+ FROM_SNAPSHOT = 2
+ POSTCOPY = 3
+ LAST = 4
+
+
+class DomainEventStartedDetailType(IntEnum):
+ BOOTED = 0
+ MIGRATED = 1
+ RESTORED = 2
+ FROM_SNAPSHOT = 3
+ WAKEUP = 4
+ LAST = 5
+
+
+class DomainEventStoppedDetailType(IntEnum):
+ SHUTDOWN = 0
+ DESTROYED = 1
+ CRASHED = 2
+ MIGRATED = 3
+ SAVED = 4
+ FAILED = 5
+ FROM_SNAPSHOT = 6
+ LAST = 7
+
+
+class DomainEventSuspendedDetailType(IntEnum):
+ PAUSED = 0
+ MIGRATED = 1
+ IOERROR = 2
+ WATCHDOG = 3
+ RESTORED = 4
+ FROM_SNAPSHOT = 5
+ API_ERROR = 6
+ POSTCOPY = 7
+ POSTCOPY_FAILED = 8
+ LAST = 9
+
+
+class DomainEventUndefinedDetailType(IntEnum):
+ REMOVED = 0
+ RENAMED = 1
+ LAST = 2
+
+
class DomainState(IntEnum):
NOSTATE = 0
RUNNING = 1
diff --git a/tests/test_connect.py b/tests/test_connect.py
index 7748822..a2bd17f 100755
--- a/tests/test_connect.py
+++ b/tests/test_connect.py
@@ -31,9 +31,10 @@ class TestConnect(libvirttest.BaseTestClass):
'''
def test_connect_domain_create_xml(self):
- def domain_started(path, event):
+ def domain_started(path, event, detail):
if event != libvirttest.DomainEvent.STARTED:
return
+ assert detail == libvirttest.DomainEventStartedDetailType.BOOTED
assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
@@ -45,9 +46,10 @@ class TestConnect(libvirttest.BaseTestClass):
self.main_loop()
def test_comnect_domain_define_xml(self):
- def domain_defined(path, event):
+ def domain_defined(path, event, detail):
if event != libvirttest.DomainEvent.DEFINED:
return
+ assert detail == libvirttest.DomainEventDefinedDetailType.ADDED
assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
diff --git a/tests/test_domain.py b/tests/test_domain.py
index c7e09cd..dfa19ed 100755
--- a/tests/test_domain.py
+++ b/tests/test_domain.py
@@ -47,9 +47,10 @@ class TestDomain(libvirttest.BaseTestClass):
assert autostart_current == dbus.Boolean(autostart_expected)
def test_domain_managed_save(self):
- def domain_stopped(path, event):
+ def domain_stopped(path, event, detail):
if event != libvirttest.DomainEvent.STOPPED:
return
+ assert detail == libvirttest.DomainEventStoppedDetailType.SAVED
assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
@@ -74,9 +75,10 @@ class TestDomain(libvirttest.BaseTestClass):
assert description_expected == domain.GetMetadata(metadata_description, "", 0)
def test_resume(self):
- def domain_resumed(path, event):
+ def domain_resumed(path, event, detail):
if event != libvirttest.DomainEvent.RESUMED:
return
+ assert detail == libvirttest.DomainEventResumedDetailType.UNPAUSED
assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
@@ -92,9 +94,10 @@ class TestDomain(libvirttest.BaseTestClass):
self.main_loop()
def test_shutdown(self):
- def domain_stopped(path, event):
+ def domain_stopped(path, event, detail):
if event != libvirttest.DomainEvent.STOPPED:
return
+ assert detail == libvirttest.DomainEventStoppedDetailType.SHUTDOWN
assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
@@ -109,9 +112,10 @@ class TestDomain(libvirttest.BaseTestClass):
self.main_loop()
def test_suspend(self):
- def domain_suspended(path, event):
+ def domain_suspended(path, event, detail):
if event != libvirttest.DomainEvent.SUSPENDED:
return
+ assert detail == libvirttest.DomainEventSuspendedDetailType.PAUSED
assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
@@ -126,9 +130,10 @@ class TestDomain(libvirttest.BaseTestClass):
self.main_loop()
def test_undefine(self):
- def domain_undefined(path, event):
+ def domain_undefined(path, event, detail):
if event != libvirttest.DomainEvent.UNDEFINED:
return
+ assert detail == libvirttest.DomainEventUndefinedDetailType.REMOVED
assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
--
2.15.0
7 years, 1 month
[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
7 years, 1 month
[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
7 years, 1 month
[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
7 years, 1 month
[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
7 years, 1 month
[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'.
7 years, 1 month
[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
7 years, 1 month
[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
7 years, 1 month
[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
7 years, 1 month