]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Kill legacy USB monitor code
authorPeter Krempa <pkrempa@redhat.com>
Tue, 26 Apr 2016 11:45:15 +0000 (13:45 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 2 May 2016 07:12:14 +0000 (09:12 +0200)
Code was obsoleted by using -device.

src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.h
src/qemu/qemu_monitor_text.c
src/qemu/qemu_monitor_text.h

index fe8e89f45e596f40013f685b6c6d19b4bf2b0c2b..2ec422294649f851528d1353d5c331de8daa2a02 100644 (file)
@@ -2404,53 +2404,6 @@ qemuMonitorGraphicsRelocate(qemuMonitorPtr mon,
 }
 
 
-int
-qemuMonitorAddUSBDisk(qemuMonitorPtr mon,
-                      const char *path)
-{
-    VIR_DEBUG("path=%s", path);
-
-    QEMU_CHECK_MONITOR(mon);
-
-    if (mon->json)
-        return qemuMonitorJSONAddUSBDisk(mon, path);
-    else
-        return qemuMonitorTextAddUSBDisk(mon, path);
-}
-
-
-int
-qemuMonitorAddUSBDeviceExact(qemuMonitorPtr mon,
-                             int bus,
-                             int dev)
-{
-    VIR_DEBUG("bus=%d dev=%d", bus, dev);
-
-    QEMU_CHECK_MONITOR(mon);
-
-    if (mon->json)
-        return qemuMonitorJSONAddUSBDeviceExact(mon, bus, dev);
-    else
-        return qemuMonitorTextAddUSBDeviceExact(mon, bus, dev);
-}
-
-
-int
-qemuMonitorAddUSBDeviceMatch(qemuMonitorPtr mon,
-                             int vendor,
-                             int product)
-{
-    VIR_DEBUG("vendor=%d product=%d", vendor, product);
-
-    QEMU_CHECK_MONITOR(mon);
-
-    if (mon->json)
-        return qemuMonitorJSONAddUSBDeviceMatch(mon, vendor, product);
-    else
-        return qemuMonitorTextAddUSBDeviceMatch(mon, vendor, product);
-}
-
-
 int
 qemuMonitorAddPCIHostDevice(qemuMonitorPtr mon,
                             virDevicePCIAddress *hostAddr,
index 470c7292b3cf8bd423700f2d7618be9066180390..78257818914ae9bd7781cc53febd36a8afa7b10b 100644 (file)
@@ -628,20 +628,6 @@ int qemuMonitorGraphicsRelocate(qemuMonitorPtr mon,
                                 int tlsPort,
                                 const char *tlsSubject);
 
-/* XXX disk driver type eg,  qcow/etc.
- * XXX cache mode
- */
-int qemuMonitorAddUSBDisk(qemuMonitorPtr mon,
-                          const char *path);
-
-int qemuMonitorAddUSBDeviceExact(qemuMonitorPtr mon,
-                                 int bus,
-                                 int dev);
-int qemuMonitorAddUSBDeviceMatch(qemuMonitorPtr mon,
-                                 int vendor,
-                                 int product);
-
-
 int qemuMonitorAddPCIHostDevice(qemuMonitorPtr mon,
                                 virDevicePCIAddress *hostAddr,
                                 virDevicePCIAddress *guestAddr);
index 7bb99767c9bdd4cbd7e88577da3c54526dfe1451..509254844cef730e811b35d746cb6c0baec2d399 100644 (file)
@@ -3032,35 +3032,6 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
 }
 
 
-int qemuMonitorJSONAddUSBDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
-                              const char *path ATTRIBUTE_UNUSED)
-{
-    virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                   _("usb_add not supported in JSON mode"));
-    return -1;
-}
-
-
-int qemuMonitorJSONAddUSBDeviceExact(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
-                                     int bus ATTRIBUTE_UNUSED,
-                                     int dev ATTRIBUTE_UNUSED)
-{
-    virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                   _("usb_add not supported in JSON mode"));
-    return -1;
-}
-
-
-int qemuMonitorJSONAddUSBDeviceMatch(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
-                                     int vendor ATTRIBUTE_UNUSED,
-                                     int product ATTRIBUTE_UNUSED)
-{
-    virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                   _("usb_add not supported in JSON mode"));
-    return -1;
-}
-
-
 int qemuMonitorJSONAddPCIHostDevice(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
                                     virDevicePCIAddress *hostAddr ATTRIBUTE_UNUSED,
                                     virDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED)
index 8b5d4220d0886c6222bb7cd01e2499604fa66125..81247f4cf9ed58983643094928abbb7feb64c1d7 100644 (file)
@@ -169,17 +169,6 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
                                     int tlsPort,
                                     const char *tlsSubject);
 
