qemu_agent: rename qemuAgentDiskInfo->qemuAgentDiskAddress

To match the QGA schema name (we are introducing a qemuAgentDiskInfo
struct again for different purpose).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Han Han <hhan@redhat.com>
This commit is contained in:
Marc-André Lureau 2020-11-20 22:09:40 +04:00 committed by Michal Privoznik
parent 38dfd3e80e
commit 7b1bebdf3d
3 changed files with 11 additions and 11 deletions

View File

@ -1816,7 +1816,7 @@ qemuAgentSetTime(qemuAgentPtr agent,
}
static void
qemuAgentDiskInfoFree(qemuAgentDiskInfoPtr info)
qemuAgentDiskAddressFree(qemuAgentDiskAddressPtr info)
{
if (!info)
return;
@ -1840,7 +1840,7 @@ qemuAgentFSInfoFree(qemuAgentFSInfoPtr info)
g_free(info->fstype);
for (i = 0; i < info->ndisks; i++)
qemuAgentDiskInfoFree(info->disks[i]);
qemuAgentDiskAddressFree(info->disks[i]);
g_free(info->disks);
g_free(info);
@ -1862,13 +1862,13 @@ qemuAgentGetFSInfoFillDisks(virJSONValuePtr jsondisks,
ndisks = virJSONValueArraySize(jsondisks);
if (ndisks)
fsinfo->disks = g_new0(qemuAgentDiskInfoPtr, ndisks);
fsinfo->disks = g_new0(qemuAgentDiskAddressPtr, ndisks);
fsinfo->ndisks = ndisks;
for (i = 0; i < fsinfo->ndisks; i++) {
virJSONValuePtr jsondisk = virJSONValueArrayGet(jsondisks, i);
virJSONValuePtr pci;
qemuAgentDiskInfoPtr disk;
qemuAgentDiskAddressPtr disk;
const char *val;
if (!jsondisk) {
@ -1879,7 +1879,7 @@ qemuAgentGetFSInfoFillDisks(virJSONValuePtr jsondisks,
return -1;
}
fsinfo->disks[i] = g_new0(qemuAgentDiskInfo, 1);
fsinfo->disks[i] = g_new0(qemuAgentDiskAddress, 1);
disk = fsinfo->disks[i];
if ((val = virJSONValueObjectGetString(jsondisk, "bus-type")))

View File

@ -67,9 +67,9 @@ typedef enum {
QEMU_AGENT_SHUTDOWN_LAST,
} qemuAgentShutdownMode;
typedef struct _qemuAgentDiskInfo qemuAgentDiskInfo;
typedef qemuAgentDiskInfo *qemuAgentDiskInfoPtr;
struct _qemuAgentDiskInfo {
typedef struct _qemuAgentDiskAddress qemuAgentDiskAddress;
typedef qemuAgentDiskAddress *qemuAgentDiskAddressPtr;
struct _qemuAgentDiskAddress {
char *serial;
virPCIDeviceAddress pci_controller;
char *bus_type;
@ -88,7 +88,7 @@ struct _qemuAgentFSInfo {
long long total_bytes;
long long used_bytes;
size_t ndisks;
qemuAgentDiskInfoPtr *disks;
qemuAgentDiskAddressPtr *disks;
};
void qemuAgentFSInfoFree(qemuAgentFSInfoPtr info);

View File

@ -18873,7 +18873,7 @@ qemuAgentFSInfoToPublic(qemuAgentFSInfoPtr agent,
ret->ndevAlias = agent->ndisks;
for (i = 0; i < ret->ndevAlias; i++) {
qemuAgentDiskInfoPtr agentdisk = agent->disks[i];
qemuAgentDiskAddressPtr agentdisk = agent->disks[i];
virDomainDiskDefPtr diskDef;
diskDef = virDomainDiskByAddress(vmdef,
@ -19925,7 +19925,7 @@ qemuAgentFSInfoFormatParams(qemuAgentFSInfoPtr *fsinfo,
return;
for (j = 0; j < fsinfo[i]->ndisks; j++) {
virDomainDiskDefPtr diskdef = NULL;
qemuAgentDiskInfoPtr d = fsinfo[i]->disks[j];
qemuAgentDiskAddressPtr d = fsinfo[i]->disks[j];
/* match the disk to the target in the vm definition */
diskdef = virDomainDiskByAddress(vmdef,
&d->pci_controller,