From 68ea80cfdd41bc3adbe70ac5d0a9c396c81690a3 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Sat, 30 Apr 2011 10:34:49 -0600 Subject: [PATCH] maint: rename virBufferVSprintf to virBufferAsprintf We already have virAsprintf, so picking a similar name helps for seeing a similar purpose. Furthermore, the prefix V before printf generally implies 'va_list', even though this variant was '...', and the old name got in the way of adding a new va_list version. global rename performed with: $ git grep -l virBufferVSprintf \ | xargs -L1 sed -i 's/virBufferVSprintf/virBufferAsprintf/g' then revert the changes in ChangeLog-old. --- HACKING | 2 +- docs/api_extension/0008-support-new-xml.patch | 46 +-- ...ve-vcpu-support-in-qemu-command-line.patch | 8 +- ...ove-vcpu-support-in-xen-command-line.patch | 12 +- docs/hacking.html.in | 2 +- docs/news.html.in | 4 +- src/conf/capabilities.c | 48 +-- src/conf/cpu_conf.c | 24 +- src/conf/domain_conf.c | 294 +++++++++--------- src/conf/interface_conf.c | 60 ++-- src/conf/network_conf.c | 26 +- src/conf/node_device_conf.c | 62 ++-- src/conf/nwfilter_conf.c | 34 +- src/conf/nwfilter_params.c | 2 +- src/conf/secret_conf.c | 4 +- src/conf/storage_conf.c | 70 ++--- src/conf/storage_encryption_conf.c | 6 +- src/cpu/cpu_map.c | 2 +- src/esx/esx_driver.c | 4 +- src/esx/esx_vi.c | 2 +- src/esx/esx_vi_types.c | 6 +- src/libvirt_private.syms | 2 +- src/network/bridge_driver.c | 4 +- src/node_device/node_device_udev.c | 4 +- src/nwfilter/nwfilter_ebiptables_driver.c | 206 ++++++------ src/nwfilter/nwfilter_learnipaddr.c | 4 +- src/openvz/openvz_driver.c | 18 +- src/phyp/phyp_driver.c | 248 +++++++-------- src/qemu/qemu_command.c | 256 +++++++-------- src/qemu/qemu_domain.c | 8 +- src/qemu/qemu_monitor.c | 4 +- src/security/virt-aa-helper.c | 12 +- src/uml/uml_conf.c | 10 +- src/util/bitmap.c | 2 +- src/util/buf.c | 12 +- src/util/buf.h | 2 +- src/util/conf.c | 10 +- src/util/logging.c | 8 +- src/util/sexpr.c | 2 +- src/util/sysinfo.c | 12 +- src/vmx/vmx.c | 138 ++++---- src/xen/xend_internal.c | 2 +- src/xen/xm_internal.c | 2 +- src/xenapi/xenapi_utils.c | 2 +- src/xenxs/xen_sxpr.c | 60 ++-- src/xenxs/xen_xm.c | 40 +-- tests/cputest.c | 6 +- tests/virbuftest.c | 2 +- tools/virsh.c | 64 ++-- 49 files changed, 929 insertions(+), 929 deletions(-) diff --git a/HACKING b/HACKING index 686328c26e..8ebbec774e 100644 --- a/HACKING +++ b/HACKING @@ -545,7 +545,7 @@ Typical usage is as follows: ... virBufferAddLit(&buf, "\n"); - virBufferVSprintf(&buf, " %d\n", memory); + virBufferAsprintf(&buf, " %d\n", memory); ... virBufferAddLit(&buf, "\n"); diff --git a/docs/api_extension/0008-support-new-xml.patch b/docs/api_extension/0008-support-new-xml.patch index 821cfa55ce..276b339ca6 100644 --- a/docs/api_extension/0008-support-new-xml.patch +++ b/docs/api_extension/0008-support-new-xml.patch @@ -107,7 +107,7 @@ index 78d7a6a..a997e06 100644 allones = 0; - if (allones) { -- virBufferVSprintf(&buf, " %lu\n", def->vcpus); +- virBufferAsprintf(&buf, " %lu\n", def->vcpus); - } else { + virBufferAddLit(&buf, " cpumask, def->cpumasklen)) == NULL) goto cleanup; -- virBufferVSprintf(&buf, " %lu\n", +- virBufferAsprintf(&buf, " %lu\n", - cpumask, def->vcpus); -+ virBufferVSprintf(&buf, " cpuset='%s'", cpumask); ++ virBufferAsprintf(&buf, " cpuset='%s'", cpumask); VIR_FREE(cpumask); } + if (def->vcpus != def->maxvcpus) -+ virBufferVSprintf(&buf, " current='%u'", def->vcpus); -+ virBufferVSprintf(&buf, ">%u\n", def->maxvcpus); ++ virBufferAsprintf(&buf, " current='%u'", def->vcpus); ++ virBufferAsprintf(&buf, ">%u\n", def->maxvcpus); if (def->os.bootloader) { virBufferEscapeString(&buf, " %s\n", @@ -184,8 +184,8 @@ index 7ec8c0e..0a26614 100644 goto cleanup; } -- virBufferVSprintf(&buffer, "numvcpus = \"%d\"\n", (int)def->vcpus); -+ virBufferVSprintf(&buffer, "numvcpus = \"%d\"\n", def->maxvcpus); +- virBufferAsprintf(&buffer, "numvcpus = \"%d\"\n", (int)def->vcpus); ++ virBufferAsprintf(&buffer, "numvcpus = \"%d\"\n", def->maxvcpus); /* def:cpumask -> vmx:sched.cpu.affinity */ if (def->cpumasklen > 0) { @@ -221,8 +221,8 @@ index 44e28dc..2079c51 100644 { int i; virBuffer buf= VIR_BUFFER_INITIALIZER; -- virBufferVSprintf(&buf,"#OpenNebula Template automatically generated by libvirt\nNAME = %s\nCPU = %ld\nMEMORY = %ld\n", -+ virBufferVSprintf(&buf,"#OpenNebula Template automatically generated " +- virBufferAsprintf(&buf,"#OpenNebula Template automatically generated by libvirt\nNAME = %s\nCPU = %ld\nMEMORY = %ld\n", ++ virBufferAsprintf(&buf,"#OpenNebula Template automatically generated " + "by libvirt\nNAME = %s\nCPU = %d\nMEMORY = %ld\n", def->name, - def->vcpus, @@ -311,19 +311,19 @@ index 83c0f83..38c8351 100644 { virBuffer buf = VIR_BUFFER_INITIALIZER; -- virBufferVSprintf(&buf, "%lu", def->vcpus); -+ virBufferVSprintf(&buf, "%u", def->vcpus); +- virBufferAsprintf(&buf, "%lu", def->vcpus); ++ virBufferAsprintf(&buf, "%u", def->vcpus); if ((qemuCmdFlags & QEMUD_CMD_FLAG_SMP_TOPOLOGY)) { /* sockets, cores, and threads are either all zero @@ -3722,11 +3722,18 @@ qemuBuildSmpArgStr(const virDomainDefPtr def, - virBufferVSprintf(&buf, ",threads=%u", def->cpu->threads); + virBufferAsprintf(&buf, ",threads=%u", def->cpu->threads); } else { -- virBufferVSprintf(&buf, ",sockets=%lu", def->vcpus); -+ virBufferVSprintf(&buf, ",sockets=%u", def->maxvcpus); - virBufferVSprintf(&buf, ",cores=%u", 1); - virBufferVSprintf(&buf, ",threads=%u", 1); +- virBufferAsprintf(&buf, ",sockets=%lu", def->vcpus); ++ virBufferAsprintf(&buf, ",sockets=%u", def->maxvcpus); + virBufferAsprintf(&buf, ",cores=%u", 1); + virBufferAsprintf(&buf, ",threads=%u", 1); } } + if (def->vcpus != def->maxvcpus) { @@ -425,20 +425,20 @@ index 5ffc3c8..456b477 100644 */ char * @@ -5666,7 +5667,7 @@ xenDaemonFormatSxpr(virConnectPtr conn, - virBufferVSprintf(&buf, "(name '%s')", def->name); - virBufferVSprintf(&buf, "(memory %lu)(maxmem %lu)", + virBufferAsprintf(&buf, "(name '%s')", def->name); + virBufferAsprintf(&buf, "(memory %lu)(maxmem %lu)", def->mem.cur_balloon/1024, def->mem.max_balloon/1024); -- virBufferVSprintf(&buf, "(vcpus %lu)", def->vcpus); -+ virBufferVSprintf(&buf, "(vcpus %u)", def->maxvcpus); +- virBufferAsprintf(&buf, "(vcpus %lu)", def->vcpus); ++ virBufferAsprintf(&buf, "(vcpus %u)", def->maxvcpus); if (def->cpumask) { char *ranges = virDomainCpuSetFormat(def->cpumask, def->cpumasklen); @@ -5761,7 +5762,7 @@ xenDaemonFormatSxpr(virConnectPtr conn, else - virBufferVSprintf(&buf, "(kernel '%s')", def->os.loader); + virBufferAsprintf(&buf, "(kernel '%s')", def->os.loader); -- virBufferVSprintf(&buf, "(vcpus %lu)", def->vcpus); -+ virBufferVSprintf(&buf, "(vcpus %u)", def->maxvcpus); +- virBufferAsprintf(&buf, "(vcpus %lu)", def->vcpus); ++ virBufferAsprintf(&buf, "(vcpus %u)", def->maxvcpus); for (i = 0 ; i < def->os.nBootDevs ; i++) { switch (def->os.bootDevs[i]) { diff --git a/docs/api_extension/0010-improve-vcpu-support-in-qemu-command-line.patch b/docs/api_extension/0010-improve-vcpu-support-in-qemu-command-line.patch index e0829918ad..02320bb9f5 100644 --- a/docs/api_extension/0010-improve-vcpu-support-in-qemu-command-line.patch +++ b/docs/api_extension/0010-improve-vcpu-support-in-qemu-command-line.patch @@ -23,17 +23,17 @@ index 38c8351..ffe184b 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -3714,6 +3714,8 @@ qemuBuildSmpArgStr(const virDomainDefPtr def, - virBufferVSprintf(&buf, "%u", def->vcpus); + virBufferAsprintf(&buf, "%u", def->vcpus); if ((qemuCmdFlags & QEMUD_CMD_FLAG_SMP_TOPOLOGY)) { + if (def->vcpus != def->maxvcpus) -+ virBufferVSprintf(&buf, ",maxcpus=%u", def->maxvcpus); ++ virBufferAsprintf(&buf, ",maxcpus=%u", def->maxvcpus); /* sockets, cores, and threads are either all zero * or all non-zero, thus checking one of them is enough */ if (def->cpu && def->cpu->sockets) { @@ -3726,12 +3728,12 @@ qemuBuildSmpArgStr(const virDomainDefPtr def, - virBufferVSprintf(&buf, ",cores=%u", 1); - virBufferVSprintf(&buf, ",threads=%u", 1); + virBufferAsprintf(&buf, ",cores=%u", 1); + virBufferAsprintf(&buf, ",threads=%u", 1); } - } - if (def->vcpus != def->maxvcpus) { diff --git a/docs/api_extension/0012-improve-vcpu-support-in-xen-command-line.patch b/docs/api_extension/0012-improve-vcpu-support-in-xen-command-line.patch index f8764b326f..0a7b2fccff 100644 --- a/docs/api_extension/0012-improve-vcpu-support-in-xen-command-line.patch +++ b/docs/api_extension/0012-improve-vcpu-support-in-xen-command-line.patch @@ -88,21 +88,21 @@ index 456b477..dfc6415 100644 } @@ -5668,6 +5675,9 @@ xenDaemonFormatSxpr(virConnectPtr conn, - virBufferVSprintf(&buf, "(memory %lu)(maxmem %lu)", + virBufferAsprintf(&buf, "(memory %lu)(maxmem %lu)", def->mem.cur_balloon/1024, def->mem.max_balloon/1024); - virBufferVSprintf(&buf, "(vcpus %u)", def->maxvcpus); + virBufferAsprintf(&buf, "(vcpus %u)", def->maxvcpus); + /* Computing the vcpu_avail bitmask works because MAX_VIRT_CPUS is 32. */ + if (def->vcpus < def->maxvcpus) -+ virBufferVSprintf(&buf, "(vcpu_avail %u)", (1U << def->vcpus) - 1); ++ virBufferAsprintf(&buf, "(vcpu_avail %u)", (1U << def->vcpus) - 1); if (def->cpumask) { char *ranges = virDomainCpuSetFormat(def->cpumask, def->cpumasklen); @@ -5763,6 +5773,9 @@ xenDaemonFormatSxpr(virConnectPtr conn, - virBufferVSprintf(&buf, "(kernel '%s')", def->os.loader); + virBufferAsprintf(&buf, "(kernel '%s')", def->os.loader); - virBufferVSprintf(&buf, "(vcpus %u)", def->maxvcpus); + virBufferAsprintf(&buf, "(vcpus %u)", def->maxvcpus); + if (def->vcpus < def->maxvcpus) -+ virBufferVSprintf(&buf, "(vcpu_avail %u)", ++ virBufferAsprintf(&buf, "(vcpu_avail %u)", + (1U << def->vcpus) - 1); for (i = 0 ; i < def->os.nBootDevs ; i++) { diff --git a/docs/hacking.html.in b/docs/hacking.html.in index dd8eeb8fc4..68886878e5 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -654,7 +654,7 @@ ... virBufferAddLit(&buf, "<domain>\n"); - virBufferVSprintf(&buf, " <memory>%d</memory>\n", memory); + virBufferAsprintf(&buf, " <memory>%d</memory>\n", memory); ... virBufferAddLit(&buf, "</domain>\n"); diff --git a/docs/news.html.in b/docs/news.html.in index 57b7fb5671..fc18f621c0 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -1098,7 +1098,7 @@ and check the GIT log
  • Documentation:
    updated c# bindings with arnauds latest changes (Justin Clift),
    - Fix spelling of virBufferVSprintf (Jiri Denemark),
    + Fix spelling of virBufferAsprintf (Jiri Denemark),
    Fix broken XML entity for '>' (Philipp Hahn),
    removed outdated reference to virt-mem (Justin Clift),
    Add doc for missed options of migrate (Osier Yang),
    @@ -2806,7 +2806,7 @@ and check the GIT log virsh.c: avoid all leaks in OOM path in cmdCPUBaseline (Jiri Denemark),
    Fixed reference count in virsh pool-build command (David Allan),
    Fix daemon-conf invalid failures (David Allan),
    - virBufferVSprintf: do not omit va_end(argptr) call (Jim Meyering),
    + virBufferAsprintf: do not omit va_end(argptr) call (Jim Meyering),
    xend_internal.c: don't dereference NULL for unexpected input (Jim Meyering),
    virsh: be careful to return "FALSE" upon OOM (Jim Meyering),
    virBufferStrcat: do not skip va_end (Jim Meyering),
    diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index cb9113ca1e..2f243ae467 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -666,16 +666,16 @@ virCapabilitiesFormatXML(virCapsPtr caps) virBufferAddLit(&xml, " \n"); if (virUUIDIsValid(caps->host.host_uuid)) { virUUIDFormat(caps->host.host_uuid, host_uuid); - virBufferVSprintf(&xml," %s\n", host_uuid); + virBufferAsprintf(&xml," %s\n", host_uuid); } virBufferAddLit(&xml, " \n"); - virBufferVSprintf(&xml, " %s\n", + virBufferAsprintf(&xml, " %s\n", caps->host.arch); if (caps->host.nfeatures) { virBufferAddLit(&xml, " \n"); for (i = 0 ; i < caps->host.nfeatures ; i++) { - virBufferVSprintf(&xml, " <%s/>\n", + virBufferAsprintf(&xml, " <%s/>\n", caps->host.features[i]); } virBufferAddLit(&xml, " \n"); @@ -693,7 +693,7 @@ virCapabilitiesFormatXML(virCapsPtr caps) if (caps->host.nmigrateTrans) { virBufferAddLit(&xml, " \n"); for (i = 0 ; i < caps->host.nmigrateTrans ; i++) { - virBufferVSprintf(&xml, " %s\n", + virBufferAsprintf(&xml, " %s\n", caps->host.migrateTrans[i]); } virBufferAddLit(&xml, " \n"); @@ -703,15 +703,15 @@ virCapabilitiesFormatXML(virCapsPtr caps) if (caps->host.nnumaCell) { virBufferAddLit(&xml, " \n"); - virBufferVSprintf(&xml, " \n", + virBufferAsprintf(&xml, " \n", caps->host.nnumaCell); for (i = 0 ; i < caps->host.nnumaCell ; i++) { - virBufferVSprintf(&xml, " \n", + virBufferAsprintf(&xml, " \n", caps->host.numaCell[i]->num); - virBufferVSprintf(&xml, " \n", + virBufferAsprintf(&xml, " \n", caps->host.numaCell[i]->ncpus); for (j = 0 ; j < caps->host.numaCell[i]->ncpus ; j++) - virBufferVSprintf(&xml, " \n", + virBufferAsprintf(&xml, " \n", caps->host.numaCell[i]->cpus[j]); virBufferAddLit(&xml, " \n"); virBufferAddLit(&xml, " \n"); @@ -722,8 +722,8 @@ virCapabilitiesFormatXML(virCapsPtr caps) if (caps->host.secModel.model) { virBufferAddLit(&xml, " \n"); - virBufferVSprintf(&xml, " %s\n", caps->host.secModel.model); - virBufferVSprintf(&xml, " %s\n", caps->host.secModel.doi); + virBufferAsprintf(&xml, " %s\n", caps->host.secModel.model); + virBufferAsprintf(&xml, " %s\n", caps->host.secModel.doi); virBufferAddLit(&xml, " \n"); } @@ -732,43 +732,43 @@ virCapabilitiesFormatXML(virCapsPtr caps) for (i = 0 ; i < caps->nguests ; i++) { virBufferAddLit(&xml, " \n"); - virBufferVSprintf(&xml, " %s\n", + virBufferAsprintf(&xml, " %s\n", caps->guests[i]->ostype); - virBufferVSprintf(&xml, " \n", + virBufferAsprintf(&xml, " \n", caps->guests[i]->arch.name); - virBufferVSprintf(&xml, " %d\n", + virBufferAsprintf(&xml, " %d\n", caps->guests[i]->arch.wordsize); if (caps->guests[i]->arch.defaultInfo.emulator) - virBufferVSprintf(&xml, " %s\n", + virBufferAsprintf(&xml, " %s\n", caps->guests[i]->arch.defaultInfo.emulator); if (caps->guests[i]->arch.defaultInfo.loader) - virBufferVSprintf(&xml, " %s\n", + virBufferAsprintf(&xml, " %s\n", caps->guests[i]->arch.defaultInfo.loader); for (j = 0 ; j < caps->guests[i]->arch.defaultInfo.nmachines ; j++) { virCapsGuestMachinePtr machine = caps->guests[i]->arch.defaultInfo.machines[j]; virBufferAddLit(&xml, " canonical) - virBufferVSprintf(&xml, " canonical='%s'", machine->canonical); - virBufferVSprintf(&xml, ">%s\n", machine->name); + virBufferAsprintf(&xml, " canonical='%s'", machine->canonical); + virBufferAsprintf(&xml, ">%s\n", machine->name); } for (j = 0 ; j < caps->guests[i]->arch.ndomains ; j++) { - virBufferVSprintf(&xml, " \n", + virBufferAsprintf(&xml, " \n", caps->guests[i]->arch.domains[j]->type); if (caps->guests[i]->arch.domains[j]->info.emulator) - virBufferVSprintf(&xml, " %s\n", + virBufferAsprintf(&xml, " %s\n", caps->guests[i]->arch.domains[j]->info.emulator); if (caps->guests[i]->arch.domains[j]->info.loader) - virBufferVSprintf(&xml, " %s\n", + virBufferAsprintf(&xml, " %s\n", caps->guests[i]->arch.domains[j]->info.loader); for (k = 0 ; k < caps->guests[i]->arch.domains[j]->info.nmachines ; k++) { virCapsGuestMachinePtr machine = caps->guests[i]->arch.domains[j]->info.machines[k]; virBufferAddLit(&xml, " canonical) - virBufferVSprintf(&xml, " canonical='%s'", machine->canonical); - virBufferVSprintf(&xml, ">%s\n", machine->name); + virBufferAsprintf(&xml, " canonical='%s'", machine->canonical); + virBufferAsprintf(&xml, ">%s\n", machine->name); } virBufferAddLit(&xml, " \n"); } @@ -784,10 +784,10 @@ virCapabilitiesFormatXML(virCapsPtr caps) STREQ(caps->guests[i]->features[j]->name, "ia64_be") || STREQ(caps->guests[i]->features[j]->name, "cpuselection") || STREQ(caps->guests[i]->features[j]->name, "deviceboot")) { - virBufferVSprintf(&xml, " <%s/>\n", + virBufferAsprintf(&xml, " <%s/>\n", caps->guests[i]->features[j]->name); } else { - virBufferVSprintf(&xml, " <%s default='%s' toggle='%s'/>\n", + virBufferAsprintf(&xml, " <%s default='%s' toggle='%s'/>\n", caps->guests[i]->features[j]->name, caps->guests[i]->features[j]->defaultOn ? "on" : "off", caps->guests[i]->features[j]->toggle ? "yes" : "no"); diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index ad49916a9d..98d598a979 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -353,28 +353,28 @@ virCPUDefFormatBuf(virBufferPtr buf, return -1; } - virBufferVSprintf(buf, "%s\n", indent, match); + virBufferAsprintf(buf, "%s\n", indent, match); } else - virBufferVSprintf(buf, "%s\n", indent); + virBufferAsprintf(buf, "%s\n", indent); if (def->arch) - virBufferVSprintf(buf, "%s %s\n", indent, def->arch); + virBufferAsprintf(buf, "%s %s\n", indent, def->arch); } if (def->model) - virBufferVSprintf(buf, "%s %s\n", indent, def->model); + virBufferAsprintf(buf, "%s %s\n", indent, def->model); if (def->vendor) { - virBufferVSprintf(buf, "%s %s\n", + virBufferAsprintf(buf, "%s %s\n", indent, def->vendor); } if (def->sockets && def->cores && def->threads) { - virBufferVSprintf(buf, "%s sockets); - virBufferVSprintf(buf, " cores='%u'", def->cores); - virBufferVSprintf(buf, " threads='%u'", def->threads); + virBufferAsprintf(buf, "%s sockets); + virBufferAsprintf(buf, " cores='%u'", def->cores); + virBufferAsprintf(buf, " threads='%u'", def->threads); virBufferAddLit(buf, "/>\n"); } @@ -396,17 +396,17 @@ virCPUDefFormatBuf(virBufferPtr buf, _("Unexpected CPU feature policy %d"), feature->policy); return -1; } - virBufferVSprintf(buf, "%s \n", + virBufferAsprintf(buf, "%s \n", indent, policy, feature->name); } else { - virBufferVSprintf(buf, "%s \n", + virBufferAsprintf(buf, "%s \n", indent, feature->name); } } if (!(flags & VIR_CPU_FORMAT_EMBEDED)) - virBufferVSprintf(buf, "%s\n", indent); + virBufferAsprintf(buf, "%s\n", indent); return 0; } diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2a681d9eb7..70ea350990 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1347,19 +1347,19 @@ virDomainDeviceInfoFormat(virBufferPtr buf, { if (info->alias && !(flags & VIR_DOMAIN_XML_INACTIVE)) { - virBufferVSprintf(buf, " \n", info->alias); + virBufferAsprintf(buf, " \n", info->alias); } if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) return 0; /* We'll be in domain/devices/[device type]/ so 3 level indent */ - virBufferVSprintf(buf, "
    type)); switch (info->type) { case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI: - virBufferVSprintf(buf, " domain='0x%.4x' bus='0x%.2x' slot='0x%.2x' function='0x%.1x'", + virBufferAsprintf(buf, " domain='0x%.4x' bus='0x%.2x' slot='0x%.2x' function='0x%.1x'", info->addr.pci.domain, info->addr.pci.bus, info->addr.pci.slot, @@ -1367,21 +1367,21 @@ virDomainDeviceInfoFormat(virBufferPtr buf, break; case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE: - virBufferVSprintf(buf, " controller='%d' bus='%d' unit='%d'", + virBufferAsprintf(buf, " controller='%d' bus='%d' unit='%d'", info->addr.drive.controller, info->addr.drive.bus, info->addr.drive.unit); break; case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL: - virBufferVSprintf(buf, " controller='%d' bus='%d' port='%d'", + virBufferAsprintf(buf, " controller='%d' bus='%d' port='%d'", info->addr.vioserial.controller, info->addr.vioserial.bus, info->addr.vioserial.port); break; case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID: - virBufferVSprintf(buf, " controller='%d' slot='%d'", + virBufferAsprintf(buf, " controller='%d' slot='%d'", info->addr.ccid.controller, info->addr.ccid.slot); break; @@ -4974,7 +4974,7 @@ virVirtualPortProfileFormat(virBufferPtr buf, if (virtPort->virtPortType == VIR_VIRTUALPORT_NONE) return; - virBufferVSprintf(buf, "%s\n", + virBufferAsprintf(buf, "%s\n", indent, virVirtualPortTypeToString(virtPort->virtPortType)); @@ -4986,7 +4986,7 @@ virVirtualPortProfileFormat(virBufferPtr buf, case VIR_VIRTUALPORT_8021QBG: virUUIDFormat(virtPort->u.virtPort8021Qbg.instanceID, uuidstr); - virBufferVSprintf(buf, + virBufferAsprintf(buf, "%s \n", indent, @@ -4997,14 +4997,14 @@ virVirtualPortProfileFormat(virBufferPtr buf, break; case VIR_VIRTUALPORT_8021QBH: - virBufferVSprintf(buf, + virBufferAsprintf(buf, "%s \n", indent, virtPort->u.virtPort8021Qbh.profileID); break; } - virBufferVSprintf(buf, "%s\n", indent); + virBufferAsprintf(buf, "%s\n", indent); } int virDomainDiskIndexByName(virDomainDefPtr def, const char *name) @@ -6653,9 +6653,9 @@ virDomainCpuSetFormat(char *cpuset, int maxcpu) else first = 0; if (cur == start + 1) - virBufferVSprintf(&buf, "%d", start); + virBufferAsprintf(&buf, "%d", start); else - virBufferVSprintf(&buf, "%d-%d", start, cur - 1); + virBufferAsprintf(&buf, "%d-%d", start, cur - 1); start = -1; } cur++; @@ -6664,9 +6664,9 @@ virDomainCpuSetFormat(char *cpuset, int maxcpu) if (!first) virBufferAddLit(&buf, ","); if (maxcpu == start + 1) - virBufferVSprintf(&buf, "%d", start); + virBufferAsprintf(&buf, "%d", start); else - virBufferVSprintf(&buf, "%d-%d", start, maxcpu - 1); + virBufferAsprintf(&buf, "%d-%d", start, maxcpu - 1); } if (virBufferError(&buf)) { @@ -6915,7 +6915,7 @@ virDomainLifecycleDefFormat(virBufferPtr buf, return -1; } - virBufferVSprintf(buf, " <%s>%s\n", name, typeStr, name); + virBufferAsprintf(buf, " <%s>%s\n", name, typeStr, name); return 0; } @@ -6959,23 +6959,23 @@ virDomainDiskDefFormat(virBufferPtr buf, return -1; } - virBufferVSprintf(buf, + virBufferAsprintf(buf, " \n", type, device); if (def->driverName || def->driverType || def->cachemode) { - virBufferVSprintf(buf, " driverName) - virBufferVSprintf(buf, " name='%s'", def->driverName); + virBufferAsprintf(buf, " name='%s'", def->driverName); if (def->driverType) - virBufferVSprintf(buf, " type='%s'", def->driverType); + virBufferAsprintf(buf, " type='%s'", def->driverType); if (def->cachemode) - virBufferVSprintf(buf, " cache='%s'", cachemode); + virBufferAsprintf(buf, " cache='%s'", cachemode); if (def->error_policy) - virBufferVSprintf(buf, " error_policy='%s'", error_policy); + virBufferAsprintf(buf, " error_policy='%s'", error_policy); if (def->iomode) - virBufferVSprintf(buf, " io='%s'", iomode); - virBufferVSprintf(buf, "/>\n"); + virBufferAsprintf(buf, " io='%s'", iomode); + virBufferAsprintf(buf, "/>\n"); } if (def->src || def->nhosts > 0) { @@ -6993,24 +6993,24 @@ virDomainDiskDefFormat(virBufferPtr buf, def->src); break; case VIR_DOMAIN_DISK_TYPE_NETWORK: - virBufferVSprintf(buf, " protocol)); if (def->src) { virBufferEscapeString(buf, " name='%s'", def->src); } if (def->nhosts == 0) { - virBufferVSprintf(buf, "/>\n"); + virBufferAsprintf(buf, "/>\n"); } else { int i; - virBufferVSprintf(buf, ">\n"); + virBufferAsprintf(buf, ">\n"); for (i = 0; i < def->nhosts; i++) { virBufferEscapeString(buf, " hosts[i].name); virBufferEscapeString(buf, " port='%s'/>\n", def->hosts[i].port); } - virBufferVSprintf(buf, " \n"); + virBufferAsprintf(buf, " \n"); } break; default: @@ -7021,11 +7021,11 @@ virDomainDiskDefFormat(virBufferPtr buf, } } - virBufferVSprintf(buf, " \n", + virBufferAsprintf(buf, " \n", def->dst, bus); if (def->bootIndex) - virBufferVSprintf(buf, " \n", def->bootIndex); + virBufferAsprintf(buf, " \n", def->bootIndex); if (def->readonly) virBufferAddLit(buf, " \n"); if (def->shared) @@ -7069,7 +7069,7 @@ virDomainControllerDefFormat(virBufferPtr buf, } } - virBufferVSprintf(buf, + virBufferAsprintf(buf, " idx); @@ -7080,11 +7080,11 @@ virDomainControllerDefFormat(virBufferPtr buf, switch (def->type) { case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL: if (def->opts.vioserial.ports != -1) { - virBufferVSprintf(buf, " ports='%d'", + virBufferAsprintf(buf, " ports='%d'", def->opts.vioserial.ports); } if (def->opts.vioserial.vectors != -1) { - virBufferVSprintf(buf, " vectors='%d'", + virBufferAsprintf(buf, " vectors='%d'", def->opts.vioserial.vectors); } break; @@ -7126,7 +7126,7 @@ virDomainFSDefFormat(virBufferPtr buf, } - virBufferVSprintf(buf, + virBufferAsprintf(buf, " \n", type, accessmode); @@ -7153,7 +7153,7 @@ virDomainFSDefFormat(virBufferPtr buf, } } - virBufferVSprintf(buf, " \n", + virBufferAsprintf(buf, " \n", def->dst); if (def->readonly) @@ -7181,9 +7181,9 @@ virDomainNetDefFormat(virBufferPtr buf, return -1; } - virBufferVSprintf(buf, " \n", type); + virBufferAsprintf(buf, " \n", type); - virBufferVSprintf(buf, + virBufferAsprintf(buf, " \n", def->mac[0], def->mac[1], def->mac[2], def->mac[3], def->mac[4], def->mac[5]); @@ -7199,7 +7199,7 @@ virDomainNetDefFormat(virBufferPtr buf, virBufferEscapeString(buf, " \n", def->data.ethernet.dev); if (def->data.ethernet.ipaddr) - virBufferVSprintf(buf, " \n", + virBufferAsprintf(buf, " \n", def->data.ethernet.ipaddr); if (def->data.ethernet.script) virBufferEscapeString(buf, "