-int qemuMonitorJSONAddUSBDisk(qemuMonitorPtr mon,
-                              const char *path);
-
-int qemuMonitorJSONAddUSBDeviceExact(qemuMonitorPtr mon,
-                                     int bus,
-                                     int dev);
-int qemuMonitorJSONAddUSBDeviceMatch(qemuMonitorPtr mon,
-                                     int vendor,
-                                     int product);
-
-
 int qemuMonitorJSONAddPCIHostDevice(qemuMonitorPtr mon,
                                     virDevicePCIAddress *hostAddr,
                                     virDevicePCIAddress *guestAddr);
index ccae02f99cf4d0bcab36c83f3da4db5ab43bbe4d..707addcdfdc301005b4b82f80fe281c6d8cbf810 100644 (file)
@@ -1572,105 +1572,6 @@ int qemuMonitorTextGraphicsRelocate(qemuMonitorPtr mon,
 }
 
 
-int qemuMonitorTextAddUSBDisk(qemuMonitorPtr mon,
-                              const char *path)
-{
-    char *cmd = NULL;
-    char *safepath;
-    int ret = -1;
-    char *info = NULL;
-
-    safepath = qemuMonitorEscapeArg(path);
-    if (!safepath)
-        return -1;
-
-    if (virAsprintf(&cmd, "usb_add disk:%s", safepath) < 0)
-        goto cleanup;
-
-    if (qemuMonitorHMPCommand(mon, cmd, &info) < 0)
-        goto cleanup;
-
-    /* If the command failed qemu prints:
-     * Could not add ... */
-    if (strstr(info, "Could not add ")) {
-        virReportError(VIR_ERR_OPERATION_FAILED,
-                       _("unable to add USB disk %s: %s"), path, info);
-        goto cleanup;
-    }
-
-    ret = 0;
-
- cleanup:
-    VIR_FREE(cmd);
-    VIR_FREE(safepath);
-    VIR_FREE(info);
-    return ret;
-}
-
-
-static int qemuMonitorTextAddUSBDevice(qemuMonitorPtr mon,
-                                       const char *addr)
-{
-    char *cmd;
-    char *reply = NULL;
-    int ret = -1;
-
-    if (virAsprintf(&cmd, "usb_add %s", addr) < 0)
-        return -1;
-
-    if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
-        goto cleanup;
-
-    /* If the command failed qemu prints:
-     * Could not add ... */
-    if (strstr(reply, "Could not add ")) {
-        virReportError(VIR_ERR_OPERATION_FAILED,
-                       "%s", _("adding usb device failed"));
-        goto cleanup;
-    }
-
-    ret = 0;
-
- cleanup:
-    VIR_FREE(cmd);
-    VIR_FREE(reply);
-    return ret;
-}
-
-
-int qemuMonitorTextAddUSBDeviceExact(qemuMonitorPtr mon,
-                                     int bus,
-                                     int dev)
-{
-    int ret;
-    char *addr;
-
-    if (virAsprintf(&addr, "host:%.3d.%.3d", bus, dev) < 0)
-        return -1;
-
-    ret = qemuMonitorTextAddUSBDevice(mon, addr);
-
-    VIR_FREE(addr);
-    return ret;
-}
-
-int qemuMonitorTextAddUSBDeviceMatch(qemuMonitorPtr mon,
-                                     int vendor,
-                                     int product)
-{
-    int ret;
-    char *addr;
-
-    if (virAsprintf(&addr, "host:%.4x:%.4x", vendor, product) < 0)
-        return -1;
-
-    ret = qemuMonitorTextAddUSBDevice(mon, addr);
-
-    VIR_FREE(addr);
-    return ret;
-}
-
-
 static int
 qemuMonitorTextParsePCIAddReply(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
                                 const char *reply,
index 287a8518b92531d40f7495f8aa6f6020a30749f7..d62e66815eaf0953bf1e379f9b93136ea793dcce 100644 (file)
@@ -119,17 +119,6 @@ int qemuMonitorTextGraphicsRelocate(qemuMonitorPtr mon,
                                     int tlsPort,
                                     const char *tlsSubject);
 
-int qemuMonitorTextAddUSBDisk(qemuMonitorPtr mon,
-                              const char *path);
-
-int qemuMonitorTextAddUSBDeviceExact(qemuMonitorPtr mon,
-                                     int bus,
-                                     int dev);
-int qemuMonitorTextAddUSBDeviceMatch(qemuMonitorPtr mon,
-                                     int vendor,
-                                     int product);
-
-
 int qemuMonitorTextAddPCIHostDevice(qemuMonitorPtr mon,
                                     virDevicePCIAddress *hostAddr,
                                     virDevicePCIAddress *guestAddr);