提交 f747a2b5 编写于 作者: J John Ferlan

qemu: Alter qemuDomainChgIOThread to take qemuMonitorIOThreadInfo

Rather than passing an iothread_id, let's pass a qemuMonitorIOThreadInfo
structure so that a subsequent change to modify the iothread info can
just generate and pass one.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 315e1105
...@@ -6024,7 +6024,7 @@ typedef enum { ...@@ -6024,7 +6024,7 @@ typedef enum {
static int static int
qemuDomainChgIOThread(virQEMUDriverPtr driver, qemuDomainChgIOThread(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
unsigned int iothread_id, qemuMonitorIOThreadInfo iothread,
virDomainIOThreadAction action, virDomainIOThreadAction action,
unsigned int flags) unsigned int flags)
{ {
...@@ -6053,19 +6053,19 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver, ...@@ -6053,19 +6053,19 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
switch (action) { switch (action) {
case VIR_DOMAIN_IOTHREAD_ACTION_ADD: case VIR_DOMAIN_IOTHREAD_ACTION_ADD:
if (qemuDomainAddIOThreadCheck(def, iothread_id) < 0) if (qemuDomainAddIOThreadCheck(def, iothread.iothread_id) < 0)
goto endjob; goto endjob;
if (qemuDomainHotplugAddIOThread(driver, vm, iothread_id) < 0) if (qemuDomainHotplugAddIOThread(driver, vm, iothread.iothread_id) < 0)
goto endjob; goto endjob;
break; break;
case VIR_DOMAIN_IOTHREAD_ACTION_DEL: case VIR_DOMAIN_IOTHREAD_ACTION_DEL:
if (qemuDomainDelIOThreadCheck(def, iothread_id) < 0) if (qemuDomainDelIOThreadCheck(def, iothread.iothread_id) < 0)
goto endjob; goto endjob;
if (qemuDomainHotplugDelIOThread(driver, vm, iothread_id) < 0) if (qemuDomainHotplugDelIOThread(driver, vm, iothread.iothread_id) < 0)
goto endjob; goto endjob;
break; break;
...@@ -6078,19 +6078,19 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver, ...@@ -6078,19 +6078,19 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
if (persistentDef) { if (persistentDef) {
switch (action) { switch (action) {
case VIR_DOMAIN_IOTHREAD_ACTION_ADD: case VIR_DOMAIN_IOTHREAD_ACTION_ADD:
if (qemuDomainAddIOThreadCheck(persistentDef, iothread_id) < 0) if (qemuDomainAddIOThreadCheck(persistentDef, iothread.iothread_id) < 0)
goto endjob; goto endjob;
if (!virDomainIOThreadIDAdd(persistentDef, iothread_id)) if (!virDomainIOThreadIDAdd(persistentDef, iothread.iothread_id))
goto endjob; goto endjob;
break; break;
case VIR_DOMAIN_IOTHREAD_ACTION_DEL: case VIR_DOMAIN_IOTHREAD_ACTION_DEL:
if (qemuDomainDelIOThreadCheck(persistentDef, iothread_id) < 0) if (qemuDomainDelIOThreadCheck(persistentDef, iothread.iothread_id) < 0)
goto endjob; goto endjob;
virDomainIOThreadIDDel(persistentDef, iothread_id); virDomainIOThreadIDDel(persistentDef, iothread.iothread_id);
break; break;
} }
...@@ -6117,6 +6117,7 @@ qemuDomainAddIOThread(virDomainPtr dom, ...@@ -6117,6 +6117,7 @@ qemuDomainAddIOThread(virDomainPtr dom,
{ {
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
qemuMonitorIOThreadInfo iothread = {0};
int ret = -1; int ret = -1;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
...@@ -6134,7 +6135,8 @@ qemuDomainAddIOThread(virDomainPtr dom, ...@@ -6134,7 +6135,8 @@ qemuDomainAddIOThread(virDomainPtr dom,
if (virDomainAddIOThreadEnsureACL(dom->conn, vm->def, flags) < 0) if (virDomainAddIOThreadEnsureACL(dom->conn, vm->def, flags) < 0)
goto cleanup; goto cleanup;
ret = qemuDomainChgIOThread(driver, vm, iothread_id, iothread.iothread_id = iothread_id;
ret = qemuDomainChgIOThread(driver, vm, iothread,
VIR_DOMAIN_IOTHREAD_ACTION_ADD, flags); VIR_DOMAIN_IOTHREAD_ACTION_ADD, flags);
cleanup: cleanup:
...@@ -6150,6 +6152,7 @@ qemuDomainDelIOThread(virDomainPtr dom, ...@@ -6150,6 +6152,7 @@ qemuDomainDelIOThread(virDomainPtr dom,
{ {
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
qemuMonitorIOThreadInfo iothread = {0};
int ret = -1; int ret = -1;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
...@@ -6167,7 +6170,8 @@ qemuDomainDelIOThread(virDomainPtr dom, ...@@ -6167,7 +6170,8 @@ qemuDomainDelIOThread(virDomainPtr dom,
if (virDomainDelIOThreadEnsureACL(dom->conn, vm->def, flags) < 0) if (virDomainDelIOThreadEnsureACL(dom->conn, vm->def, flags) < 0)
goto cleanup; goto cleanup;
ret = qemuDomainChgIOThread(driver, vm, iothread_id, iothread.iothread_id = iothread_id;
ret = qemuDomainChgIOThread(driver, vm, iothread,
VIR_DOMAIN_IOTHREAD_ACTION_DEL, flags); VIR_DOMAIN_IOTHREAD_ACTION_DEL, flags);
cleanup: cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册