mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
virDomainObjGetShortName: take virDomainDef
So far this function takes virDomainObjPtr which: 1) is an overkill, 2) might be not available in all the places we will use it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
dc18766b10
commit
7ed6934f3b
@ -25701,13 +25701,13 @@ virDomainDefHasMemballoon(const virDomainDef *def)
|
|||||||
* Shorten domain name to avoid possible path length limitations.
|
* Shorten domain name to avoid possible path length limitations.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
virDomainObjGetShortName(virDomainObjPtr vm)
|
virDomainObjGetShortName(const virDomainDef *def)
|
||||||
{
|
{
|
||||||
const int dommaxlen = 20;
|
const int dommaxlen = 20;
|
||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
|
|
||||||
ignore_value(virAsprintf(&ret, "%d-%.*s",
|
ignore_value(virAsprintf(&ret, "%d-%.*s",
|
||||||
vm->def->id, dommaxlen, vm->def->name));
|
def->id, dommaxlen, def->name));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -3205,7 +3205,7 @@ int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
|
|||||||
|
|
||||||
bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
|
bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
|
||||||
|
|
||||||
char *virDomainObjGetShortName(virDomainObjPtr vm);
|
char *virDomainObjGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
|
||||||
|
|
||||||
int
|
int
|
||||||
virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def,
|
virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def,
|
||||||
|
@ -1475,7 +1475,7 @@ qemuDomainSetPrivatePaths(virQEMUDriverPtr driver,
|
|||||||
{
|
{
|
||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
char *domname = virDomainObjGetShortName(vm);
|
char *domname = virDomainObjGetShortName(vm->def);
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!domname)
|
if (!domname)
|
||||||
|
@ -3885,7 +3885,7 @@ getAutoDumpPath(virQEMUDriverPtr driver,
|
|||||||
virDomainObjPtr vm)
|
virDomainObjPtr vm)
|
||||||
{
|
{
|
||||||
char *dumpfile = NULL;
|
char *dumpfile = NULL;
|
||||||
char *domname = virDomainObjGetShortName(vm);
|
char *domname = virDomainObjGetShortName(vm->def);
|
||||||
char timestr[100];
|
char timestr[100];
|
||||||
struct tm time_info;
|
struct tm time_info;
|
||||||
time_t curtime = time(NULL);
|
time_t curtime = time(NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user