On Thu, Oct 20, 2011 at 04:52:50PM +0200, Michal Privoznik wrote:
This patch is rather cosmetic as it only moves device alias
assignation from command line construction just before that.
However, it is needed in connotation of previous and next patch.
---
src/qemu/qemu_command.c | 5 +----
src/qemu/qemu_command.h | 1 +
src/qemu/qemu_driver.c | 3 +++
src/qemu/qemu_process.c | 3 +++
tests/qemuxml2argvtest.c | 3 +++
tests/qemuxmlnstest.c | 3 +++
6 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 30c0be6..0c5bfab 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -656,7 +656,7 @@ qemuAssignDeviceControllerAlias(virDomainControllerDefPtr
controller)
}
-static int
+int
qemuAssignDeviceAliases(virDomainDefPtr def, virBitmapPtr qemuCaps)
{
int i;
@@ -3284,9 +3284,6 @@ qemuBuildCommandLine(virConnectPtr conn,
bool usblegacy = false;
uname_normalize(&ut);
- if (qemuAssignDeviceAliases(def, qemuCaps) < 0)
- return NULL;
-
virUUIDFormat(def->uuid, uuid);
emulator = def->emulator;
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 00e58a2..d34df8f 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -187,6 +187,7 @@ int qemuDomainPCIAddressReleaseSlot(qemuDomainPCIAddressSetPtr addrs,
int slot);
void qemuDomainPCIAddressSetFree(qemuDomainPCIAddressSetPtr addrs);
int qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs);
+int qemuAssignDeviceAliases(virDomainDefPtr def, virBitmapPtr qemuCaps);
int qemuDomainNetVLAN(virDomainNetDefPtr def);
int qemuAssignDeviceNetAlias(virDomainDefPtr def, virDomainNetDefPtr net, int idx);
int qemuAssignDeviceDiskAlias(virDomainDiskDefPtr def, virBitmapPtr qemuCaps);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 84ef4dd..3599ca3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4611,6 +4611,9 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
if (qemuProcessPrepareMonitorChr(driver, &monConfig, def->name) < 0)
goto cleanup;
+ if (qemuAssignDeviceAliases(def, qemuCaps) < 0)
+ goto cleanup;
+
if (!(cmd = qemuBuildCommandLine(conn, driver, def,
&monConfig, false, qemuCaps,
NULL, -1, NULL, VIR_VM_OP_NO_OP)))
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index a7fe86c..c0f6fd4 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3015,6 +3015,9 @@ int qemuProcessStart(virConnectPtr conn,
priv->persistentAddrs = 0;
}
+ if (qemuAssignDeviceAliases(vm->def, priv->qemuCaps) < 0)
+ goto cleanup;
+
VIR_DEBUG("Building emulator command line");
if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
priv->monJSON != 0, priv->qemuCaps,
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index a7ae925..a64f45e 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -118,6 +118,9 @@ static int testCompareXMLToArgvFiles(const char *xml,
qemuCapsSet(extraFlags, QEMU_CAPS_PCI_MULTIBUS);
}
+ if (qemuAssignDeviceAliases(vmdef, extraFlags) < 0)
+ goto fail;
+
if (!(cmd = qemuBuildCommandLine(conn, &driver,
vmdef, &monitor_chr, json, extraFlags,
migrateFrom, migrateFd, NULL,
diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c
index 03d5b03..b13b409 100644
--- a/tests/qemuxmlnstest.c
+++ b/tests/qemuxmlnstest.c
@@ -118,6 +118,9 @@ static int testCompareXMLToArgvFiles(const char *xml,
qemuCapsSet(extraFlags, QEMU_CAPS_PCI_MULTIBUS);
}
+ if (qemuAssignDeviceAliases(vmdef, extraFlags) < 0)
+ goto fail;
+
if (!(cmd = qemuBuildCommandLine(conn, &driver,
vmdef, &monitor_chr, json, extraFlags,
migrateFrom, migrateFd, NULL,
ACK
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|