From 6ee1c0ff6799316cb78e43d53c321b4e6d9b7c6f Mon Sep 17 00:00:00 2001 From: Wang Rui Date: Wed, 10 Dec 2014 17:45:33 +0800 Subject: [PATCH] maint: clean up the unused variable 'caps' in src/qemu/qemu_*.c Signed-off-by: Wang Rui --- src/qemu/qemu_driver.c | 9 --------- src/qemu/qemu_hotplug.c | 5 ----- 2 files changed, 14 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ae6225b222..830fca737b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1864,7 +1864,6 @@ static int qemuDomainResume(virDomainPtr dom) virObjectEventPtr event = NULL; int state; virQEMUDriverConfigPtr cfg = NULL; - virCapsPtr caps = NULL; if (!(vm = qemuDomObjFromDomain(dom))) return -1; @@ -1901,8 +1900,6 @@ static int qemuDomainResume(virDomainPtr dom) VIR_DOMAIN_EVENT_RESUMED, VIR_DOMAIN_EVENT_RESUMED_UNPAUSED); } - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto endjob; if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) goto endjob; ret = 0; @@ -1916,7 +1913,6 @@ static int qemuDomainResume(virDomainPtr dom) virObjectUnlock(vm); if (event) qemuDomainEventQueue(driver, event); - virObjectUnref(caps); virObjectUnref(cfg); return ret; } @@ -7108,7 +7104,6 @@ qemuDomainChangeDiskMediaLive(virConnectPtr conn, { virDomainDiskDefPtr disk = dev->data.disk; virDomainDiskDefPtr orig_disk = NULL; - virCapsPtr caps = NULL; int ret = -1; if (virStorageTranslateDiskSourcePool(conn, disk) < 0) @@ -7129,9 +7124,6 @@ qemuDomainChangeDiskMediaLive(virConnectPtr conn, goto end; } - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto end; - /* Add the new disk src into shared disk hash table */ if (qemuAddSharedDevice(driver, dev, vm->def->name) < 0) goto end; @@ -7154,7 +7146,6 @@ qemuDomainChangeDiskMediaLive(virConnectPtr conn, } end: - virObjectUnref(caps); return ret; } diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 0d97b57996..95304517af 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -758,7 +758,6 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn, { virDomainDiskDefPtr disk = dev->data.disk; virDomainDiskDefPtr orig_disk = NULL; - virCapsPtr caps = NULL; int ret = -1; const char *driverName = virDomainDiskGetDriver(disk); const char *src = virDomainDiskGetSource(disk); @@ -796,9 +795,6 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn, goto end; } - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto end; - if (qemuDomainChangeEjectableMedia(driver, conn, vm, orig_disk, disk->src, false) < 0) goto end; @@ -837,7 +833,6 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn, end: if (ret != 0) ignore_value(qemuRemoveSharedDevice(driver, dev, vm->def->name)); - virObjectUnref(caps); return ret; }