mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
Tue Feb 14 14:50:22 EST 2007 Mark McLoughlin <markmc@redhat.com
* qemud/conf.c: handle an unspecified MAC address, fix the argv freeing code in qemudBuildCommandLine() and fix copy and paste error in qemudGenerateXML()
This commit is contained in:
parent
d16a83dd7c
commit
bf46e15b2c
@ -1,3 +1,9 @@
|
|||||||
|
Tue Feb 14 14:50:22 EST 2007 Mark McLoughlin <markmc@redhat.com
|
||||||
|
|
||||||
|
* qemud/conf.c: handle an unspecified MAC address,
|
||||||
|
fix the argv freeing code in qemudBuildCommandLine()
|
||||||
|
and fix copy and paste error in qemudGenerateXML()
|
||||||
|
|
||||||
Tue Feb 14 14:42:38 EST 2007 Mark McLoughlin <markmc@redhat.com
|
Tue Feb 14 14:42:38 EST 2007 Mark McLoughlin <markmc@redhat.com
|
||||||
|
|
||||||
* src/internal.h: add virConnect->qemud_fd so that
|
* src/internal.h: add virConnect->qemud_fd so that
|
||||||
|
27
qemud/conf.c
27
qemud/conf.c
@ -856,10 +856,16 @@ int qemudBuildCommandLine(struct qemud_server *server,
|
|||||||
} else {
|
} else {
|
||||||
while (net) {
|
while (net) {
|
||||||
char nic[3+1+7+1+17+1];
|
char nic[3+1+7+1+17+1];
|
||||||
sprintf(nic, "nic,macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
|
|
||||||
net->mac[0], net->mac[1],
|
if (!net->mac[0] && !net->mac[1] && !net->mac[2] &&
|
||||||
net->mac[2], net->mac[3],
|
!net->mac[3] && !net->mac[4] && !net->mac[5]) {
|
||||||
net->mac[4], net->mac[5]);
|
strncpy(nic, "nic", 4);
|
||||||
|
} else {
|
||||||
|
sprintf(nic, "nic,macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
|
||||||
|
net->mac[0], net->mac[1],
|
||||||
|
net->mac[2], net->mac[3],
|
||||||
|
net->mac[4], net->mac[5]);
|
||||||
|
}
|
||||||
|
|
||||||
if (!((*argv)[++n] = strdup("-net")))
|
if (!((*argv)[++n] = strdup("-net")))
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
@ -896,8 +902,8 @@ int qemudBuildCommandLine(struct qemud_server *server,
|
|||||||
no_memory:
|
no_memory:
|
||||||
if (argv) {
|
if (argv) {
|
||||||
for (i = 0 ; i < n ; i++)
|
for (i = 0 ; i < n ; i++)
|
||||||
free(argv[i]);
|
free((*argv)[i]);
|
||||||
free(argv);
|
free(*argv);
|
||||||
}
|
}
|
||||||
qemudReportError(server, VIR_ERR_NO_MEMORY, "argv");
|
qemudReportError(server, VIR_ERR_NO_MEMORY, "argv");
|
||||||
return -1;
|
return -1;
|
||||||
@ -1353,8 +1359,7 @@ char *qemudGenerateXML(struct qemud_server *server, struct qemud_vm *vm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
net = vm->def.nets;
|
net = vm->def.nets;
|
||||||
disk = vm->def.disks;
|
while (net) {
|
||||||
while (disk) {
|
|
||||||
const char *types[] = {
|
const char *types[] = {
|
||||||
"user",
|
"user",
|
||||||
"tap",
|
"tap",
|
||||||
@ -1367,7 +1372,9 @@ char *qemudGenerateXML(struct qemud_server *server, struct qemud_vm *vm) {
|
|||||||
types[net->type]) < 0)
|
types[net->type]) < 0)
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
if (qemudBufferPrintf(&buf, " <mac address='%02x:%02x:%02x:%02x:%02x:%02x'/>\n",
|
if (net->mac[0] && net->mac[1] && net->mac[2] &&
|
||||||
|
net->mac[3] && net->mac[4] && net->mac[5] &&
|
||||||
|
qemudBufferPrintf(&buf, " <mac address='%02x:%02x:%02x:%02x:%02x:%02x'/>\n",
|
||||||
net->mac[0], net->mac[1], net->mac[2],
|
net->mac[0], net->mac[1], net->mac[2],
|
||||||
net->mac[3], net->mac[4], net->mac[5]) < 0)
|
net->mac[3], net->mac[4], net->mac[5]) < 0)
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
@ -1375,7 +1382,7 @@ char *qemudGenerateXML(struct qemud_server *server, struct qemud_vm *vm) {
|
|||||||
if (qemudBufferPrintf(&buf, " </interface>\n") < 0)
|
if (qemudBufferPrintf(&buf, " </interface>\n") < 0)
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
disk = disk->next;
|
net = net->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm->def.graphicsType == QEMUD_GRAPHICS_VNC) {
|
if (vm->def.graphicsType == QEMUD_GRAPHICS_VNC) {
|
||||||
|
Loading…
Reference in New Issue
Block a user